本文整理汇总了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();
}
示例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));
}
}
示例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
}
示例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();
}
示例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");
}
示例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();
}
示例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);
}
示例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
}
示例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 );
}
}
示例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;
}
示例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);
}
}
示例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
}
}
示例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);
}
示例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
}
示例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);
}