本文整理汇总了C++中KKStr::EqualIgnoreCase方法的典型用法代码示例。如果您正苦于以下问题:C++ KKStr::EqualIgnoreCase方法的具体用法?C++ KKStr::EqualIgnoreCase怎么用?C++ KKStr::EqualIgnoreCase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KKStr
的用法示例。
在下文中一共展示了KKStr::EqualIgnoreCase方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessCmdLineParameter
bool ImportFullSizeFromSqlBackUp::ProcessCmdLineParameter (
char parmSwitchCode,
KKStr parmSwitch,
KKStr parmValue
)
{
KKStr parmValueUpper (parmValue);
parmValueUpper.Upper ();
parmSwitch.Upper ();
if ((parmSwitch == "-S") ||
(parmSwitch == "-SRC") ||
(parmSwitch == "-SOURCE") ||
(parmSwitch.EqualIgnoreCase ("-SrcFile"))
)
{
srcFileName = parmValue;
if (!osFileExists (srcFileName))
{
log.Level (-1) << "ProcessCmdLineParameter ***ERROR*** Invalid '-SrcFile' [" << srcFileName << "] file." << endl;
Abort (true);
}
}
return !Abort ();
} /* ProcessCmdLineParameter */
示例2: StartStopTypeFromStr
StartStopPoint::StartStopType StartStopPoint::StartStopTypeFromStr (const KKStr& s)
{
for (int x = (int)StartStopType::Null; x < (int)StartStopType::Invalid; ++x)
if (s.EqualIgnoreCase (startStopPointStrs[x]))
return (StartStopType)x;
return StartStopType::Null;
}
示例3: ParseToString
void FeatureNumList::ParseToString (const KKStr& _str,
bool& _valid
)
{
_valid = true;
delete featureNums;
featureNumsAllocatedSize = 0;
maxFeatureNum = 0;
numOfFeatures = 0;
featureNums = NULL;
if (_str.EqualIgnoreCase ("NONE"))
{
maxFeatureNum = 1;
AllocateArraySize ((IntType)(maxFeatureNum + 1));
return;
}
VectorIntType* list = StrToUInt16Vetor (_str);
if (list)
{
sort(list->begin (), list->end ());
maxFeatureNum = list->back ();
AllocateArraySize ((IntType)list->size ());
for (auto idx: *list)
AddFeature (idx);
}
else
{
_valid = false;
}
delete list;
list = NULL;
} /* ParseToString */
示例4: ProcessStatusField
void JobValidation::ProcessStatusField (const KKStr& fieldName,
const KKStr& fieldValue
)
{
// 'JobValidation' does not have any fields.
if (fieldName.EqualIgnoreCase ("configFileName"))
configFileName = fieldValue;
} /* ProcessStatusField */
示例5: ProcessCmdLineParameter
bool ImageDimensionComputations::ProcessCmdLineParameter (const KKStr& parmSwitch,
const KKStr& parmValue
)
{
bool validParm = true;
if (parmSwitch.EqualIgnoreCase ("-R") || parmSwitch.EqualIgnoreCase ("-Report"))
{
reportFileName = parmValue;
}
else
{
validParm = PicesApplication::ProcessCmdLineParameter (parmSwitch, parmValue);
}
return validParm;
} /* ProcessCmdLineParameter */
示例6: ProcessCmdLineParameter
bool ImportFullSizeFromSqlBackUp::ProcessCmdLineParameter (const KKStr& parmSwitch,
const KKStr& parmValue
)
{
if (parmSwitch.EqualIgnoreCase ("-S") ||
parmSwitch.EqualIgnoreCase ("-SRC") ||
parmSwitch.EqualIgnoreCase ("-SOURCE") ||
parmSwitch.EqualIgnoreCase ("-SrcFile")
)
{
srcFileName = parmValue;
if (!osFileExists (srcFileName))
{
log.Level (-1) << "ImportFullSizeFromSqlBackUp::ProcessCmdLineParameter ***ERROR*** Invalid '-SrcFile' [" << srcFileName << "] file." << endl;
Abort (true);
}
}
return !Abort ();
} /* ProcessCmdLineParameter */
示例7: LookUp
SettingConstPtr LookUp (const KKStr& name) const
{
kkuint32 qSize = QueueSize ();
for (kkuint32 idx = 0; idx < qSize; idx++)
{
SettingConstPtr setting = IdxToPtr (idx);
if (name.EqualIgnoreCase (setting->Name ()))
return setting;
}
return NULL;
} /* LookUp */
示例8: ExtractHeaderField
void ScannerFile::ExtractHeaderField (const KKStr& fieldName,
const KKStr& fieldValue
)
{
if (fieldName.EqualIgnoreCase ("FrameHeight"))
{
kkuint32 fieldValueUint = fieldValue.ToInt32 ();
if ((fieldValueUint > 0) && (fieldValueUint < (1024 * 1024)))
frameHeight = fieldValue.ToInt32 ();
}
else if (fieldName.EqualIgnoreCase ("PixelsPerScanLine"))
pixelsPerScanLine = fieldValue.ToInt ();
else if (fieldName.EqualIgnoreCase ("ScanRate"))
scanRate = fieldValue.ToFloat ();
else if (fieldName.EqualIgnoreCase ("FlatFieldCorrectionEnabled"))
flatFieldEnabled = fieldValue.ToBool ();
} /* ExtractHeaderField */
示例9: ScannerFileFormatFromStr
ScannerFile::Format ScannerFile::ScannerFileFormatFromStr (const KKStr& fileFormatStr)
{
kkint32 x = 0;
while (x < (kkint32)Format::sfUnKnown)
{
if (fileFormatStr.EqualIgnoreCase (fileFormatOptions[x]))
return (Format)x;
++x;
}
return Format::sfUnKnown;
} /* ScannerFileFormatFromStr */
示例10: ProcessCmdLineParameter
bool AbundanceCorrectionStatsBuilder::ProcessCmdLineParameter (char parmSwitchCode,
KKStr parmSwitch,
KKStr parmValue
)
{
KKStr parmValueUpper (parmValue);
parmValueUpper.Upper ();
if (parmSwitch.EqualIgnoreCase ("-c") || parmSwitch.EqualIgnoreCase ("-config"))
{
configFileName = parmValue;
configFileFullPath = TrainingConfiguration2::GetEffectiveConfigFileName (configFileName);
if (!osFileExists (configFileFullPath))
{
log.Level (-1) << "ProcessCmdLineParameter ***ERROR*** Invalid '-config' [" << configFileName << "] file." << endl;
Abort (true);
}
}
else if (parmSwitch.EqualIgnoreCase ("-folds") || parmSwitch.EqualIgnoreCase ("-numFolds") || parmSwitch.EqualIgnoreCase ("-numOfFolds"))
{
numOfFolds = parmValue.ToInt ();
if ((numOfFolds < 2) || (numOfFolds > 1000))
{
log.Level (-1) << "ProcessCmdLineParameter ***ERROR*** Invalid '-NumFolds' [" << numOfFolds << "] Invlaid; valid values (2 - 1000)." << endl;
Abort (true);
}
}
else if (parmSwitch.EqualIgnoreCase ("-r") || parmSwitch.EqualIgnoreCase ("-report") || parmSwitch.EqualIgnoreCase ("-ReportFileName"))
reportFileName = parmValue;
return !Abort ();
} /* ProcessCmdLineParameter */
示例11: LookUp
ConfSectionPtr LookUp (const KKStr& _name)
{
ConfSectionPtr tempSection = NULL;
ConfSectionPtr section = NULL;
ConfSectionList::const_iterator idx;
for (idx = begin (); idx != end (); ++idx)
{
tempSection = *idx;
if (_name.EqualIgnoreCase (tempSection->Name ()))
{
section = tempSection;
break;
}
}
return section;
} /* LookUp */
示例12: ProcessCmdLineParameter
bool DeleteDuplicateImages::ProcessCmdLineParameter (const KKStr& parmSwitch,
const KKStr& parmValue
)
{
bool parmValid = true;
if ((parmSwitch.EqualIgnoreCase ("-ROOTDIR")) ||
(parmSwitch.EqualIgnoreCase ("-ROOT")) ||
(parmSwitch.EqualIgnoreCase ("-SOURCEDIR")) ||
(parmSwitch.EqualIgnoreCase ("-RD"))
)
{
rootDir = parmValue;
if (!osValidDirectory (rootDir))
{
cerr << endl
<< endl
<< "*** ERROR *** Invalid Root Dir[" << rootDir << "]." << endl;
DisplayCmdLine ();
parmValid = false;
}
}
else if ((parmSwitch.EqualIgnoreCase ("-R")) ||
(parmSwitch.EqualIgnoreCase ("-REPORT")) ||
(parmSwitch.EqualIgnoreCase ("-ReportFile"))
)
{
reportFileName = parmValue;
}
else
{
parmValid = PicesApplication::ProcessCmdLineParameter (parmSwitch, parmValue);
}
if (!parmValid)
Abort (true);
return parmValid;
} /* ProcessCmdLineParameter */
示例13: GuessFormatOfFile
ScannerFile::Format ScannerFile::GuessFormatOfFile (const KKStr& _fileName,
RunLog& _log
)
{
// Will guess what file format by trying to open each one until one is considered valid.
FILE* f = osFOPEN (_fileName.Str (), "rb");
if (!f)
return Format::sfUnKnown;
bool endOfText = false;
KKStr ln (100);
ReadHeaderOneLine (f, endOfText, ln);
fclose (f);
KKStr fieldName = ln.ExtractToken2 ("\t");
if (!fieldName.EqualIgnoreCase ("ScannerFile"))
return Format::sfUnKnown;
KKStr scannerFileFormatStr = ln.ExtractToken2 ("\t");
return ScannerFileFormatFromStr (scannerFileFormatStr);
} /* GuessFormatOfFile */
示例14: ProcessCmdLineParameter
bool MergeFeatureFiles::ProcessCmdLineParameter (const KKStr& parmSwitch,
const KKStr& parmValue
)
{
bool validParm = true;
if (parmSwitch.EqualIgnoreCase ("-S") ||
parmSwitch.EqualIgnoreCase ("-SRC") ||
parmSwitch.EqualIgnoreCase ("-SOURCE")
)
{
KKStr srcFileName = parmValue;
if (!osFileExists (srcFileName))
{
log.Level (-1) << "ProcessCmdLineParameter ***ERROR*** Invalid '-src' [" << srcFileName << "] file." << endl;
Abort (true);
validParm = false;
}
srcFileNames.push_back (srcFileName);
srcFormats.push_back (currentDefaultFormat);
if (!currentDefaultFormat->CanRead ())
{
log.Level (-1) << "ProcessCmdLineParameter ***ERROR*** Format[" << currentDefaultFormat->DriverName () << "] does not support read." << endl;
Abort (true);
validParm = false;
}
}
else if
(parmSwitch.EqualIgnoreCase ("-DEST") ||
parmSwitch.EqualIgnoreCase ("-D") ||
parmSwitch.EqualIgnoreCase ("-DESTINATION")
)
{
if (!destFileName.Empty ())
{
log.Level (-1) << "ProcessCmdLineParameter ***ERROR*** More than one destination file was specified." << endl;
Abort (true);
validParm= false;
}
destFileName = parmValue;
if (osFileExists (destFileName))
{
log.Level (-1) << "ProcessCmdLineParameter ***ERROR*** Destination File[" << destFileName << "] already exists." << endl;
Abort (true);
validParm = false;
}
if (!currentDefaultFormat->CanWrite ())
{
log.Level (-1) << "ProcessCmdLineParameter ***ERROR*** Format[" << currentDefaultFormat->DriverName () << "] does not support write." << endl;
Abort (true);
validParm = false;
}
destFormat = currentDefaultFormat;
}
else if
(parmSwitch.EqualIgnoreCase ("-F") ||
parmSwitch.EqualIgnoreCase ("-FORMAT")
)
{
FeatureFileIOPtr newFormat = FeatureFileIO::FileFormatFromStr (parmValue);
if (!newFormat)
{
log.Level (-1) << "ProcessCmdLineParameter ***ERROR*** No such format as[" << parmValue<< "]." << endl;
Abort (true);
validParm = false;
}
else
{
currentDefaultFormat = newFormat;
}
}
else if
(parmSwitch.EqualIgnoreCase ("-STRAT") ||
parmSwitch.EqualIgnoreCase ("-STRATIFY")
)
{
stratify = true;
if (!parmValue.Empty ())
{
numOfFolds = parmValue.ToInt ();
if ((numOfFolds < 1) || (numOfFolds > 1000))
{
log.Level (-1) << "ProcessCmdLineParameter ***ERROR*** -Folds[" << numOfFolds << "] must be 1 or greater and less than 10000." << endl;
Abort (true);
validParm = false;
}
}
}
else if
(parmSwitch.EqualIgnoreCase ("-RAND") ||
parmSwitch.EqualIgnoreCase ("-RANDOM") ||
//.........这里部分代码省略.........
示例15: ProcessCmdLineParameter
/******************************************************************************
* ProcessCmdLineParamters
* DESC: Extracts parameters from the command line
******************************************************************************/
bool OurNeighbors::ProcessCmdLineParameter (const KKStr& parmSwitch,
const KKStr& parmValue
)
{
bool validParm = true;
if (parmSwitch.EqualIgnoreCase ("-BUCKETCOUNT") || parmSwitch.EqualIgnoreCase ("-BC"))
{
numOfBuckets = atoi (parmValue.Str ());
if (numOfBuckets < 2)
{
log.Level (-1) << "ProcessCmdLineParameter *** Invalid Buckets[" << numOfBuckets << "] parameter" << endl;
validParm = false;
}
}
else if (parmSwitch.EqualIgnoreCase ("-BUCKETSIZE") || parmSwitch.EqualIgnoreCase ("-BS"))
{
bucketSize = atoi (parmValue.Str ());
if (bucketSize < 1)
{
log.Level (-1) << "ProcessCmdLineParameter *** Invalid BucketSize[" << bucketSize << "] parameter" << endl;
Abort (true);
}
}
else if (parmSwitch.EqualIgnoreCase ("-EXCLUDECLASS") || parmSwitch.EqualIgnoreCase ("-EC"))
{
if (parmValue.Empty ())
{
log.Level (-1) << endl << endl
<< "ProcessCmdLineParameter '-ExcludeClass' missing class name to exclude." << endl
<< endl;
Abort (true);
}
else
{
if (!excludedClasses)
excludedClasses = new MLClassList ();
if (excludedClasses->LookUpByName (parmValue) != NULL)
{
log.Level (-1) << "ProcessCmdLineParameter '-ExcludeClass[" << parmValue << "]' Specified more than once." << endl;
}
else
{
excludedClasses->PushOnBack (MLClass::CreateNewMLClass (parmValue));
}
}
}
else if (parmSwitch.EqualIgnoreCase ("-FROMPLANKTON") || parmSwitch.EqualIgnoreCase ("-FP"))
{
fromPlanktonName = parmValue;
}
else if (parmSwitch.EqualIgnoreCase ("-H") || parmSwitch.EqualIgnoreCase ("-HTML"))
htmlFileName = parmValue;
else if (parmSwitch.EqualIgnoreCase ("-ITERATIONS") || parmSwitch.EqualIgnoreCase ("-I"))
{
numOfIterations = atoi (parmValue.Str ());
if (numOfIterations < 1)
{
log.Level (-1) << "ProcessCmdLineParameter *** Invalid Iterations[" << numOfIterations << "] parameter" << endl;
Abort (true);
}
}
else if (parmSwitch.EqualIgnoreCase ("-LLOYDSBINSIZE") ||
parmSwitch.EqualIgnoreCase ("-LBS") ||
parmSwitch.EqualIgnoreCase ("-BASELLOYDSBINSIZE") ||
parmSwitch.EqualIgnoreCase ("-BLBS")
)
{
baseLLoydsBinSize = atoi (parmValue.Str ());
if (baseLLoydsBinSize < 10)
{
log.Level (-1) << endl << endl
<< "ProcessCmdLineParameter *** Invalid BaseLLoydsBinSize[" << baseLLoydsBinSize << "] parameter ***" << endl
<< endl;
Abort (true);
}
}
else if (parmSwitch.EqualIgnoreCase ("-NEARESTNEIGHBORTYPE") || parmSwitch.EqualIgnoreCase ("-NNT"))
{
if (parmValue.EqualIgnoreCase ("0") || parmValue.EqualIgnoreCase ("ANY"))
neighborType = NeighborType::AnyPlankton;
else if (parmValue.EqualIgnoreCase ("1") || parmValue.EqualIgnoreCase ("SAME"))
neighborType = NeighborType::SamePlankton;
}
//.........这里部分代码省略.........