本文整理汇总了C++中HBufC::Size方法的典型用法代码示例。如果您正苦于以下问题:C++ HBufC::Size方法的具体用法?C++ HBufC::Size怎么用?C++ HBufC::Size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HBufC
的用法示例。
在下文中一共展示了HBufC::Size方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Write
void CMemEntry::Write()
//
// Write the current entry.
//
{
test(TheFile.Write(TPtrC8((TUint8*)&iEntry,KRomEntrySize))==KErrNone);
test(TheFile.Write(TPtrC8((TUint8*)iName->Ptr(),iName->Size()))==KErrNone);
TInt rem=EntrySize()-iName->Size()-KRomEntrySize;
if (rem)
test(TheFile.Write(TheFiller,rem)==KErrNone);
}
示例2: writeToStreamLX
void writeToStreamLX(const QMimeData* aData, RWriteStream& aStream)
{
// This function both leaves and throws exceptions. There must be no destructor
// dependencies between cleanup styles, and no cleanup stack dependencies on stacked objects.
QStringList headers = aData->formats();
aStream << TCardinality(headers.count());
for (QStringList::const_iterator iter= headers.constBegin();iter != headers.constEnd();iter++)
{
HBufC* stringData = TPtrC(reinterpret_cast<const TUint16*>((*iter).utf16())).AllocLC();
QByteArray ba = aData->data((*iter));
// mime type
aStream << TCardinality(stringData->Size());
aStream << *(stringData);
// mime data
aStream << TCardinality(ba.size());
aStream.WriteL(reinterpret_cast<const uchar*>(ba.constData()),ba.size());
CleanupStack::PopAndDestroy(stringData);
}
}
示例3: ParseL
// ---------------------------------------------------------
// TDdParser::ParseL()
// ---------------------------------------------------------
//
void TDdParser::ParseL( const TDesC& aBuf, CCodData& aData, const TBool aIsDd2, TBool& aIsLicenseTag )
{
CLOG(( EParse, 2, _L("-> TDdParser::ParseL") ));
CDUMP(( EParse, 2, _S("Buf:"), _S(" "), \
(const TUint8*)aBuf.Ptr(), aBuf.Size() ));
iError = KErrNone;
iData = &aData;
// XML Parser expects the buffer contain a BOM and be in
// network byte order (this is hard-coded into cXmlParser).
// We already have the buffer converted to UCS-2, native byte order, BOM
// removed, and this cannot be changed without changing API.
// So we have to re-add BOM and convert the buffer back to network byte
// order. This is an annoying a waste, luckily a DD file is small
// enough not to be significant.
HBufC* buf = HBufC::NewLC( aBuf.Length() + 1 );
buf->Des().Append( 0xFFFE ); // Add BOM, little endian as aBuf.
buf->Des().Append( aBuf ); // Append buffer.
// Now turn the whole buffer big-endian.
TUint8* ptr = (TUint8*)buf->Ptr();
for ( TInt i = 0; i < buf->Size(); i += 2 )
{
TUint8 tmp = ptr[i];
ptr[i] = ptr[i + 1];
ptr[i + 1] = tmp;
}
NW_WBXML_Dictionary_t* dictArray[ 1 ] =
{ (NW_WBXML_Dictionary_t*)&NW_DdDummy_WBXMLDictionary };
RNwWbxmlDictionary wbxmlDict;
User::LeaveIfError( wbxmlDict.Initialize( 1, dictArray ) );
CleanupClosePushL<RNwWbxmlDictionary>( wbxmlDict );
NW_TinyDom_Handle_t domHandle;
NW_Status_t stat;
CNwDomDocumentNode* docNode = new (ELeave) CNwDomDocumentNode();
CleanupStack::PushL( docNode );
docNode->iDocNode = CXML_DOM_DocumentNode_BuildTree
(
&domHandle,
(NW_Byte*)buf->Ptr(),
(NW_Int32)buf->Size(),
/*encoded=*/NW_FALSE,
/*publicID=*/NW_DdDummy_PublicId,
/*extTNotStringTable=*/NW_FALSE,
&stat
);
LeaveIfNwErrorL( stat );
User::LeaveIfNull( docNode->iDocNode ); // Safety code.
if (!aIsDd2)
{
DocNodeL( docNode->iDocNode );
}
else
{
iIsLicenseTag = EFalse;
ParseDd2DocNodeL( docNode->iDocNode );
}
CleanupStack::PopAndDestroy( 3, buf ); // docNode, close wbxmlDict, buf
#ifdef __TEST_COD_LOG
TPtrC ptr16;
TPtrC8 ptr8;
CLOG(( EParse, 3, _L("TCodParser::ParseL data:") ));
ptr16.Set( aData.Name() );
CLOG(( EParse, 3, _L(" Name<%S>"), &ptr16 ));
ptr16.Set( aData.Vendor() );
CLOG(( EParse, 3, _L(" Vendor<%S>"), &ptr16 ));
ptr16.Set( aData.Description() );
CLOG(( EParse, 3, _L(" Desc<%S>"), &ptr16 ));
CLOG(( EParse, 3, _L(" Size(%d)"), aData.Size() ));
ptr8.Set( aData.InstallNotify() );
CLOG(( EParse, 3, _L8(" InstNotif<%S>"), &ptr8 ));
ptr8.Set( aData.NextUrl() );
CLOG(( EParse, 3, _L8(" NextUrl<%S>"), &ptr8 ));
ptr8.Set( aData.NextUrlAtError() );
CLOG(( EParse, 3, _L8(" NextUrlAtErr<%S>"), &ptr8 ));
ptr8.Set( aData.InfoUrl() );
CLOG(( EParse, 3, _L8(" InfoUrl<%S>"), &ptr8 ));
ptr16.Set( aData.Price() );
CLOG(( EParse, 3, _L(" Price<%S>"), &ptr16 ));
ptr8.Set( aData.Icon() );
CLOG(( EParse, 3, _L8(" Icon<%S>"), &ptr8 ));
//TODO add logs for OMA 2
#endif /* def __TEST_COD_LOG */
//If there are no media objects present to download,
if( !iData->Count() )
{
User::Leave( KErrCodInvalidDescriptor );
}
// NULL data for clarity. These are never used later, but don't keep
// pointers to objects which are out of reach.
iData = NULL;
User::LeaveIfError( iError );
aIsLicenseTag = iIsLicenseTag;
//.........这里部分代码省略.........