本文整理汇总了C++中TPtrC::CompareF方法的典型用法代码示例。如果您正苦于以下问题:C++ TPtrC::CompareF方法的具体用法?C++ TPtrC::CompareF怎么用?C++ TPtrC::CompareF使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPtrC
的用法示例。
在下文中一共展示了TPtrC::CompareF方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ConvertClassPropertyL
// -----------------------------------------------------------------------------
// CPIMEventPropertyConverter::ConvertClassPropertyL
// Converts CLASS property to a PIM Event item.
// -----------------------------------------------------------------------------
//
void CPIMEventPropertyConverter::ConvertClassPropertyL(
const CPIMParserProperty& aProperty, CPIMEventItem& aItem)
{
JELOG2(EPim);
CParserPropertyValueHBufC* propertyValue =
static_cast<CParserPropertyValueHBufC*>(aProperty.Value());
const TPtrC classStringPtr = propertyValue->Value();
TInt classInt = KErrCorrupt;
if (classStringPtr.CompareF(KPIMClassStringPublic) == 0)
{
classInt = EPIMEventClassPublic;
}
else if (classStringPtr.CompareF(KPIMClassStringPrivate) == 0)
{
classInt = EPIMEventClassPrivate;
}
else if (classStringPtr.CompareF(KPIMClassStringConfidential) == 0)
{
classInt = EPIMEventClassConfidential;
}
// else the class value in the originating vCalendar is flawed - ignore
if (classInt != KErrCorrupt)
{
aItem.addInt(EPIMEventClass, KPIMAttrNone, classInt);
}
}
示例2: MainL
/**
Calls a function in SysUtil.dll which sets up one or more Publish and Subscribe values.
The function called is determined by the flags passed to sysutilsetup.exe when it is run.
The valid flags can be found in sysutilsetup.h.
*/
TInt MainL()
{
TBuf<16> flags;
User::CommandLine( flags );
TLex lex( flags );
for ( TPtrC token = lex.NextToken(); token.Length() != 0; token.Set( lex.NextToken() ) )
{
if ( token.CompareF(KSetVersionPropertiesFlag) == 0 )
{
__SYSUTIL_TRACE("Calling SetVersionPropertiesL().");
SetVersionPropertiesL();
__SYSUTIL_TRACE("Called SetVersionPropertiesL().");
}
else if ( token.CompareF(KSetDeviceTypeInfoPropertyFlag) == 0 )
{
__SYSUTIL_TRACE("Calling SetDeviceTypeInfoPropertyL().");
SetDeviceTypeInfoPropertyL();
__SYSUTIL_TRACE("Called SetDeviceTypeInfoPropertyL().");
}
else if ( token.CompareF(KDeletePropertiesFlag) == 0 )
{
DeletePSPropertiesL();
break;
}
else
{
return KErrArgument;
}
}
return KErrNone;
}
示例3: ParseCmdArgs
TInt CCmdConnect::ParseCmdArgs( const TDesC& aCommand, TPtrC& aFramework, TPtrC& aConName )
{
aFramework.Set(NULL, 0);
aConName.Set(NULL, 0);
TInt error = KErrNone;
// get the command into a local string
TPtrC param;
TRAP(error, param.Set(ParamsL(aCommand)));
if (error != KErrNone)
return Error(error, TFR_KFmtErrBadCmd, &Keyphrase());
// check its' valid
TLex parse(param);
if (!parse.Eos() && !parse.Peek().IsSpace())
return Error(error, TFR_KFmtErrBadCmd, &Keyphrase());
// remove any spaces and see if its got params
parse.SkipSpace();
if ( parse.Eos() ) // no params
return error;
// Get framework name, must not exceed 16 characters.
// should be http or wsp (currently)
TRAP(error, aFramework.Set(TfrLex::GetL(parse)));
if ( error != KErrNone)
return Error(KErrArgument, TFR_KFmtErrBadCmd, &aFramework);
// check is valid length
aFramework.Set(TfrLex::Peel(aFramework));
if ( aFramework.Length() > 16 )
return Error(KErrArgument, THA_KErrParameterLong, &aFramework);
// check aFramework type valid (HTTP or WSP)
// Param shall be HTTP (True) or WSP (False)
aFramework.Set( TfrLex::TrimAndPeel(aFramework) );
TBool value = (aFramework.CompareF(THA_KTxtFrameworkHTTP) == 0);
if ( !value && (aFramework.CompareF(THA_KTxtFrameworkWSP) != 0))
return Error(KErrArgument, THA_KErrFrameworkErr, &aFramework);
// Get connection/session name value.
TRAP(error,aConName.Set(TfrLex::GetL(parse)));
if ( error != KErrNone)
return Error(KErrArgument, TFR_KFmtErrBadCmd, &aConName);
// There shall not be anything more.
TPtrC remainder = TfrLex::Trim(parse.Remainder());
if ( remainder.Length() > 0 )
return Error(KErrArgument, TFR_KFmtErrBadCmd, &remainder);
if (aConName.Length() <= 0)
return Error(KErrArgument, THA_KErrInvalidConnect, &Keyphrase());
aConName.Set(TfrLex::Peel(aConName));
return (KErrNone);
}
示例4: LoadPluginL
/*
* Load the plugin based on incoming message (XML or WBXML plugin)
*/
void CMessageComposer::LoadPluginL ()
{
TPtrC contentType;
iPushMessage.GetContentType ( contentType );
iParser = CParser::NewL ( ( contentType.CompareF ( KDRMTextContentType ) ) ?
KWbxmlParserDataType() : KXmlParserDataType(), *this );
}
示例5: FindFolderL
TMsvId CTestImapSyncManager::FindFolderL(const TDesC& aName, TBool aCaseSensitive)
{
TMsvId remoteId = KErrNotFound;
iEntry->SetEntry(iServiceId);
CMsvEntrySelection* msvEntrySelection = new (ELeave) CMsvEntrySelection;
iEntry->GetChildren(*msvEntrySelection);
TPtrC iEntryName = aName;
TInt count = msvEntrySelection->Count();
for (TInt i=0; i<count; i++)
{
iEntry->SetEntry((*msvEntrySelection)[i]);
if (aCaseSensitive)
{
if (iEntryName.Compare(iEntry->Entry().iDetails ) == 0)
{
remoteId = (*msvEntrySelection)[i];
break;
}
}
else if ((iEntryName.CompareF(iEntry->Entry().iDetails) == 0))
{
remoteId = (*msvEntrySelection)[i];
break;
}
}
delete msvEntrySelection;
return remoteId;
}
示例6: DoRecognizeL
void CTorrentRecognizer::DoRecognizeL(const TDesC &aName, const TDesC8 &/*aBuffer*/)
{
iConfidence = ECertain;
TParse parse;
parse.Set(aName, NULL, NULL);
TPtrC ext = parse.Ext();
if (ext.CompareF(KTorrentExtension) == 0)
{
iConfidence = ECertain;
iDataType = TDataType(KTorrentType);
}
else
{
iConfidence = ENotRecognized;
iDataType = TDataType();
}
/*TFileName name=aName;
name.LowerCase();
if (name.Right(KTorrentExtension().Length()) == KTorrentExtension)
{
iDataType = TDataType(KTorrentType);
return;
}*/
}
示例7: StringToTUpsDecision
TUpsDecision CUpsClientStep::StringToTUpsDecision(const TPtrC& aString)
{
if(aString.CompareF(_L("Yes"))==0)
{
return TUpsDecision(EUpsDecYes);
}
else if(aString.CompareF(_L("No"))==0)
{
return TUpsDecision(EUpsDecNo);
}
else if(aString.CompareF(_L("SessionYes"))==0)
{
return TUpsDecision(EUpsDecSessionYes);
}
else
{
return TUpsDecision(EUpsDecSessionNo);
}
} // End of function.
示例8: ImplTestStepL
void CScrGetGlobalIdListStep::ImplTestStepL()
{
CGlobalComponentId *globalId = GetGlobalComponentIdLC();
TBool noVerification = EFalse;
GetBoolFromConfig(ConfigSection(), _L("NoVerification"), noVerification);
RPointerArray<CVersionedComponentId> expectedVerCompIdList;
CleanupResetAndDestroyPushL(expectedVerCompIdList);
if(!noVerification)
{
GetExpectedVersionedComponentIdListL(expectedVerCompIdList);
}
RPointerArray<CVersionedComponentId> retrievedVerCompIdList;
CleanupResetAndDestroyPushL(retrievedVerCompIdList);
TPtrC globalIdType;
if (!GetStringFromConfig(ConfigSection(), KGlobalIdType, globalIdType))
PrintErrorL(_L("Global Id Type was not found!"), KErrNotFound);
// Start timer just before invocation of SCR API
StartTimer();
if(!globalIdType.CompareF(_L("Dependant")))
iScrSession.GetSupplierComponentsL(*globalId, retrievedVerCompIdList);
else if (!globalIdType.CompareF(_L("Supplier")))
iScrSession.GetDependantComponentsL(*globalId, retrievedVerCompIdList);
else {
ERR_PRINTF1(_L("The global Id type couldn't be identified."));
SetTestStepResult(EFail);
}
if (!noVerification && !CompareVersionedComponentIdsL(retrievedVerCompIdList, expectedVerCompIdList))
{
ERR_PRINTF1(_L("The retrieved global Ids are different from the expected ones."));
SetTestStepResult(EFail);
}
CleanupStack::PopAndDestroy(3, globalId); // depGlobalId, expectedGlobalIdList, retrievedGlobalIdList
}
示例9: ButtonToInt
TInt CUpsClientStep::ButtonToInt(const TPtrC& aButton)
{
if(aButton.CompareF(_L("Yes"))==0)
{
return KYes;
}
else if(aButton.CompareF(_L("No"))==0)
{
return KNo;
}
else if(aButton.CompareF(_L("Always"))==0)
{
return KAlways;
}
else if(aButton.CompareF(_L("SessionYes"))==0)
{
return KSessionYes;
}
else if(aButton.CompareF(_L("SessionNo"))==0)
{
return KSessionNo;
}
else if(aButton.CompareF(_L("Never"))==0)
{
return KNever;
}
else return KNone;
} // End of function.
示例10: VsReadFileSection
/**
@internalComponent
*/
TInt CTestVirusHook::VsReadFileSection(TFsPluginRequest& aRequest)
{
// The t_virus test uses a filename clean.txt, a read length of 8 and a read position of 0.
TFileName fileName;
TInt len;
TInt pos;
// test getting name on read file section intercept
TInt err = GetName(&aRequest, fileName);
if(err != KErrNone)
{
return(err);
}
TParse parse;
parse.Set(fileName,NULL,NULL);
TPtrC name = parse.Name();
if(name.CompareF(_L("clean"))!=0)
{
return(KErrGeneral);
}
TPtrC ext = parse.Ext();
if(ext.CompareF(_L(".txt"))!=0)
{
return(KErrGeneral);
}
// test getting read length and required file position on read file section intercept
err = GetFileAccessInfo(&aRequest, len, pos);
if(err != KErrNone)
{
return(err);
}
if ((len != 8) || (pos != 0))
{
return(KErrGeneral);
}
return KErrNone;
}
示例11: CheckPermittedFileName
TInt CRtaServer::CheckPermittedFileName(const TDesC& aFileName)
{
_LIT(KContentExtension,".content");
TInt err = KErrNone;
if(aFileName.Length() >= KRightsDatabaseFileName().Length())
{
TPtrC rightsDb = aFileName.Right(KRightsDatabaseFileName().Length());
if(rightsDb.CompareF(KRightsDatabaseFileName()) == 0)
{
err = KErrPermissionDenied;
}
}
if(err == KErrNone && aFileName.Length() >= KContentExtension().Length())
{
TPtrC ext = aFileName.Right(KContentExtension().Length());
if(ext.CompareF(KContentExtension()) != 0)
{
err = KErrNotSupported;
}
}
return err;
}
示例12: ProcessL
TInt CCmdCheckMode::ProcessL( const TDesC& aCommand )
{
// Complete the test machine - will then get the next cmd
Machine()->CompleteRequest();
TPtrC param;
TRAPD( error, param.Set( ParamsL( aCommand )) );
if ( error != KErrNone )
return Error( error, TFR_KFmtErrBadCmd, &Keyphrase() );
TLex parse( param );
if ( !parse.Peek().IsSpace() )
return Error( error, TFR_KFmtErrBadCmd, &Keyphrase() );
// Param shall On or Off?
param.Set( TfrLex::TrimAndPeel( param ) );
TBool value = (param.CompareF(TFR_KTxtTermOn) == 0);
if ( !value && param.CompareF(TFR_KTxtTermOff) != 0 )
return Error( KErrArgument, TFR_KFmtErrBadCmd, &Keyphrase() );
// Set Check Mode (ParseOnly) On/Off.
Family()->SetSwitch(CCmdFamily::EParseOnly, value);
return error;
}
示例13: checkConnectionExists
TBool CCmdTransaction::checkConnectionExists(TPtrC &aName)
{
CObjCatalogue *sessions = Machine()->Domains();
for (TInt i = 0; i < sessions->Count(); ++i)
{
CAnyObject *obj = (CAnyObject *)sessions->At(i);
if (obj->Tag() == THA_KHTTP_Connect)
{
TPtrC sessname = obj->Name();
if (sessname.CompareF(aName) == 0)
return ETrue;
}
}
return EFalse;
}
示例14: FindAndReplaceSingleQuote
// ---------------------------------------------------------------------------
// Fixes single quote query issues
// ---------------------------------------------------------------------------
//
void CMPXHarvesterDatabaseTable::FindAndReplaceSingleQuote(const TDesC& aSrc,
TDes& aTrg)
{
TPtrC ch;
TInt srcLen = aSrc.Length();
for (TInt i = 0; i < srcLen; ++i)
{
ch.Set(&aSrc[i], 1);
aTrg.Append(ch);
if ( ch.CompareF(_L("'")) == 0)
{
aTrg.Append(ch);
}
}
}
示例15: CheckResult
TBool CSyntaxTest::CheckResult(const TDesC &aFilename, const TInt &aError)
{
CSyntaxResult *syntaxResult;
TPtrC filename;
iConsole.Printf(aFilename);
iOut.writeString(aFilename);
for(TInt element = 0; element < iExpectedResults->Count(); element++)
{
syntaxResult = (*iExpectedResults)[element];
syntaxResult->GetFilename(filename);
if(filename.CompareF(aFilename)==0)
{
if(syntaxResult->Result() != aError)
{
iConsole.Printf(_L(" FAILED. Expecting "));
iOut.writeString(_L(" FAILED. Expecting "));
PrintError(syntaxResult->Result());
iConsole.Printf(_L(" Recieved "));
iOut.writeString(_L(" Recieved "));
PrintError(aError);
iConsole.Printf(_L("\n"));
iOut.writeNewLine();
return(EFalse);
}
else
{
iConsole.Printf(_L(" Success\n"));
iOut.writeString(_L(" Success "));
iOut.writeNewLine();
return(ETrue);
}
}
}
iConsole.Printf(_L(" FAILED to find expected result\n"));
iOut.writeString(_L(" FAILED to find expected result"));
iOut.writeNewLine();
return(EFalse);
};