本文整理汇总了C++中HBufC16::AllocLC方法的典型用法代码示例。如果您正苦于以下问题:C++ HBufC16::AllocLC方法的具体用法?C++ HBufC16::AllocLC怎么用?C++ HBufC16::AllocLC使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HBufC16
的用法示例。
在下文中一共展示了HBufC16::AllocLC方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessTagL
// ---------------------------------------------------------
// CProcessorDN::ProcessTagL
// ---------------------------------------------------------
//
void CProcessorDN::ProcessTagL( TBool /*aFieldIDPresent*/ )
{
iDestinationDropped = EFalse;
iProtectionLevel = EProtLevel0;
if( iIsFirstRound )
{
TInt dnId = -1;
for ( TInt idx(0); idx < TagContainer().Count(); idx++)
{
if ( TagContainer().FieldId( idx ) == EDN_Id )
{
HBufC16* ptrTag = TagContainer().Tag(idx);
TLex16 lex(ptrTag->Des());
TInt err = lex.Val(dnId);
if (err != KErrNone)
{
CLOG_WRITE( "The destinaton Id field is bad.");
User::Leave(err);
}
break;
}
}
if (dnId == -1)
{
iDestination = iCmManager->CreateDestinationL( KDefaultDestinationName );
CLOG_WRITE( "Destinaton created without dnId.");
}
else
{
iDestination = iCmManager->CreateDestinationL( KDefaultDestinationName, dnId);
CLOG_WRITE_FORMAT( "Destinaton created. dnId:%d", dnId);
}
}
HBufC *destName( NULL );
TInt priority = 0;
RPointerArray<HBufC> names;
for (TInt idx(0); idx < TagContainer().Count(); idx++)
{
HBufC16* ptrTag = TagContainer().Tag(idx);
TInt field = TagContainer().FieldId( idx );
if( iIsFirstRound && !iDestinationDropped )
{
switch ( field )
{
case EDN_Name:
{
// If more destinations exist with same name then one is kept
TRAPD( err, iDestination.SetNameL( *ptrTag ) );
if( KErrAlreadyExists == err )
{
CLOG_WRITE_FORMAT(
"Error: Destination exist: %S. It is dropped!", ptrTag )
CLOG_WRITE( "\t \r\n" )
iDestinationDropped = ETrue;
}
else
{
destName = ptrTag->AllocLC();
}
}
break;
case EDN_Metadata:
{
if( !ptrTag->Compare( KPurposeUnknown ) )
{
iDestination.SetMetadataL( ESnapMetadataPurpose,
ESnapPurposeUnknown );
}
else if( !ptrTag->Compare( KPurposeInternet ) )
{
iDestination.SetMetadataL(
ESnapMetadataPurpose,
ESnapPurposeInternet );
}
else if( !ptrTag->Compare( KPurposeOperator ) )
{
iDestination.SetMetadataL(
ESnapMetadataPurpose,
ESnapPurposeOperator );
}
else if( !ptrTag->Compare( KPurposeMMS ) )
{
iDestination.SetMetadataL(
ESnapMetadataPurpose,
ESnapPurposeMMS );
}
else if( !ptrTag->Compare( KPurposeIntranet ) )
{
iDestination.SetMetadataL(
ESnapMetadataPurpose,
//.........这里部分代码省略.........