当前位置: 首页>>代码示例>>C++>>正文


C++ TDesC16::AllocL方法代码示例

本文整理汇总了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;	
		   	 }
	   
	     }
   
    }
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:35,代码来源:searchinfoimp.cpp

示例2: SetGroupDisplayNameL

// ---------------------------------------------------------------------------
// From MPresentityGroupInfo class.
// CPresentityGroupInfoImp::SetGroupDisplayNameL()
// ---------------------------------------------------------------------------
//
void CPresentityGroupInfoImp::SetGroupDisplayNameL( 
    const TDesC16& aDisplayName )
    {
    HBufC16* displayNameBuf = aDisplayName.AllocL();
    iDisplayName.Close();
    iDisplayName.Assign( displayNameBuf );
    }
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:12,代码来源:presentitygroupinfoimp.cpp

示例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);
        }
    }
}
开发者ID:kuailexs,项目名称:symbiandump-mw4,代码行数:59,代码来源:upnphttpfileaccess.cpp

示例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();
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:8,代码来源:GETENV.CPP

示例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;
    }
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:12,代码来源:catalogsincompletemessage.cpp

示例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;
	}
开发者ID:kuailexs,项目名称:symbiandump-mw3,代码行数:23,代码来源:SyncMLDataFilterProperty.cpp

示例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()");
    }
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:69,代码来源:pkcs12vpn.cpp

示例8: ConstructL

// ---------------------------------------------------------------------------
// ?description_if_needed
// ---------------------------------------------------------------------------
//
void CXIMPTestFileTool::ConstructL( const TDesC16& aInstanceId )
    {
    iTimer = CPeriodic::NewL( CActive::EPriorityStandard );
    iInstance = aInstanceId.AllocL();
    }
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:9,代码来源:prfwtestfiletool.cpp


注:本文中的TDesC16::AllocL方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。