本文整理汇总了C++中HBufC::CompareF方法的典型用法代码示例。如果您正苦于以下问题:C++ HBufC::CompareF方法的具体用法?C++ HBufC::CompareF怎么用?C++ HBufC::CompareF使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HBufC
的用法示例。
在下文中一共展示了HBufC::CompareF方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LandmarkStoresL
// ---------------------------------------------------------------------------
// CLAPILandmarkStoreManager::LandmarkStoresL
// ---------------------------------------------------------------------------
//
CDesCArray* CLAPILandmarkStoreManager::LandmarkStoresL()
{
JELOG2(EJavaLocation);
// List landmark databases but remove the default store from the array
CDesCArray* stores = iLmDbManager->ListDatabasesLC();
HBufC* defaultDbName = iLmDbManager->DefaultDatabaseUriLC();
// Remove the default database from the store names array. External stores
// are also removed because this API does not support other than stores
// which are located in the file system of the device
TInt count = stores->Count();
for (TInt i = 0; i < count; i++)
{
TPtrC storeUri = stores->MdcaPoint(i);
if (defaultDbName->CompareF(storeUri) == 0 || storeUri.FindF(
KLAPIDefaultProtocol) == KErrNotFound)
{
stores->Delete(i);
break;
}
}
CleanupStack::PopAndDestroy(defaultDbName);
CleanupStack::Pop(stores);
return stores;
}
示例2: ParseDataLineL
TInt TPkgParser::ParseDataLineL(class CFileObjectHolder* &aFileList,
char* line)
{
char* localName = NULL;
char* url = NULL;
uint32 fileSize = 0;
char* checksum = NULL;
uint32 action = 0;
char* version = NULL;
char* versionFile = NULL;
char* versionCheck = NULL;
char* isoLang = NULL;
TBool ok = ETrue;
ok = ok && ParseString(localName, line);
ok = ok && ParseString(url, line);
ok = ok && ParseUint32(fileSize, line);
ok = ok && ParseString(checksum, line);
ok = ok && ParseUint32(action, line);
ok = ok && ParseString(version, line); //last mandatory field
TBool lineCorrect = ok;
ok = ok && ParseString(versionFile, line); //may return EFalse if
//there is no ending ';'
ok = ok && ParseString(versionCheck, line);
ok = ok && ParseString(isoLang, line);
if(!lineCorrect){
return 0;
}
//ignore lines that are language tagged but doesn't match the
//selected language.
if(isoLang && strlen(isoLang) > 0 && iSelectedLang != KNullDesC){
HBufC* lang = WFTextUtil::AllocL(isoLang);
if(0 != lang->CompareF(iSelectedLang)){
action = 3; //Delete file.
}
delete lang;
}
class CFileObject *a = CFileObject::NewLC(localName, url, fileSize,
checksum, action, version,
versionFile, versionCheck,
isoLang);
if (!aFileList) {
aFileList = new (ELeave) CFileObjectHolder();
}
CleanupStack::Pop(a);
aFileList->unshift(a);
return 1;
}
示例3: ElementHandlerLinkL
// -----------------------------------------------------------------------------
// CAtomFeedParser::ElementHandlerLinkL
//
// A ElementHandler function that handles the link element.
// -----------------------------------------------------------------------------
//
void CAtomFeedParser::ElementHandlerLinkL(const CFeedParser& /*aParser*/, CXmlUtils& aXmlUtils,
TXmlEngElement aNode, TInt aValueId, MFeedParserObserver& aObserver)
{
HBufC* rel = NULL;
HBufC* href = NULL;
// Get the link's relationship.
rel = aXmlUtils.AttributeL(aNode, KRel);
CleanupStack::PushL(rel);
// Get the link's url.
// TODO: Resolve the href using the base element or feed url.
href = aXmlUtils.AttributeL(aNode, KHref);
CleanupStack::PushL(href);
if ((href == NULL) || (href->Length() == 0))
{
CleanupStack::PopAndDestroy(href);
CleanupStack::PopAndDestroy(rel);
return;
}
// The link points to an item's full story or feed's main web page.
if ((rel == NULL) || (rel->CompareF(KAlternate) == 0))
{
aObserver.AddAttributeL(aValueId, *href);
}
// The link points to an enclsoure.
else if (rel->CompareF(KEnclosure) == 0)
{
HBufC* type = NULL;
HBufC* title = NULL;
HBufC* length = NULL;
type = aXmlUtils.AttributeL(aNode, KType);
CleanupStack::PushL(type);
title = aXmlUtils.AttributeL(aNode, KTitle);
CleanupStack::PushL(title);
length = aXmlUtils.AttributeL(aNode, KLength);
CleanupStack::PushL(length);
aObserver.EnclosureBeginsL();
if (type != NULL)
{
aObserver.AddAttributeL(EEnclosureAttributeContentType, *type);
}
if (length != NULL)
{
aObserver.AddAttributeL(EEnclosureAttributeSize, *length);
}
if (href != NULL)
{
aObserver.AddAttributeL(EEnclosureAttributeLink, *href);
}
if (title != NULL)
{
aObserver.AddAttributeL(EEnclosureAttributeTitle, *title);
}
aObserver.EnclosureEndsL();
CleanupStack::PopAndDestroy(length);
CleanupStack::PopAndDestroy(title);
CleanupStack::PopAndDestroy(type);
}
CleanupStack::PopAndDestroy(href);
CleanupStack::PopAndDestroy(rel);
}
示例4: FileNamesEqual
// ---------------------------------------------------------------------------
// FileNamesEqual()
// ---------------------------------------------------------------------------
//
TBool FileNamesEqual( const HBufC& aFile1, const HBufC& aFile2 )
{
return ( aFile1.CompareF( aFile2 ) == 0 );
}
示例5: OkToExitL
TBool CConfigureCDSDialog::OkToExitL(TInt aButtonId)
{
LOG_MSG( "-> CConfigureCDSDialog::OkToExitL" );
TBool ret = ETrue;
TInt err;
RPointerArray<CEikEdwin> edwins;
CEikEdwin *edwin = static_cast<CEikEdwin*>(Control(EEdwin1));
edwins.Append(edwin);
edwin = static_cast<CEikEdwin*>(Control(EEdwin2));
edwins.Append(edwin);
edwin = static_cast<CEikEdwin*>(Control(EEdwin3));
edwins.Append(edwin);
edwin = static_cast<CEikEdwin*>(Control(EEdwin4));
edwins.Append(edwin);
edwin = static_cast<CEikEdwin*>(Control(EEdwin5));
edwins.Append(edwin);
edwin = static_cast<CEikEdwin*>(Control(EEdwin6));
edwins.Append(edwin);
edwin = static_cast<CEikEdwin*>(Control(EEdwin7));
edwins.Append(edwin);
switch (aButtonId)
{
case EEikBidCancel:
{
//RDebug::Print(_L("CConfigureCDSDialog::OkToExitL: Cancel pressed"));
}
break;
case EBidCDSConfigure:
{
//RDebug::Print(_L("CConfigureCDSDialog::OkToExitL: iConfs.Count() == %d"), iConfs.Count());
for (TInt i = 0; ( i < iConfs.Count() ) && ret; i++)
{
err = KErrNone;
HBufC *input = NULL;
if (edwins[i]->TextLength() > 0)
{
input = edwins[i]->GetTextInHBufL();
}
if ( ! input )
{
LOG_MSG2( " NULL input for param %d" , i );
continue;
}
//RDebug::Print(_L("CConfigureCDSDialog::OkToExitL: iConfs[i]->Type() == %d"), iConfs[i]->Type());
switch (iConfs[i]->Type())
{
case COptionConfig::ETInt:
case COptionConfig::ETUInt:
{
TLex opts(*input);
TInt32 conf;
err = opts.Val(conf);
if ( err )
{
LOG_MSG(" error from opts.Val(conf) -> CConfigureCDSDialog::CEikonEnv::Static()->InfoMsg;" );
CEikonEnv::Static()->InfoMsg(_L("Value must be an integer"));
break;
}
//RDebug::Print(_L("CConfigureCDSDialog::OkToExitL: conf == %d"), conf);
iConfs[i]->Value(conf);
TRAP( err, iCoreDumpSession.SetConfigParameterL( *iConfs[i]) );
}
break;
case COptionConfig::ETFileName:
case COptionConfig::ETString:
case COptionConfig::ETSingleEntryEnum:
case COptionConfig::ETMultiEntryEnum:
{
TRAP( err, iConfs[i]->ValueL(*input) );
if ( KErrNone == err )
{
TRAP( err, iCoreDumpSession.SetConfigParameterL( *iConfs[i]) );
}
}
break;
case COptionConfig::ETBool:
if (input->CompareF(_L("True"))== 0)
{
iConfs[i]->Value(ETrue);
iConfs[i]->ValueL(_L("True"));
}
else if (input->CompareF(_L("False"))== 0)
{
iConfs[i]->Value(EFalse);
iConfs[i]->ValueL(_L("False"));
}
else
{
err = KErrCorrupt;
}
if ( KErrNone == err )
//.........这里部分代码省略.........