本文整理汇总了C++中TResourceReader::ReadTPtrC16方法的典型用法代码示例。如果您正苦于以下问题:C++ TResourceReader::ReadTPtrC16方法的具体用法?C++ TResourceReader::ReadTPtrC16怎么用?C++ TResourceReader::ReadTPtrC16使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TResourceReader
的用法示例。
在下文中一共展示了TResourceReader::ReadTPtrC16方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: val
/**
@SYMTestCaseID T-RApaLsSessionTestStep-TestServiceDiscovery8L
@SYMPREQ 538
@SYMTestCaseDesc Test for the functionality of GetAppServiceOpaqueDataLC, particularly in the case
where an app offers two services with the same uid but different opaque data
@SYMTestPriority
@SYMTestStatus Implemented
@SYMTestActions Call GetAppServiceOpaqueDataLC with two parameters: an app uid and a service uid
on z: drive.\n
API Calls:\n
RApaLsSession::GetAppServiceOpaqueDataLC(TUid aAppUid, TUid aServiceUid) const
@SYMTestExpectedResults Returns an array of TApaAppServiceInfo objects. Each TApaAppServiceInfo object
contains the same service uid but different opaque data. The returned data should be the same as that
defined in the registration files.
*/
void CT_ServicesTestStep::TestServiceDiscovery8L()
{
INFO_PRINTF1(_L("TestServiceDiscovery8 about to start..."));
const TUid KUidServerApp = {0x10004c56};
const TUid KUidService = {0x05060708};
CApaAppServiceInfoArray* array = iApaLsSession.GetAppServiceOpaqueDataLC(KUidServerApp, KUidService);
TArray<TApaAppServiceInfo> implArray(array->Array());
TInt count = implArray.Count();
_LIT(KFirstService,"Non-localised resource A");
_LIT(KSecondService,"Non-localised resource B");
TPtrC8 opaqueData;
TResourceReader reader;
TPtrC16 theText;
if(count>0)
{
TEST(count==2);
TEST(implArray[0].Uid()==KUidService);
opaqueData.Set(implArray[0].OpaqueData());
reader.SetBuffer(&opaqueData); // opaqueData is an LTEXT resource
theText.Set(reader.ReadTPtrC16());
TInt val(0);
User::LeaveIfError(val=theText.Compare(KSecondService));
TEST(val==KErrNone);
TEST(implArray[1].Uid()==KUidService);
opaqueData.Set(implArray[1].OpaqueData());
reader.SetBuffer(&opaqueData); // opaqueData is an LTEXT resource
theText.Set(reader.ReadTPtrC16());
User::LeaveIfError(val=theText.Compare(KFirstService));
TEST(val==KErrNone);
}
CleanupStack::PopAndDestroy(array);
array = NULL;
}
示例2: ConstructFromResourceL
void CSliderControl::ConstructFromResourceL(TResourceReader& reader)
{
iVal=0;
CreateWindowL();
InitComponentArrayL();
iLabel = new (ELeave) CEikLabel;
iLabel->SetContainerWindowL(*this);
TRgb lbc;
MAknsSkinInstance* skin=AknsUtils::SkinInstance();
AknsUtils::GetCachedColor(skin,lbc,KAknsIIDQsnTextColors,EAknsCIQsnTextColorsCG6 );
iLabel->OverrideColorL(EColorLabelText,lbc);
iLabel->SetAlignment(EHCenterVCenter);
iLabel->SetBrushStyle(CGraphicsContext::ENullBrush);
iLabel->MakeVisible(ETrue);
iLabel->SetTextL(reader.ReadTPtrC16());
Components().AppendLC(iLabel);
CleanupStack::Pop(iLabel);
_LIT(KDesCEmpty,"");
iSlider = new (ELeave) CSliderForDialog(KDesCEmpty,0,255);
iSlider->ConstructL(this);
iSlider->SetContainerWindowL(*this);
iSlider->MakeVisible(ETrue);
Components().AppendLC(iSlider);
CleanupStack::Pop(iSlider);
//SetExtentToWholeScreen();
iBgContext = CAknsBasicBackgroundControlContext::NewL( KAknsIIDQsnBgAreaMain,TRect(TPoint(0,0),CEikonEnv::Static()->ScreenDevice()->SizeInPixels()),ETrue);
ActivateL();
_LOGDATA2(_L("Window pos: %d,%d"),Window().Position().iX,Window().Position().iY);
_LOGDATA2(_L("Window size: %d,%d"),Window().Size().iWidth,Window().Size().iHeight);
}
示例3:
/**
@SYMTestCaseID SYSLIB-BAFL-CT-0437
@SYMTestCaseDesc Reading ALIGNMENT_HORROR resources test
Test for TResourceReader::ReadTPtrC8(),TResourceReader::ReadTPtrC16() function
@SYMTestPriority High
@SYMTestActions Tests for reading descriptors and checks for alignment
@SYMTestExpectedResults Tests must not fail
@SYMREQ REQ0000
*/
void TRsReadTester::TestAlignment1L()
{
test.Next(_L(" @SYMTestCaseID:SYSLIB-BAFL-CT-0437 Test reading ALIGNMENT_HORROR resources "));
TPtrC8 ref8 =_L8("xyz");
TPtrC16 ref16=_L16("xyz");
TResourceReader reader;
for (TInt rr=0; horrors[rr]!=0; rr++)
{
CreateResourceReaderLC(reader,horrors[rr]);
test(reader.ReadTPtrC8() ==ref8.Left(rr));
test(reader.ReadTPtrC16()==ref16.Left(rr));
CleanupStack::PopAndDestroy(1);
}
}
示例4: CreateResourceReaderLC
/**
@SYMTestCaseID SYSLIB-BAFL-CT-0438
@SYMTestCaseDesc Reading ALIGNMENT_HORROR_ARRAY resource test
@SYMTestPriority High
@SYMTestActions Tests for reading descriptors and checks for alignment
@SYMTestExpectedResults Tests must not fail
@SYMREQ REQ0000
*/
void TRsReadTester::TestAlignment2L()
{
test.Next(_L(" @SYMTestCaseID:SYSLIB-BAFL-CT-0438 Test reading ALIGNMENT_HORROR_ARRAY resource "));
TResourceReader reader;
CreateResourceReaderLC(reader,SYS_ALIGNMENT_HORROR_ARRAY);
test(reader.ReadInt16()==7); // how many items following
TPtrC8 ref8 =_L8("abcdef");
TPtrC16 ref16=_L16("abcdef");
for (TInt ii=0; ii<=6; ii++)
{
test(reader.ReadTPtrC8() ==ref8.Left(ii));
test(reader.ReadTPtrC16()==ref16.Mid(ii));
}
CleanupStack::PopAndDestroy(1);
}
示例5: DoLaunchHelpApplicationL
void HlpLauncher::DoLaunchHelpApplicationL(RWsSession& aWsSession, const TDesC8& aCmdLine)
{
TApaTaskList taskList(aWsSession);
TApaTask task = taskList.FindApp(KHlpAppUid);
if (task.Exists())
{
task.SendMessage (KHlpAppWsMsg, aCmdLine);
task.BringToForeground();
}
else
{
CApaCommandLine* cmdLine=CApaCommandLine::NewLC();
// INC057477 fix
// Get and open the resource file
RFs f;
CleanupClosePushL(f);
User::LeaveIfError(f.Connect());
RResourceFile r;
r.OpenL(f, KHelpLauncherResource);
CleanupClosePushL(r);
// Read the path of the help application from the resource file
r.ConfirmSignatureL();
TResourceReader resReader;
resReader.SetBuffer(r.AllocReadLC(R_HELP_PATH));
TPtrC16 helpPath = resReader.ReadTPtrC16();
cmdLine->SetExecutableNameL(helpPath);
CleanupStack::PopAndDestroy(); // AllocReadLC
CleanupStack::PopAndDestroy(); // close r
CleanupStack::PopAndDestroy(); // close f
cmdLine->SetCommandL(EApaCommandOpen);
cmdLine->SetTailEndL(aCmdLine);
//EikDll::StartAppL(*cmdLine);
RApaLsSession lsSession;
User::LeaveIfError(lsSession.Connect());
CleanupClosePushL(lsSession);
User::LeaveIfError(lsSession.StartApp(*cmdLine));
CleanupStack::PopAndDestroy(&lsSession);
CleanupStack::PopAndDestroy(); //cmdLine
}
}