本文整理汇总了C++中Brh::Set方法的典型用法代码示例。如果您正苦于以下问题:C++ Brh::Set方法的具体用法?C++ Brh::Set怎么用?C++ Brh::Set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Brh
的用法示例。
在下文中一共展示了Brh::Set方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetAttribute
TBool CpiDeviceUpnp::GetAttribute(const char* aKey, Brh& aValue) const
{
Brn key(aKey);
Parser parser(key);
if (parser.Next('.') == Brn("Upnp")) {
Brn property = parser.Remaining();
if (property == Brn("Location")) {
aValue.Set(iLocation);
return (true);
}
if (property == Brn("DeviceXml")) {
aValue.Set(iXml);
return (true);
}
const DeviceXml* device = iDeviceXml;
if (parser.Next('.') == Brn("Root")) {
device = &iDeviceXmlDocument->Root();
property.Set(parser.Remaining());
}
try {
if (property == Brn("FriendlyName")) {
device->GetFriendlyName(aValue);
return (true);
}
if (property == Brn("PresentationUrl")) {
device->GetPresentationUrl(aValue);
return (true);
}
Parser parser(property);
Brn token = parser.Next('.');
if (token == Brn("Service")) {
aValue.Set(device->ServiceVersion(parser.Remaining()));
return (true);
}
}
catch (XmlError&) {
}
}
return (false);
}
示例2:
int32_t STDCALL DvProviderAvOpenhomeOrgRadio1SetPropertyIdArray(THandle aProvider, const char* aValue, uint32_t aValueLen, uint32_t* aChanged)
{
Brh buf;
buf.Set((const TByte*)aValue, aValueLen);
*aChanged = (reinterpret_cast<DvProviderAvOpenhomeOrgRadio1C*>(aProvider)->SetPropertyIdArray(buf)? 1 : 0);
return 0;
}
示例3: invocationWrapper
void DvProviderAvOpenhomeOrgRadio1C::DoIdArray(IDviInvocation& aInvocation)
{
DvInvocationCPrivate invocationWrapper(aInvocation);
IDvInvocationC* invocationC;
void* invocationCPtr;
invocationWrapper.GetInvocationC(&invocationC, &invocationCPtr);
aInvocation.InvocationReadStart();
aInvocation.InvocationReadEnd();
DviInvocation invocation(aInvocation);
uint32_t Token;
char* Array;
uint32_t ArrayLen;
ASSERT(iCallbackIdArray != NULL);
if (0 != iCallbackIdArray(iPtrIdArray, invocationC, invocationCPtr, &Token, &Array, &ArrayLen)) {
invocation.Error(502, Brn("Action failed"));
return;
}
DviInvocationResponseUint respToken(aInvocation, "Token");
DviInvocationResponseBinary respArray(aInvocation, "Array");
invocation.StartResponse();
respToken.Write(Token);
Brh bufArray;
bufArray.Set((const TByte*)Array, ArrayLen);
OhNetFreeExternal(Array);
respArray.Write(bufArray);
respArray.WriteFlush();
invocation.EndResponse();
}
示例4: PropertyReadLock
void CpProxyAvOpenhomeOrgRadio1::PropertyIdArray(Brh& aIdArray) const
{
PropertyReadLock();
ASSERT(iCpSubscriptionStatus == CpProxy::eSubscribed);
aIdArray.Set(iIdArray->Value());
PropertyReadUnlock();
}
示例5: a
void CpProxyOpenhomeOrgTestBasic1::PropertyVarBin(Brh& aVarBin) const
{
AutoMutex a(iCpProxy.PropertyReadLock());
if (iCpProxy.GetSubscriptionStatus() != CpProxy::eSubscribed) {
THROW(ProxyNotSubscribed);
}
aVarBin.Set(iVarBin->Value());
}
示例6: GetAttribute
TBool CpiDeviceDv::GetAttribute(const char* aKey, Brh& aValue) const
{
const TChar* value = NULL;
iDeviceDv.GetAttribute(aKey, &value);
if (value != NULL) {
aValue.Set(value);
}
return false;
}
示例7: DoSubscribe
void CpiSubscription::DoSubscribe()
{
CpStack& cpStack = iDevice.GetCpStack();
Bws<Uri::kMaxUriBytes> uri;
uri.Append(Http::kSchemeHttp);
NetworkAdapter* nif = cpStack.Env().NetworkAdapterList().CurrentAdapter("CpiSubscription::DoSubscribe");
if (nif == NULL) {
THROW(NetworkError);
}
TIpAddress nifAddr = nif->Address();
nif->RemoveRef("CpiSubscription::DoSubscribe");
Endpoint endpt(cpStack.SubscriptionManager().EventServerPort(), nifAddr);
Endpoint::EndpointBuf buf;
endpt.AppendEndpoint(buf);
uri.Append(buf);
uri.Append('/');
Uri subscriber(uri);
LOG(kEvent, "Subscribing - service = ");
LOG(kEvent, iServiceType.FullName());
LOG(kEvent, "\n subscriber = ");
LOG(kEvent, subscriber.AbsoluteUri());
LOG(kEvent, "\n");
iNextSequenceNumber = 0;
TUint renewSecs;
try {
renewSecs = iDevice.Subscribe(*this, subscriber);
}
catch (XmlError&) {
// we don't expect to ever get here. Its worth capturing some debug info if we do.
Brh deviceXml;
if (!iDevice.GetAttribute("Upnp.DeviceXml", deviceXml)) {
deviceXml.Set("[missing]");
}
const Brx& udn = iDevice.Udn();
cpStack.Env().Mutex().Wait();
Log::Print("XmlError attempting to subscribe to device ");
Log::Print(udn);
Log::Print(", with xml\n\n");
Log::Print(deviceXml);
Log::Print("\n\n");
cpStack.Env().Mutex().Signal();
THROW(XmlError);
}
cpStack.SubscriptionManager().Add(*this);
LOG(kEvent, "Subscription for ");
LOG(kEvent, iServiceType.FullName());
LOG(kEvent, " completed\n Sid is ");
LOG(kEvent, iSid);
LOG(kEvent, "\n Renew in %u secs\n", renewSecs);
SetRenewTimer(renewSecs);
}
示例8: ServicePropertySetValueBinary
uint32_t STDCALL ServicePropertySetValueBinary(ServiceProperty aProperty, uint8_t* aValue, uint32_t aLen)
{
PropertyBinary* prop = reinterpret_cast<PropertyBinary*>(aProperty);
ASSERT(prop != NULL);
Brh data;
data.Set(aValue, aLen);
if (prop->SetValue(data)) {
return 1;
}
return 0;
}
示例9: invocationWrapper
void DvProviderAvOpenhomeOrgCredentials1C::DoGet(IDviInvocation& aInvocation)
{
DvInvocationCPrivate invocationWrapper(aInvocation);
IDvInvocationC* invocationC;
void* invocationCPtr;
invocationWrapper.GetInvocationC(&invocationC, &invocationCPtr);
aInvocation.InvocationReadStart();
Brhz Id;
aInvocation.InvocationReadString("Id", Id);
aInvocation.InvocationReadEnd();
DviInvocation invocation(aInvocation);
char* UserName;
char* Password;
uint32_t PasswordLen;
uint32_t Enabled;
char* Status;
char* Data;
ASSERT(iCallbackGet != NULL);
if (0 != iCallbackGet(iPtrGet, invocationC, invocationCPtr, (const char*)Id.Ptr(), &UserName, &Password, &PasswordLen, &Enabled, &Status, &Data)) {
invocation.Error(502, Brn("Action failed"));
return;
}
DviInvocationResponseString respUserName(aInvocation, "UserName");
DviInvocationResponseBinary respPassword(aInvocation, "Password");
DviInvocationResponseBool respEnabled(aInvocation, "Enabled");
DviInvocationResponseString respStatus(aInvocation, "Status");
DviInvocationResponseString respData(aInvocation, "Data");
invocation.StartResponse();
Brhz bufUserName((const TChar*)UserName);
OhNetFreeExternal(UserName);
respUserName.Write(bufUserName);
respUserName.WriteFlush();
Brh bufPassword;
bufPassword.Set((const TByte*)Password, PasswordLen);
OhNetFreeExternal(Password);
respPassword.Write(bufPassword);
respPassword.WriteFlush();
respEnabled.Write((Enabled!=0));
Brhz bufStatus((const TChar*)Status);
OhNetFreeExternal(Status);
respStatus.Write(bufStatus);
respStatus.WriteFlush();
Brhz bufData((const TChar*)Data);
OhNetFreeExternal(Data);
respData.Write(bufData);
respData.WriteFlush();
invocation.EndResponse();
}
示例10: ASSERT
void DvProviderAvOpenhomeOrgRadio1C::GetPropertyIdArray(Brh& aValue)
{
ASSERT(iPropertyIdArray != NULL);
aValue.Set(iPropertyIdArray->Value());
}
示例11: InvocationReadBinary
void InvocationDv::InvocationReadBinary(const TChar* aName, Brh& aData)
{
ArgumentBinary* arg = static_cast<ArgumentBinary*>(InputArgument(aName));
aData.Set(arg->Value());
}
示例12:
void DvProviderAvOpenhomeOrgPlaylist1::GetPropertyIdArray(Brh& aValue)
{
aValue.Set(iPropertyIdArray->Value());
}
示例13: ASSERT
void DvProviderOpenhomeOrgTestBasic1::GetPropertyVarBin(Brh& aValue)
{
ASSERT(iPropertyVarBin != NULL);
aValue.Set(iPropertyVarBin->Value());
}