예제 #1
0
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
0
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
0
void CVideoDecoderInfo::ConstructL(const TDesC& aManufacturer,
								   const TDesC& aIdentifier,
								   const TArray<CCompressedVideoFormat*>& aSupportedFormats,
								   const TArray<TPictureRateAndSize>& aMaxPictureRates,
								   const TDesC8& aCodingStandardSpecificInfo,
								   const TDesC8& aImplementationSpecificInfo)
	{
	iManufacturer = aManufacturer.AllocL();
	iIdentifier = aIdentifier.AllocL();
	iCodingStandardSpecificInfo = aCodingStandardSpecificInfo.AllocL();
	iImplementationSpecificInfo = aImplementationSpecificInfo.AllocL();

	TInt i=0;
	TInt count = aSupportedFormats.Count();
	for (i=0; i<count; i++)
		{
		CCompressedVideoFormat* f = CCompressedVideoFormat::NewL(*(aSupportedFormats[i]));
		CleanupStack::PushL(f);
		User::LeaveIfError(iSupportedFormats.Append(f));
		CleanupStack::Pop(f);
		}

	count = aMaxPictureRates.Count();
	for (i=0; i<count; i++)
		{
		User::LeaveIfError(iMaxPictureRates.Append(aMaxPictureRates[i]));
		}
	}
void CNcdSubscriptionsSourceIdentifier::ConstructL(
    const TDesC& aUri,
    const TDesC& aNamespace )
    {
    iUri = aUri.AllocL();
    iNamespace = aNamespace.AllocL();
    }
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
//
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;
    }
// ---------------------------------------------------------------------------
//
// ---------------------------------------------------------------------------
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;
	}
// ---------------------------------------------------------------------------
// 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 );
        }
    }
예제 #8
0
// 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();
    }
void CMemSpyEngineHelperSysMemTrackerCycleChangeOpenFile::ConstructL( const TDesC& aThreadName, const TDesC& aFileName )
    {
    BaseConstructL();

    // Save the thread name
    iFileName = aFileName.AllocL();
    iThreadName = aThreadName.AllocL();
    }
예제 #10
0
void CIAPObject::ConstructL(const TDesC& aImeiNbr,
                            const TDesC& aIAPNbr,
                            const TDesC& aIAPName)
{
    iImeiNbr = aImeiNbr.AllocL();
    iIAPNbr  = aIAPNbr.AllocL();
    iIAPName = aIAPName.AllocL();
}
예제 #11
0
// ---------------------------------------------------------------------------
// ConstructL
// ---------------------------------------------------------------------------
//    
void CNcdKeyValuePair::ConstructL( const TDesC& aKey, const TDesC& aValue )
    {
    if ( !aKey.Length() ) 
        {
        User::Leave( KErrArgument );
        }
        
    iKey = aKey.AllocL();
    iValue = aValue.AllocL();
    }
/**
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();
	}
예제 #13
0
// ---------------------------------------------------------------------------
// 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();
    }
// ----------------------------------------------------------------------------
// 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();
    }
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 );
}
예제 #16
0
/** 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();
	}
예제 #17
0
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();
}
// ---------------------------------------------------------------------------
// Symbian 2nd phase constructor.
// ---------------------------------------------------------------------------
//
void CSensorSourceCommand::ConstructL( const TSecureId& aSid,
    TInt aScriptId,
    const TDesC& aFeatureId,
    const TDesC& aCommandId,
    TUint32 aChannelId )
    {
    FUNC_LOG;
    
    iSid = aSid;
    iScriptId = aScriptId;
    iFeatureId = aFeatureId.AllocL();
    iCommandId = aCommandId.AllocL();
    iChannelId = aChannelId;
    }
예제 #19
0
void CContainerParser::StringParseCompleteL(const TDesC& aString)
	{
	switch(iWaitingForTag)
		{
	case ENameTag:
		iName = aString.AllocL();
		break;
	case EUniqueIdTag:
		iUniqueId = aString.AllocL();
		break;
	default:
		User::Panic(KRtaPanicString(), ERtaPanicParserInvalidState);
		break;
		};
	}
예제 #20
0
/*
-------------------------------------------------------------------------------

    Class: CTestCasesList

    Method: AppendTestCaseL

    Description: Appends test case.

    Parameters: const TDesC& aTestCaseTitle  in: Test case title

    Return Values: 

    Errors/Exceptions: Leaves if memory allocation fails

    Status: Approved

-------------------------------------------------------------------------------
*/
void CTestCasesList::AppendTestCaseL( const TDesC& aTestCaseTitle )
    {
    HBufC* testCaseTitle = aTestCaseTitle.AllocL();
    CleanupStack::PushL( testCaseTitle );
    iTestCases.AppendL( testCaseTitle );
    CleanupStack::Pop( testCaseTitle );
    }
예제 #21
0
/** 
Sets the URL of the service to be loaded.

@param aUrl 
URL of the service to be loaded. 
*/
EXPORT_C void CSLPushMsgEntry::SetUrlL(const TDesC& aUrl)
	{
	HBufC* tempBuf = aUrl.AllocL();

	delete iUrl;
	iUrl = tempBuf;
	}
예제 #22
0
EXPORT_C void CSTPreferences::SetPreferencesFileL(const TDesC& aFileName)
{
	delete iPreferencesFileName;
	iPreferencesFileName = 0;
	
	iPreferencesFileName = aFileName.AllocL();
}
EXPORT_C void CMMFPluginSelectionParameters::SetPreferredSupplierL(const TDesC& aPreferredSupplier, TPreferredSupplierMatchType aMatchType)
	{
	delete iPreferredSupplier;
	iPreferredSupplier = NULL;
	iPreferredSupplier = aPreferredSupplier.AllocL();
	iPreferredSupplierMatchType = aMatchType;
	}
예제 #24
0
void CFileSystemImage::ConstructL( const TDesC& aFileName )
	{
	TRACE_FUNC
	User::LeaveIfError( iFs.Connect() );
	iFileName = aFileName.AllocL();
	TRACE_INFO(( _L( "Image file is '%S'" ), iFileName ))
	}
예제 #25
0
// --------------------------------------------------------------------------
// CUPnPXMLParserLite::ParseResultDataL
// See upnpxmlparser.h
// --------------------------------------------------------------------------
EXPORT_C void CUPnPXMLParserLite::ParseResultDataL(
    RPointerArray<CUpnpObjectLite>& aResultArray, const TDesC8& aData,
    const TDesC& aFormatString )
    {
    __LOG( "CUPnPXMLParserLite::ParseResultDataL, begin" );
    
    delete iFormatString; iFormatString = NULL;
    if( aFormatString != KNullDesC )
        {
        iFormatString = aFormatString.AllocL();
        }
    
    if ( !aData.Length() )
        {
        User::Leave( KErrArgument );
        }
        
    iResultRoot = &aResultArray;

    // Create parser 
    CMatchData* matchData = CMatchData::NewLC();
    matchData->SetMimeTypeL( KXmlMimeType ); 
    matchData->SetVariantL( KLIB2XML ); 
    CParser* parser = CParser::NewLC( *matchData, *this ); 
    parser->EnableFeature( Xml::EReportNamespaceMapping );
    
    Xml::ParseL( *parser, aData );    
    
    CleanupStack::PopAndDestroy( parser );
    CleanupStack::PopAndDestroy( matchData );
    
    iResultRoot = NULL;           
    __LOG( "CUPnPXMLParserLite::ParseResultDataL, end" );
    }
// -----------------------------------------------------------------------------
void CPresenceCacheBuddyInfo::SetIdentityL( 
    const TDesC& aBuddyId )
    {
    delete iBuddyId;
    iBuddyId = NULL;
    iBuddyId = aBuddyId.AllocL( );        
    }
예제 #27
0
void CEmailNotificationParser::ParseL(TRequestStatus& aStatus, const TDesC& aSms)
    {
    TMsvEntry entry = iEntry.Entry();   //  Get the generic stuff
    iEntryId = entry.Id();              //  store the TMsvId

    __ASSERT_DEBUG((entry.MtmData3() == 0 || entry.MtmData3() == 1),
                            User::Panic(_L("ENP-DLL"),KErrCorrupt));
    //  Already parsed....
    if(entry.MtmData3() == 1)
        {
        iReport = &aStatus;
        User::RequestComplete(iReport, KErrNone);
        }
    //  not parsed
    else if(entry.MtmData3() == 0)
        {
        if (iSmsBuf != NULL)
            {
            delete iSmsBuf;
            iSmsBuf = NULL;
            }
        iSmsBuf = aSms.AllocL();            // Allocate new HBufC object
        ChangeStateL(EUnfoldMessage);       //Set to initial request
        aStatus = KRequestPending;
        iReport = &aStatus;
        }
    else
        {
        User::Leave(KErrNotSupported);
        }
    }
예제 #28
0
void CMessenger::ConstructL(const TDesC& aString) // second-phase constructor

{

    iString=aString.AllocL(); // copy given string into own descriptor

}
예제 #29
0
//SYMBIAN_REMOVE_TRIVIAL_ENCRYPTION version of the method.
EXPORT_C void CDbFileStoreDatabase::CreateL(const TDesC& aName, TDbFormat::TCreate aMode,
                                            const TUidType& aType)
	{
	__ASSERT(!iName);	// check construction phase
//
	iName=aName.AllocL();
	CFileStore* store;
	switch (aMode)
		{
	default:
		__LEAVE(KErrNotSupported);
	case TDbFormat::ECreate:   
		store=CPermanentFileStore::CreateL(iFs,aName,EFileRead|EFileWrite);
		break;
	case TDbFormat::EReplace:
		store=CPermanentFileStore::ReplaceL(iFs,aName,EFileRead|EFileWrite);
		break;
		};
	iStore=store;
	iDelete=ETrue;		// cleanup fully in case of failure
	store->SetTypeL(aType);
	store->SetRootL(CreateRootL(CDbStoreDatabase::ConstructL()));
	store->CommitL();
	iDelete=EFalse;				// file is now good
	}
예제 #30
0
void CLinkedTypefaceElementSpec::ConstructL(const TDesC& aName)
	{
	TInt length = aName.Length();
	if ((length == 0) || (length > KMaxTypefaceNameLength))
		User::Leave(KErrArgument);
	iElementName = aName.AllocL();
	}