本文整理汇总了C++中TDesC::AllocL方法的典型用法代码示例。如果您正苦于以下问题:C++ TDesC::AllocL方法的具体用法?C++ TDesC::AllocL怎么用?C++ TDesC::AllocL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TDesC
的用法示例。
在下文中一共展示了TDesC::AllocL方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ConstructL
void CFolderScanner::ConstructL( CFolderScanner_if* client
, const TDesC& folder
, const TDesC& ext
, int aScanPeriod)
{
iClient = client;
iTimeout = aScanPeriod;
iFolder = folder.AllocL();
iScanExt = ext.AllocL();
User::LeaveIfError(iFs.Connect());
// Check that folder really exist
TEntry entry;
TInt err = iFs.Entry(folder, entry);
// If not found, attempt to create
if(err == KErrNotFound)
{
err = iFs.MkDirAll(*iFolder);
}
User::LeaveIfError(err);
// Create a timer
iTimer = CSysTimer::NewL(this, 0);
// we want first callback immediately
iTimer->MilliSeconds(0);
}
示例2: ConstructL
void CPostProcessorInfo::ConstructL(const TDesC& aManufacturer,
const TDesC& aIdentifier,
const TArray<TUncompressedVideoFormat>& aSupportedFormats,
const TArray<TUint32>& aSupportedCombinations,
const TArray<TScaleFactor>& aSupportedScaleFactors,
const TDesC8& aImplementationSpecificInfo)
{
iManufacturer = aManufacturer.AllocL();
iIdentifier = aIdentifier.AllocL();
iImplementationSpecificInfo = aImplementationSpecificInfo.AllocL();
TInt i=0;
TInt supportedFormatsCount = aSupportedFormats.Count();
for (i=0; i<supportedFormatsCount; i++)
{
User::LeaveIfError(iSupportedFormats.Append(aSupportedFormats[i]));
}
TInt supportedCombinationsCount = aSupportedCombinations.Count();
for (i=0; i<supportedCombinationsCount; i++)
{
User::LeaveIfError(iSupportedCombinations.Append(aSupportedCombinations[i]));
}
TInt supportedScaleFactors = aSupportedScaleFactors.Count();
for (i=0; i<supportedScaleFactors; i++)
{
User::LeaveIfError(iSupportedScaleFactors.Append(aSupportedScaleFactors[i]));
}
}
示例3: ConstructL
void CNcdSubscriptionsSourceIdentifier::ConstructL(
const TDesC& aUri,
const TDesC& aNamespace )
{
iUri = aUri.AllocL();
iNamespace = aNamespace.AllocL();
}
示例4: AddCollectionDataL
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
//
void CPosLmXmlEncoder::AddCollectionDataL(
TPosLmCollectionDataId aDataId,
const TDesC& aCollectionData)
{
__ASSERT_ALWAYS((iEncoderStatus != EPosUninitialized) &&
(iEncoderStatus != EPosLmInfoAdded),
Panic(KPosLandmarksClientPanic, EPosLmProtocolBreak));
__ASSERT_ALWAYS(aDataId != EPosLmCollDataNone,
Panic(KPosLandmarksClientPanic, EPosLmInvalidArgument));
if (aDataId == EPosLmCollDataCollectionName)
{
if (iCollectionDataName)
{
User::Leave(KErrAlreadyExists);
}
iCollectionDataName = aCollectionData.AllocL();
}
else if (aDataId == EPosLmCollDataCollectionDescription)
{
if (iCollectionDataDescription)
{
User::Leave(KErrAlreadyExists);
}
iCollectionDataDescription = aCollectionData.AllocL();
}
else
{
// Silently ignore unknown collection data.
return;
}
iEncoderStatus = EPosCollectionInfoAdded;
}
示例5: SetAttributeDesL
// ---------------------------------------------------------------------------
//
// ---------------------------------------------------------------------------
TInt CSvgStyleElementImpl::SetAttributeDesL( const TInt aNameId,
const TDesC& aValue )
{
switch (aNameId)
{
case KAtrType:
delete iType;
iType = NULL;
iType = aValue.AllocL();
break;
case KAtrMedia:
delete iMedia;
iMedia = NULL;
iMedia = aValue.AllocL();
break;
case KAtrTitle:
delete iTitle;
iTitle = NULL;
iTitle = aValue.AllocL();
break;
default:
return CSvgElementImpl::SetAttributeDesL( aNameId, aValue );
}
return KErrNone;
}
示例6: ConstructL
// ---------------------------------------------------------------------------
// CAknDiscreetPopupDrawer::ConstructL
// ---------------------------------------------------------------------------
//
void CAknDiscreetPopupDrawer::ConstructL( const TDesC& aTitleText,
const TDesC& aBodyText,
const TAknsItemID& aSkinId,
const TDesC& aBitmapFile,
const TInt& aBitmapId,
const TInt& aMaskId )
{
// Body text to title text if title text is empty
if ( aTitleText == KNullDesC && aBodyText != KNullDesC )
{
iTitleText = aBodyText.AllocL();
}
else
{
iTitleText = aTitleText.AllocL();
iBodyText = aBodyText.AllocL();
}
if ( !iIcon )
{
iIcon = CreatePopupIconL( aSkinId,
aBitmapFile,
aBitmapId,
aMaskId );
}
}
示例7: ConstructL
// Symbian OS default constructor can leave.
void CBSBrandHandler::ConstructL( const TDesC& aApplicationId,
const TDesC& aBrandId,
const TDesC& aDefaultBrandId,
CBSSession* aSession )
{
iApplicationId = aApplicationId.AllocL();
iBrandId = aBrandId.AllocL();
iDefaultBrandId = aDefaultBrandId.AllocL();
iSession = aSession;
User::LeaveIfError( iFs.Connect() );
iHandle = new(ELeave) RFile(); // CSI: 74 # this needs to be like this
isDefaultBrandUsed = ETrue;
iStorageManager = CBSStorageManager::NewL( iSession, KNullDesC );
TInt err = -1;
TRAP (err, iStorageManager->BrandHandleL( *iApplicationId,
*iBrandId, iLanguage,
*iHandle,
iReserved ));
if (err != KErrNone)
{
iStorageManager->BrandHandleL( *iApplicationId,
*iDefaultBrandId, iLanguage,
*iHandle,
iReserved );
}
VerifyVersionL();
}
示例8: ConstructL
void CMemSpyEngineHelperSysMemTrackerCycleChangeOpenFile::ConstructL( const TDesC& aThreadName, const TDesC& aFileName )
{
BaseConstructL();
// Save the thread name
iFileName = aFileName.AllocL();
iThreadName = aThreadName.AllocL();
}
示例9: ConstructL
// ---------------------------------------------------------------------------
// ConstructL
// ---------------------------------------------------------------------------
//
void CNcdKeyValuePair::ConstructL( const TDesC& aKey, const TDesC& aValue )
{
if ( !aKey.Length() )
{
User::Leave( KErrArgument );
}
iKey = aKey.AllocL();
iValue = aValue.AllocL();
}
示例10: ConstructL
/**
Second phase construtor.
@param aStandardName The standard name of the time zone, for instance "Greenwich Mean
Time", "Pacific Standard Time".
@param aDaylightName The daylight saving time name, for instance "British Summer Time",
"Pacific Daylight Time" of this time zone.
@param aShortStandardName The short standard name, for instance "GMT", "PST" of this
time zone.
@param aShortDaylightName The short daylight saving time name, for instance "BST",
"PDT" of this time zone.
*/
void CTzLocalizedTimeZone::ConstructL(
const TDesC& aStandardName,
const TDesC& aDaylightName,
const TDesC& aShortStandardName,
const TDesC& aShortDaylightName)
{
iStandardName = aStandardName.AllocL();
iDaylightName = aDaylightName.AllocL();
iShortStandardName = aShortStandardName.AllocL();
iShortDaylightName = aShortDaylightName.AllocL();
}
示例11: DLTRACEIN
// ---------------------------------------------------------------------------
// ConstructL
// ---------------------------------------------------------------------------
//
void CNcdPreviewManager::CNcdPreviewData::ConstructL(
const CNcdNodeIdentifier& aId,
const TDesC& aUri,
const TDesC& aPreviewFile,
const TDesC& aMimeType )
{
DLTRACEIN((""));
iId = CNcdNodeIdentifier::NewL( aId );
iUri = aUri.AllocL();
iFilename = aPreviewFile.AllocL();
iMimeType = aMimeType.AllocL();
}
示例12: ConstructL
// ----------------------------------------------------------------------------
// CIpsPlgNewChildPartFromFileOperation::ConstructL
// ----------------------------------------------------------------------------
//
void CIpsPlgNewChildPartFromFileOperation::ConstructL(CIpsPlgMsgMapper *aMsgMapper,
const TDesC& aContentType,
const TDesC& aFilePath)
{
FUNC_LOG;
iMsgMapper = aMsgMapper;
iContentType = aContentType.AllocL();
iFilePath = aFilePath.AllocL();
// Start from attachment manager initialization
InitAttachmentManagerL();
}
示例13: ConstructL
void CMemSpyEngineSinkMetaData::ConstructL( const TDesC& aRoot, const TDesC& aContext, const TDesC& aFolder, const TDesC& aExtension, const TTime& aFolderTime )
{
iRoot = aRoot.AllocL();
iContext = aContext.AllocL();
iFolder = aFolder.AllocL();
iExtension = aExtension.AllocL();
const TDateTime dt = aFolderTime.DateTime();
HBufC* spec = HBufC::NewLC( KMaxFileName );
TPtr pName( spec->Des() );
pName.Format( KMemSpyDataStreamFolderNameFormatSpec, dt.Year(), dt.Month()+1, dt.Day()+1, dt.Hour(), dt.Minute(), dt.Second());
iFolderTimeStamp = pName.AllocL();
CleanupStack::PopAndDestroy( spec );
}
示例14: SetFileParamsL
/** Sets file parameters
@publishedPartner
@deprecated
@param aFileName A file name containing full path to be used to start up a component.
@param aArgs A string that will be used as an argument to the component when starting.
*/
EXPORT_C void CStartupProperties::SetFileParamsL(const TDesC& aFileName, const TDesC& aArgs)
{
HBufC* fname = aFileName.AllocL();
delete iFileName;
iFileName = fname;
TPtr writeableFilename = iFileName->Des();
writeableFilename.TrimAll();
HBufC* args = aArgs.AllocL();
delete iArgs;
iArgs = args;
TPtr writeableArgs = iArgs->Des();
writeableArgs.TrimAll();
}
示例15: ChangeText
void CCurThreeListBoxItem::ChangeText(const TDesC& aText,const TDesC& aSecondLine,const TDesC& aThirdLine)
{
ASSERT(iSlideText);
iSlideText->SetText(aText);
delete iSecondText;
iSecondText = NULL;
iSecondText = aSecondLine.AllocL();
delete iThirdText;
iThirdText = NULL;
iThirdText = aThirdLine.AllocL();
RequestDraw();
}