本文整理汇总了C++中TDesC16::AllocL方法的典型用法代码示例。如果您正苦于以下问题:C++ TDesC16::AllocL方法的具体用法?C++ TDesC16::AllocL怎么用?C++ TDesC16::AllocL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TDesC16
的用法示例。
在下文中一共展示了TDesC16::AllocL方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetFieldInfoL
// ---------------------------------------------------------------------------
// From MsearchInfo class.
// CSearchInfoImp::SetFieldInfoL()
// ---------------------------------------------------------------------------
//
void CSearchInfoImp::SetFieldInfoL(const TDesC16& aFieldInfo ,TInfoType aType)
{
switch(aType)
{
case EFirstName:
{
HBufC16* buf = aFieldInfo.AllocL();
iFirstname.Close();
iFirstname.Assign( buf );
break;
}
case ELastName:
{
HBufC16* buf= aFieldInfo.AllocL();
iLastname.Close();
iLastname.Assign( buf );
break;
}
case EEmailAddress:
{
HBufC16* buf = aFieldInfo.AllocL();
iEmailId.Close();
iEmailId.Assign( buf );
break;
}
}
}
示例2: SetGroupDisplayNameL
// ---------------------------------------------------------------------------
// From MPresentityGroupInfo class.
// CPresentityGroupInfoImp::SetGroupDisplayNameL()
// ---------------------------------------------------------------------------
//
void CPresentityGroupInfoImp::SetGroupDisplayNameL(
const TDesC16& aDisplayName )
{
HBufC16* displayNameBuf = aDisplayName.AllocL();
iDisplayName.Close();
iDisplayName.Assign( displayNameBuf );
}
示例3: ConstructL
void CUpnpHttpFileAccess::ConstructL( CUpnpHttpSession* aSession,
const TDesC16& aFilename )
{
LOGS1(
"%i, CUpnpHttpFileAccess::ConstructL(CUpnpHttpSession*, TDesC16&)",
this );
User::LeaveIfError(iFsSession.Connect());
iFileToServe = aFilename.AllocL();
TInt error = 0;
iPosInFile = 0;
iHeaderLength = 0;
iSession = aSession;
if (iSession->OverwriteExisting() && !iSession->SaveAtOffset())
{
error = iFile.Replace(iFsSession, *iFileToServe, EFileWrite
| EFileShareAny);
User::LeaveIfError(error);
}
else if (iSession->OverwriteExisting() && iSession->SaveAtOffset())
{
error = iFile.Open(iFsSession, *iFileToServe, EFileWrite
| EFileShareAny);
if (error != KErrNotFound)
{
TInt size = 0;
error = iFile.Size(size);
if (size >= (iSession->Offset()))
{
iPosInFile = iSession->Offset();
}
else
{
iFile.Close();
error = iFile.Replace(iFsSession, *iFileToServe, EFileWrite
| EFileShareAny);
User::LeaveIfError(error);
}
}
else
{
error = iFile.Create(iFsSession, *iFileToServe, EFileWrite
| EFileShareAny);
User::LeaveIfError(error);
}
}
else
{
error = iFile.Open(iFsSession, *iFileToServe, EFileWrite
| EFileShareAny);
if (error == KErrNotFound)
{
error = iFile.Create(iFsSession, *iFileToServe, EFileWrite
| EFileShareAny);
User::LeaveIfError(error);
}
}
}
示例4: ConstructL
void TEnvVar::ConstructL(const TDesC16& aName, const wchar_t* aValue)
{
TPtrC16 valueZ = ValuePtr(aValue);
HBufC16* valueCopy = valueZ.AllocLC();
iName = aName.AllocL();
iValue = valueCopy;
CleanupStack::Pop();
}
示例5: SetMessageL
void CCatalogsIncompleteMessage::SetMessageL( const TDesC16& aMessage,
TInt aReturnValue )
{
// Only one message can be stored at any one moment
if ( iMessageType != -1 )
{
User::Leave( KErrGeneral );
}
iMessageWide = aMessage.AllocL();
iReturnValue = aReturnValue;
iMessageType = 16;
}
示例6:
// -----------------------------------------------------------------------------
// CSyncMLFilterProperty::SetQueryValueText16L
// Sets query value for text16 property.
// This is useful only if data type is text16 and if query value can be used.
// This method also selects query value.
// -----------------------------------------------------------------------------
EXPORT_C void
CSyncMLFilterProperty::SetQueryValueText16L( const TDesC16& aValue )
{
if ( iDataTypeForQueryValue != ESyncMLDataTypeText16 || !iCanUseQueryValue )
{
User::Leave( KErrNotSupported );
}
if ( aValue.Length() > iMaxTextLength )
{
User::Leave( KErrArgument );
}
delete iQueryValueText16;
iQueryValueText16 = NULL;
iQueryValueText16 = aValue.AllocL();
iQueryValueSelected = ETrue;
}
示例7: LEAVE
void CPKCS12Handler::ExtractSecurityObjectsL(const TDesC8& aData,
const TDesC16& aPwd)
{
LOG_("-> CPKCS12Handler::ExtractSecurityObjectsL()");
if (iPassword)
{
delete iPassword;
iPassword = NULL;
}
// Make sure the data is in PKCS#12 format
if (!VerifyType(aData))
{
LOG_("<- CPKCS12Handler::ExtractSecurityObjectsL() LEAVE (KErrNotSupported)");
User::Leave(KErrArgument);
}
// If we have been provided with a valid password, then proceed
// to decrypt / parse; otherwise, prompt for pwd.
if (aPwd.Length() > 0)
{
iPassword = aPwd.AllocL();
LOG_(" Password provided by OMADM...");
}
else
{
LOG_(" No password provided, prompting the user for one");
iPassword = QueryPasswordL();
}
// Keep asking for the password until user cancels or inputs the
// correct password
while (ETrue)
{
if (iPassword)
{
LOG_1(" Non-NULL password '%S' in use, decrypting", iPassword);
TRAPD(err, iPkcsHandler->ParseL(aData, *iPassword));
if (err != KErrNone)
{
LOG_(" Breaking news: Password proved a miserable failure! Program terminated abruptly!");
DisplayWrongPasswordNote();
delete iPassword;
iPassword = NULL;
iPassword = QueryPasswordL();
}
else
{
// Correct password provided by the user,
// break free from the vicious cycle.
delete iPassword;
iPassword = NULL;
break;
}
}
else
{
// User got tired of guessing and resorted to cancel
LOG_("<- CPKCS12Handler::ExtractSecurityObjectsL() LEAVE (KErrCancel)");
User::Leave(KErrBadPassphrase);
}
}
// Fetch references to keys and certs
ExtractKeysAndCerts();
LOG_("<- CPKCS12Handler::ExtractSecurityObjectsL()");
}
示例8: ConstructL
// ---------------------------------------------------------------------------
// ?description_if_needed
// ---------------------------------------------------------------------------
//
void CXIMPTestFileTool::ConstructL( const TDesC16& aInstanceId )
{
iTimer = CPeriodic::NewL( CActive::EPriorityStandard );
iInstance = aInstanceId.AllocL();
}