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


C++ TResourceReader::ReadTPtrC方法代码示例

本文整理汇总了C++中TResourceReader::ReadTPtrC方法的典型用法代码示例。如果您正苦于以下问题:C++ TResourceReader::ReadTPtrC方法的具体用法?C++ TResourceReader::ReadTPtrC怎么用?C++ TResourceReader::ReadTPtrC使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TResourceReader的用法示例。


在下文中一共展示了TResourceReader::ReadTPtrC方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetSystemDrivesL

// ---------------------------------------------------------------------------
// CAknMemorySelectionDialogMultiDrive::GetSystemDrivesL
// ---------------------------------------------------------------------------
//
void CAknMemorySelectionDialogMultiDrive::GetSystemDrivesL( TInt aUserDefinedId )
    {
    TInt locations = 0;
    TResourceReader reader;
    if( aUserDefinedId )
        {        
        iCoeEnv->CreateResourceReaderLC( reader, aUserDefinedId );
        reader.ReadTPtrC();   //Rede title   
        reader.ReadTPtrC();   // Read left softkey text.
        reader.ReadTPtrC();   // Read right softkey text.
        locations = reader.ReadInt16();
        if ( locations > 0 )
            {
            // Read user defined data into model
            iModel->ReadUserDefinedDataL( reader, locations );
            }
        CleanupStack::PopAndDestroy(); // reader
        }
    
    //Update root path and default folder arrays.
    iModel->UpdateDataArraysL();
    
    // Updates items in listbox.
    iModel->UpdateItemsL();
    }
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:29,代码来源:caknmemoryselectiondialogmultidrive.cpp

示例2: CreateStandardEntriesFromResourceFileL

/**
 * CreateStandardEntriesFromResourceFileL()
 * @param None:
 *
 * Will read messaging resource file and create entries.
 */	
void CMsvIndexContext::CreateStandardEntriesFromResourceFileL(TUint aDriveId)
	{
	// Read initial entries from resources
	TResourceReader reader;
	reader.SetBuffer(iBuf);	
	const TInt numberOfEntries = reader.ReadInt16();
	
	for (TInt index=0; index < numberOfEntries; ++index)
		{
		TMsvEntry newEntry;
				
		// Values from resource file
		newEntry.iId = MaskTMsvId(aDriveId, reader.ReadInt32());
		newEntry.iParentId = reader.ReadInt32();
		newEntry.iServiceId = reader.ReadInt32();
		newEntry.iType.iUid = reader.ReadInt32();
		newEntry.iMtm.iUid = reader.ReadInt32();
		newEntry.iData = reader.ReadInt32();
		newEntry.iDescription.Set(reader.ReadTPtrC());
		newEntry.iDetails.Set(reader.ReadTPtrC());
		newEntry.iDate.UniversalTime();
		newEntry.iSize=0;

		// Create the new entry.
		// This is required to create associated service directory.
		User::LeaveIfError(iServer.AddEntry(this, newEntry, KMsvServerId, EFalse));
		}
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:34,代码来源:indexcontext.cpp

示例3: ReadFromResourceL

// ---------------------------------------------------------------------------
// CAknMemorySelectionDialogMultiDrive::ReadFromResourceL
// ---------------------------------------------------------------------------
//
void CAknMemorySelectionDialogMultiDrive::ReadFromResourceL( TInt aResourceId )
    {
    TResourceReader reader;
    iCoeEnv->CreateResourceReaderLC( reader, aResourceId );
    // Read title.
    AknCFDUtility::AllocateIfNullL( iTitle, reader.ReadTPtrC() );
    // Read left softkey text.
    AknCFDUtility::AllocateIfNullL( iLeftSoftkey, reader.ReadTPtrC() );
    // Read right softkey text.
    AknCFDUtility::AllocateIfNullL( iRightSoftkey, reader.ReadTPtrC() );

    CleanupStack::PopAndDestroy(); // reader
    }
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:17,代码来源:caknmemoryselectiondialogmultidrive.cpp

示例4: ReadFromResource

void TAknNoteResData::ReadFromResource(TResourceReader& aResReader)
	{
    iResId = aResReader.ReadInt32();
    iTimeout = STATIC_CAST(CAknNoteDialog::TTimeout, aResReader.ReadInt32());
    iTone = STATIC_CAST(CAknNoteDialog::TTone, aResReader.ReadInt16());
    iText = aResReader.ReadTPtrC();
	}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:7,代码来源:aknnotewrappers.cpp

示例5: ShowConfirmationQueryL

void CDPOFPrintingDevice::ShowConfirmationQueryL() 
    {
    LOG("CDPOFPrintingDevice::ShowConfirmationQueryL begin");
  	
  	RFs fs;
	User::LeaveIfError( fs.Connect() );
	CleanupClosePushL( fs );
	TFileName resourceFileName;
	resourceFileName.Append ( KDC_RESOURCE_FILES_DIR );
	resourceFileName.Append ( KResourceFileName );
	BaflUtils::NearestLanguageFile( fs, resourceFileName );
	RResourceFile resFile;
	resFile.OpenL( fs, resourceFileName );
	CleanupClosePushL( resFile );
	HBufC8 *resBuffer = resFile.AllocReadLC( R_QTN_PRINT_DPOF_CONFIRMATION_DIALOG );
	TResourceReader reader;
	reader.SetBuffer( resBuffer );
	TPtrC ptrQuestion = reader.ReadTPtrC();
	iQuestion = ptrQuestion.AllocL();
	CleanupStack::PopAndDestroy( 3 ); // resBuffer, resFile, fs

	iPQ = CAknGlobalConfirmationQuery::NewL();
    
    iConfirmationQuery = CConfirmationQuery::NewL( *this );
    
    iConfirmationQuery->StartWaitingAnswer( );        
    
    iPQ->ShowConfirmationQueryL( iConfirmationQuery->iStatus, *iQuestion, R_AVKON_SOFTKEYS_YES_NO );

    LOG("CDPOFPrintingDevice::ShowConfirmationQueryL end");
    }
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:31,代码来源:cdpofprintingdevice.cpp

示例6: TestButtonL

/**
@SYMTestCaseID          SYSLIB-BAFL-CT-0433
@SYMTestCaseDesc        Tests for TResourceReader::ReadInt16(),TResourceReader::ReadUint16() functions
@SYMTestPriority        Medium
@SYMTestActions         Attempt to read a BUTTON resource
@SYMTestExpectedResults Tests must not fail
@SYMREQ                 REQ0000
*/
void TRsReadTester::TestButtonL()
	{
	test.Next(_L(" @SYMTestCaseID:SYSLIB-BAFL-CT-0433 Test reading BUTTON resource "));
    TResourceReader reader;
    CreateResourceReaderLC(reader,SYS_BUTTON_ONE);
    test(reader.ReadInt16()==3);
    test(reader.ReadUint16()==5);
    TPtrC ptr=reader.ReadTPtrC();
    test(ptr==_L("Text"));
    ptr.Set(reader.ReadTPtrC());
    test(ptr.Length()==0);
    HBufC* hBuf=reader.ReadHBufCL();
    test(*hBuf==_L("Bitmap placeholder"));
    delete(hBuf);
    CleanupStack::PopAndDestroy();
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:24,代码来源:T_RSREAD.CPP

示例7: ReadResourceStringL

EXPORT_C void CTestUtils::ReadResourceStringL(RResourceFile& aResFile, TInt aId, TDes& rString)
	{
	HBufC8* buf = aResFile.AllocReadLC(aId);
	TResourceReader reader;
	reader.SetBuffer(buf);
	rString.Copy(reader.ReadTPtrC());
	CleanupStack::PopAndDestroy(buf);
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:8,代码来源:MsvTestUtilsBase.cpp

示例8: CreateIndiciesL

void CLogServDatabaseMarshall::CreateIndiciesL()
	{
	// Get the array size
	TResourceReader reader;
	iResourceInterface.CreateResourceReaderLC(reader, R_LOG_INDEXES);

	const TInt indexes = reader.ReadInt16();

	// Read in the array
	for(TInt c1 = 0; c1 < indexes; c1++)
		{
		const TPtrC name(reader.ReadTPtrC());
		const TPtrC table(reader.ReadTPtrC());

		// Get the number of keys
		const TInt keys = reader.ReadInt16();

		CDbKey* key = CDbKey::NewLC();

		for(TInt c2 = 0; c2 < keys; c2++)
			{
			TPtrC col = reader.ReadTPtrC();
			TUint order = reader.ReadUint16();
			TInt len = reader.ReadInt16();

			// Add the key
			key->AddL(TDbKeyCol(col, len, (TDbKeyCol::TOrder)order));
			}

		// Make key unique if required
		if (reader.ReadInt8())
			key->MakeUnique();

		// Set comparison
		const TDbTextComparison comparison = static_cast<TDbTextComparison>(reader.ReadInt8());
		key->SetComparison(comparison);

		// Create the index
		User::LeaveIfError(iDatabase.CreateIndex(name, table, *key));

		CleanupStack::PopAndDestroy(key);
		}

	CleanupStack::PopAndDestroy(); // reader
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:45,代码来源:LogServDatabaseMarshall.cpp

示例9: ReadUserDefinedDataL

// ---------------------------------------------------------------------------
// CAknMemorySelectionModelMultiDrive::ReadUserDefinedDataL
// ---------------------------------------------------------------------------
//
void CAknMemorySelectionModelMultiDrive::ReadUserDefinedDataL(
    TResourceReader& aReader, TInt aLocations )
    {
    if ( aLocations <= 0)
        {
        return;
        }
    
    iDefDriveArray = new ( ELeave ) CDesCArrayFlat( aLocations );
    iDefDefaultFolderArray = new ( ELeave ) CDesCArrayFlat( aLocations );
    for ( TInt i = 0; i < aLocations; i++ )
        {
        // read the location, save path and default folder in array
        TPath temp;
        temp.Copy( aReader.ReadTPtrC() );
        iDefDriveArray->AppendL( temp );
        temp.Copy( aReader.ReadTPtrC() );
        iDefDefaultFolderArray->AppendL( temp );
        }
    }
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:24,代码来源:caknmemoryselectionmodelmultidrive.cpp

示例10: LoadLC

EXPORT_C HBufC* CResourceLoader::LoadLC( TInt aResourceId )
    {
    TResourceReader reader;
    HBufC8* readBuffer = CreateResourceReaderLC( reader, aResourceId );
    TPtrC textdata = reader.ReadTPtrC();
    
    HBufC16* textBuffer = HBufC16::NewL( textdata.Length() );
    *textBuffer = textdata;
    CleanupStack::PopAndDestroy( readBuffer );
    CleanupStack::PushL( textBuffer );
    return textBuffer;
    }
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:12,代码来源:basepluginresourceloader.cpp

示例11: ConstructFromResourceL

EXPORT_C void CAknInputFrame::ConstructFromResourceL(TResourceReader& aReader)
    {
    TPtrC filename = aReader.ReadTPtrC();
    TInt32 pid = aReader.ReadInt16();
    TInt32 mid = aReader.ReadInt16();
    TInt32 flags = aReader.ReadInt16();
    const TInt ctrlType = aReader.ReadInt16();
    TPtrC infoText = aReader.ReadTPtrC(); // discarded, since infotext is deprecated

    CCoeControl* field = EikControlFactory::CreateByTypeL(ctrlType).iControl;
    CleanupStack::PushL(field);
    field -> ConstructFromResourceL(aReader);
    ConstructL(field,ETrue,filename,pid,mid,flags);
    CleanupStack::Pop(); // field
    if ((ctrlType==EEikCtGlobalTextEditor) || (ctrlType==EEikCtEdwin))
        {
        TMargins8 margins;
        margins.SetAllValuesTo(0);
        STATIC_CAST(CEikBorderedControl*,iField)->SetBorder(TGulBorder::ENone);                
        STATIC_CAST(CEikEdwin*,field)->SetBorderViewMargins(margins);
        }
    }
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:22,代码来源:akninfrm.cpp

示例12: ConstructFromResourceL

// ---------------------------------------------------------------------------
// CAknStylusPopUpMenu::ConstructFromResourceL
// ---------------------------------------------------------------------------
//
EXPORT_C void CAknStylusPopUpMenu::ConstructFromResourceL( TResourceReader&
                                                           aReader )
    {
    TInt count = aReader.ReadInt16();
    TInt commandId;
    for ( TInt i = 0; i < count; i++ )
        {
        TPtrC text = aReader.ReadTPtrC();
        commandId = aReader.ReadInt32();
        iContent->AddMenuItemL( text, commandId );
        aReader.ReadInt32(); // extension link
        }
    }
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:17,代码来源:aknstyluspopupmenu.cpp

示例13: TestMenuBarL

/**
@SYMTestCaseID          SYSLIB-BAFL-CT-0436
@SYMTestCaseDesc        TResourceReader class functionality test
						Test for TResourceReader::ReadInt32 (),TResourceReader::ReadTPtrC() functions
@SYMTestPriority        High
@SYMTestActions         Attempt for reading MENU_BAR resource
@SYMTestExpectedResults Tests must not fail
@SYMREQ                 REQ0000
*/
void TRsReadTester::TestMenuBarL()
	{
	test.Next(_L(" @SYMTestCaseID:SYSLIB-BAFL-CT-0436 Test reading MENU_BAR resource "));
    TResourceReader reader;
    CreateResourceReaderLC(reader,SYS_MENUBAR_ONE);
    test(reader.ReadInt16()==8); // how many items following
    TPtrC ref=_L("abcdefgh");
    for (TInt ii=1; ii<=8; ii++)
        {
        test(reader.ReadInt32()==ii);
        test(reader.ReadTPtrC()==ref.Left(ii));
        }
    CleanupStack::PopAndDestroy(1);
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:23,代码来源:T_RSREAD.CPP

示例14: SetDefaultBaseFileNameL

/**
Sets default content base filename
*/	
void CUnknownPushMsgEntry::SetDefaultBaseFileNameL()
	{
	// generate default filename from the wappushunknown resource file. 
	RResourceFile resourceFile;
	OpenResourceFileL(resourceFile);
	CleanupClosePushL(resourceFile);

	HBufC8* buf = resourceFile.AllocReadLC(CONTENT);
	TResourceReader reader;
	reader.SetBuffer(buf);

	iDefaultBaseFilename.Copy(reader.ReadTPtrC());		
	CleanupStack::PopAndDestroy(2,&resourceFile); // buf, resourceFile
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:17,代码来源:Cunknownpushmsgentry.cpp

示例15: CheckIfFooterMessageExistsL

/**
CheckIfFooterMessageExistsL()
Checks the email for the presence of the footer string

@param aRecvBodyText
Reference to a descriptor holding the body text

@param aFooterSize
The expected number of KB remaining on the server which has been inserted into the footer string

@return
ETrue if footer string found otherwise EFalse 
*/
TBool CT_MsgComparePopEmailMsgs::CheckIfFooterMessageExistsL(TPtrC& aRecvBodyText , TInt& aFooterSize)
	{
	RResourceFile resFile;
	CT_MsgUtils ::OpenResourceFileL(resFile, iFs, KImEngineResourceFile);	// NB leaves if file not found
	TCleanupItem close(CT_MsgUtils ::CloseResourceFile, &resFile);
	CleanupStack::PushL(close);
	
	HBufC8* buf = NULL;
	buf = resFile.AllocReadLC(PARTIAL_DOWNLOAD_FOOTER_MESSAGE);
	TResourceReader reader;
	reader.SetBuffer(buf);

	HBufC* resourceBuf = (reader.ReadTPtrC()).AllocL();
	CleanupStack::PushL(resourceBuf);

	TInt len = resourceBuf->Find(_L("%d"));
	const TInt KBufLen = 256;
	TBuf<KBufLen> findBuf;

	if(len == KErrNotFound)
		{
		len = resourceBuf->Length();
		}

	if(len > KBufLen)
		{
		len = KBufLen;
		}
	
	findBuf.Copy(resourceBuf->Ptr(), len);
	len = aRecvBodyText.Find(findBuf);

	if(len>=0)
		{
		TPtrC rest=aRecvBodyText.Right(aRecvBodyText.Length()-len-findBuf.Length());
		TLex lex(rest.Left(rest.Locate(TChar(' '))));
		lex.Val(aFooterSize);
		}
	else
		{
		aFooterSize=0;
		}

	CT_MsgUtils ::CloseResourceFile(&resFile);
	CleanupStack::PopAndDestroy(3); // buf, resourceBuf, close
	return (len != KErrNotFound);
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:60,代码来源:T_ComparePopEmailMsgs.cpp


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