本文整理汇总了C++中RBuf8::CreateMaxL方法的典型用法代码示例。如果您正苦于以下问题:C++ RBuf8::CreateMaxL方法的具体用法?C++ RBuf8::CreateMaxL怎么用?C++ RBuf8::CreateMaxL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RBuf8
的用法示例。
在下文中一共展示了RBuf8::CreateMaxL方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoL
void TBuildPublishAndRootDeviceInfo::DoL ( )
{
if ( iContext.Node ( ).PublishInfo ( ) )
{
return;
}
TUpnpMessage::TRegisterRootDevice& msg = message_cast< TUpnpMessage::TRegisterRootDevice > ( iContext.iMessage );
CUPnPDevice* device = static_cast <CUPnPDevice*> ( msg.iPtr );
CStringPoolManager& stringPoolMgr = iContext.Node ().ConnectionProvider ().StringPoolManager ();
RStringPool& sp = stringPoolMgr.StringPool ( );
const TStringTable& upnpTable = stringPoolMgr.GetUPnPTable();
CUPnPPublishInfoElement* publishInfo = CUPnPPublishInfoElement::NewL ( );
CleanupStack::PushL ( publishInfo );
publishInfo->SetKeyL( iContext.Node ().ConnectionProvider ().RootDeviceLocation () );
publishInfo->SetSearchTargetL( KRootDevice ( ) ); //upnp:rootdevice
publishInfo->SetCacheControlL( KCacheControl );
const TDesC8& udnPtr = device->Property( sp.String ( UPNPDESCRIPTIONXMLTAGS::EUdn, upnpTable ) );
const TDesC8& deviceTypePtr = device->Property( sp.String(UPNPDESCRIPTIONXMLTAGS::EDeviceType,upnpTable ) );
publishInfo->SetUuidL ( udnPtr );
// Set Usn to udn + devicetype
TInt len = udnPtr.Length ( ) + KSeperator.iTypeLength + deviceTypePtr.Length ( );
RBuf8 tempBuf;
tempBuf.CreateMaxL ( len );
CleanupClosePushL ( tempBuf );
tempBuf.Copy ( udnPtr );
tempBuf.Append ( KSeperator ( ) );
tempBuf.Append ( deviceTypePtr );
publishInfo->SetUsnL( tempBuf );
iContext.Node ( ).SetPublishInfoL ( publishInfo );
// store deviceType in SCPr node for reference in M-Search Response Activity
iContext.Node ( ).SetRootDeviceUrnL ( deviceTypePtr );
CleanupStack::PopAndDestroy ( &tempBuf );
CleanupStack::Pop ( publishInfo );
}
示例2: RetrieveCharacteristicsL
TInt CryptoSpiUtil::RetrieveCharacteristicsL(TInt32 aInterface, RDesReadStream& aStream, RBuf8& aBuf, TInt& aCount)
{
// first we are only trying to retrieve the length of the buffer
TBuf8<sizeof(TInt32)> buf;
TInt testResult = RProperty::Get(KCryptoSpiPropertyCat, aInterface, buf);
if (testResult==KErrNotFound)
{
//run the exe to Publish the properties
RunCryptoSpiPropertySetupExe();
// testresult would be checked outside the loop
testResult = RProperty::Get(KCryptoSpiPropertyCat, aInterface, buf);
}
// overflow will occur as we are only retrieving the length first.
// any other error we should leave
if(testResult != KErrOverflow)
{
User::LeaveIfError(testResult);
}
//read the length
RDesReadStream rStream(buf);
TInt32 len=rStream.ReadInt32L();
//If the property is empty
if (len<=4)
{
return len;
}
//Allocate memory
aBuf.CreateMaxL(len);
User::LeaveIfError(RProperty::Get(KCryptoSpiPropertyCat, aInterface, aBuf));
//Read the length
aStream.Open(aBuf);
len=aStream.ReadInt32L();
//Read the count of the characteristics
aCount=aStream.ReadInt16L();
return len;
}