本文整理汇总了C++中KKStr::Upper方法的典型用法代码示例。如果您正苦于以下问题:C++ KKStr::Upper方法的具体用法?C++ KKStr::Upper怎么用?C++ KKStr::Upper使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KKStr
的用法示例。
在下文中一共展示了KKStr::Upper方法的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: if
bool DumpSipper3InstrumentData::ProcessCmdLineParameter (char parmSwitchCode,
KKStr parmSwitch,
KKStr parmValue
)
{
parmSwitch.Upper ();
if ((parmSwitch == "-REPORT") ||
(parmSwitch == "-REPORTFILE") ||
(parmSwitch == "-RF") ||
(parmSwitch == "-R")
)
{
reportFileName = parmValue;
}
else
if ((parmSwitch == "-S") ||
(parmSwitch == "-SIPPERFILE") ||
(parmSwitch == "-SF")
)
{
sipperFileName = parmValue;
}
return !Abort ();
} /* ProcessCmdLineParameter */
示例3: 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 */
示例4: ProcessStatusStr
void KKJob::ProcessStatusStr (const KKStr& statusStr)
{
log.Level (30) << "KKJob::ProcessStatusStr[" << statusStr << "]" << endl;
KKStr fieldName;
KKStr fieldValue;
VectorKKStr fields = statusStr.Split ('\t');
kkuint32 fieldNum = 0;
while (fieldNum < fields.size ())
{
fieldName = fields[fieldNum];
fieldNum++;
if (fieldNum < fields.size ())
{
fieldValue = fields[fieldNum];
fieldNum++;
}
else
{
fieldValue = "";
}
fieldName.Upper ();
fieldValue.TrimLeft ("\n\r\t ");
fieldValue.TrimRight ("\n\r\t ");
if (fieldName.CompareIgnoreCase ("JOBID") == 0)
jobId = atoi (fieldValue.Str ());
else if (fieldName.CompareIgnoreCase ("PARENTID") == 0)
parentId = atoi (fieldValue.Str ());
else if (fieldName.CompareIgnoreCase ("STATUS") == 0)
status = JobStatusFromStr (fieldValue);
else if (fieldName.CompareIgnoreCase ("NumProcessors") == 0)
numProcessors = fieldValue.ToInt ();
else if (fieldName.CompareIgnoreCase ("NumPorcessesAllowed") == 0)
numPorcessesAllowed = fieldValue.ToInt ();
else if (fieldName.CompareIgnoreCase ("Prerequisites") == 0)
PrerequisitesFromStr (fieldValue);
else
{
ProcessStatusField (fieldName, fieldValue);
}
}
} /* ProcessStatusStr */
示例5: BinaryClassStatusFromStr
ClassPairStatus BinaryClass::BinaryClassStatusFromStr (KKStr statusStr)
{
statusStr.Upper ();
if (statusStr == "NOTSTARTED")
return ClassPairStatus::NotStarted;
if (statusStr == "STARTED")
return ClassPairStatus::Started;
if (statusStr == "DONE")
return ClassPairStatus::Done;
return ClassPairStatus::Null;
} /* BinaryClassStatusFromStr */
示例6: JobStatusFromStr
rjJobStatus RandomSampleJob::JobStatusFromStr (KKStr statusStr)
{
statusStr.Upper ();
if (statusStr == "OPEN")
return rjOpen;
if (statusStr == "STARTED")
return rjStarted;
if (statusStr == "DONE")
return rjDone;
return rjNULL;
} /* JobStatusFromStr */
示例7: ProcessCmdLineParameter
/******************************************************************************
* ProcessCmdLineParamters
* DESC: Extracts parameters from the command line
******************************************************************************/
bool GradeClassification::ProcessCmdLineParameter (char parmSwitchCode,
KKStr parmSwitch,
KKStr parmValue
)
{
parmSwitch.Upper ();
if ((parmSwitch == "-R") || (parmSwitch == "-REPORT"))
{
reportFileName = parmValue;
}
else if ((parmSwitch == "-C") || (parmSwitch == "-CONFIG") || (parmSwitch == "-CONFIGFILE"))
{
configFileName = parmValue;
}
else if ((parmSwitch == "-SOURCEDIR") ||
(parmSwitch == "-SOURCEDIRECTORY") ||
(parmSwitch == "-SD") ||
(parmSwitch == "-S")
)
{
sourceRootDirPath = parmValue;
}
else if ((parmSwitch == "-HTML") || (parmSwitch == "-H"))
{
htmlFileName = parmValue;
}
else if ((parmSwitch == "-GROUNDTRUTH") || (parmSwitch == "-GT"))
{
groundTruthDirName = parmValue;
}
else
{
log.Level (-1) << endl << endl
<< "Unrecognized parameter[" << parmSwitch << "]" << endl
<< endl;
Abort (true);
}
return !Abort ();
} /* ProcessCmdLineParameter */
示例8: ProcessStatusStr
// Will scan for fields that are specific to 'JobValidation'
void JobValidation::ProcessStatusStr (KKStrParser& statusStr)
{
log.Level (30) << "JobValidation::ProcessStatusStr[" << statusStr.Str () << "]" << endl;
KKStr fieldName;
KKStr fieldValue;
while (statusStr.MoreTokens ())
{
fieldName = statusStr.GetNextToken ("\t\n\r");
fieldName.Upper ();
fieldValue = statusStr.GetNextToken ("\t");
fieldValue.TrimLeft ("\n\r\t ");
fieldValue.TrimRight ("\n\r\t ");
ProcessStatusField (fieldName, fieldValue);
}
} /* ProcessStatusStr */
示例9: ProcessData
void InstrumentDataPitchAndRoll::ProcessData (const KKStr& txt)
{
VectorKKStr fields = txt.Split (" \t\n\r");
if (fields.size () < 4)
return;
float pitch = -999.99f;
float roll = -999.99f;
KKStr fieldName = "";
KKStr fieldValue = "";
kkuint32 fieldNum = 0;
while (fieldNum < fields.size ())
{
fieldName = fields[fieldNum];
fieldName.Upper ();
fieldNum++;
if (fieldNum < fields.size ())
{
fieldValue = fields[fieldNum];
fieldNum++;
}
else
{
fieldValue = "";
}
if (fieldName == "R")
{
roll = fieldValue.ToFloat ();
}
else if (fieldName == "P")
{
pitch = fieldValue.ToFloat ();
}
}
manager->PitchAndRollData (curTextLineStartScanLine, pitch, roll);
} /* ProcessData */
示例10: Load
void RandomSampleJobList::Load (TrainingConfigurationPtr _config,
OrderingsPtr _orderings,
int _numExamplesToKeep
)
{
FILE* in = fopen (jobFileName.Str (), "r");
if (!in)
{
log.Level (-1) << endl
<< endl
<< "RandomSampleJobList::Load *** ERROR ***" << endl
<< endl
<< " Error Opening Status File[" << jobFileName << "]" << endl
<< endl;
exit (-1);
}
char buff[10240];
while (fgets (buff, sizeof (buff), in))
{
KKStr statusStr (buff);
if (statusStr.SubStrPart (0, 1) == "//")
{
// We have a comment line, we want to ignore.
}
else
{
KKStr field = statusStr.ExtractToken (" \t\n\r");
field.Upper ();
if (field == "JOB")
{
RandomSampleJobPtr j = new RandomSampleJob (_config, _orderings, _numExamplesToKeep, statusStr);
PushOnBack (j);
}
}
}
fclose (in);
} /* Load */
示例11: PerformMorphOperations
void LogicalFrame::PerformMorphOperations ()
{
KKStr ops = parms.MorphOperations ();
memcpy (origFrameArea, frameArea, frameTotalPixels);
while (!ops.Empty ())
{
KKStr nextOp = ops.ExtractToken (",\n\r\t");
nextOp.Upper ();
if (nextOp == "O")
PerformOpening ();
else if (nextOp == "C")
PerformClosing ();
else if (nextOp == "D")
PerformDialation ();
else if (nextOp == "E")
PerformErosion ();
}
} /* PerformMorphOperations */
示例12: ProcessStatusStr
void BinaryClass::ProcessStatusStr (KKStr statusStr,
MLClassListPtr mlClasses
)
{
KKStr fieldName;
class1 = NULL;
class2 = NULL;
fieldName = statusStr.ExtractToken2 ("\t");
while (!fieldName.Empty ())
{
fieldName.TrimLeft ("\n\r\t ");
fieldName.TrimRight ("\n\r\t ");
fieldName.Upper ();
if (fieldName == "ALLCLASSES")
{
class1 = NULL;
class2 = NULL;
}
else if (fieldName == "BINARYCLASSES")
{
class1 = mlClasses->GetMLClassPtr (statusStr.ExtractToken2 ("\t"));
class2 = mlClasses->GetMLClassPtr (statusStr.ExtractToken2 ("\t"));
if ((class1 == NULL) || (class2== NULL))
{
cout << "Class1 or Class2 == NULL" << endl;
}
else
{
if ((class1->Name ().Empty ()) || (class1->Name ().Empty ()))
{
cout << "Class1Name or Class2Name are empty" << endl;
}
}
}
else if (fieldName == "STATUS")
status = BinaryClassStatusFromStr (statusStr.ExtractToken2 ("\t"));
else if (fieldName == "NUMPROCESSORS")
numProcessors = statusStr.ExtractTokenInt ("\t");
else if (fieldName.CompareIgnoreCase ("FinalResultType") == 0)
resultType = FinalResultTypeFromStr (statusStr.ExtractToken2 ("\t"));
else if (fieldName.CompareIgnoreCase ("ResultsFileName") == 0)
finalResultsFileName = statusStr.ExtractToken2 ("\t");
else if (fieldName.CompareIgnoreCase ("SelectionMethod") == 0)
selectionMethod = SelectionMethodFromStr (statusStr.ExtractToken2 ("\t"));
else if (fieldName.CompareIgnoreCase ("configFileName") == 0)
configFileName = statusStr.ExtractToken2 ("\t");
fieldName = statusStr.ExtractToken2 ("\t");
}
} /* ProcessStatusStr */
示例13: LoadFile
void Configuration::LoadFile (RunLog& log)
{
log.Level (10) << "Configuration::LoadFile: " << fileName << endl;
kkint32 lastLineNum = 0;
if (fileName == "")
{
log.Level (-1) << endl
<< "Configuration::LoadFile ***ERROR*** File-Name is blank" << endl
<< endl;
FormatGood (false);
return;
}
FILE* inFile = osFOPEN (fileName.Str (), "r");
if (!inFile)
{
log.Level (-1) << endl
<< "Configuration::LoadFile ***ERROR*** Opening File: " << fileName << endl
<< endl;
FormatGood (false);
return;
}
char buff[10240];
kkint32 lineCount = 0;
curSectionName = "";
ConfSectionPtr curSection = NULL;
while (fgets (buff, sizeof (buff), inFile))
{
lastLineNum++;
KKStr line (buff);
line.TrimRight ();
line.TrimLeft ();
StripOutAnyComments (line);
log.Level (70) << line << endl;
StripOutAnyComments (line);
if (line.Empty ())
{
// If we have a blank line, we do nothing.
}
else if (line.FirstChar () == '[')
{
// Looks like definition of new section.
if (line.LastChar () == ']')
{
curSectionName = line.SubStrPart (1, line.Len () - 2);
curSectionName.TrimLeft ();
curSectionName.TrimRight ();
curSectionName.Upper ();
curSection = new ConfSection (curSectionName, lastLineNum);
sections->AddConfSection (curSection);
log.Level (30) << "LoadFile SectionName[" << curSectionName << "]." << endl;
}
else
{
log.Level (-1) << endl
<< "Configuration::LoadFile ***ERROR*** LineNumber[" << lastLineNum << "] Improper Section Name[" << line << "]." << endl
<< endl;
formatGood = false;
}
}
else
{
if (!curSection)
{
log.Level (-1) << endl
<< "Configuration::LoadFile ***ERROR*** Format Error LineNumber[" << lastLineNum << "]" << endl
<< " No Section Defined." << endl
<< endl;
formatGood = false;
curSectionName = "GLOBAL";
curSection = new ConfSection (curSectionName, lastLineNum);
sections->AddConfSection (curSection);
}
kkint32 equalIdx = line.LocateCharacter ('=');
if (equalIdx < 0)
{
// We have a improperly formated line.
log.Level (-1) << endl
<< "Configuration::LoadFile ***ERROR*** LineNumber[" << lastLineNum << "] Improperly Formated Line[" << line << "]."
<< endl;
formatGood = false;
//.........这里部分代码省略.........
示例14: Load
void ActiveLearningReport::Load (KKStr fileName,
bool& validFormat
)
{
validFormat = false;
FILE* f = osFOPEN (fileName.Str (), "r");
if (!f)
{
log.Level (-1) << endl
<< "ActiveLearningReport::Load *** ERROR ***" << endl
<< endl
<< " Could noty open File[" << fileName << "]" << endl
<< endl;
return;
}
char buff[10240];
bool fileParmsLoaded = false;
{
// Get Frst Row wicj should be InitialTrainingImagesPerClass
if (!fgets (buff, sizeof (buff), f))
{
log.Level (-1) << endl
<< "ActiveLearningReport::Load *** ERROR ***" << endl
<< endl
<< " *** No Data ***" << endl
<< endl;
fclose (f);
return;
}
KKStr l (buff);
l.Upper ();
KKStr field = l.ExtractToken ("\n\t\r ");
if (field != "\\INITIALTRAININGIMAGESPERCLASS")
{
log.Level (-1) << endl
<< "ActiveLearningReport::Load *** ERROR ***" << endl
<< endl
<< " First Liine Not Valid[" << l << "]" << endl
<< endl;
fclose (f);
return;
}
initialImagesPerClass = l.ExtractTokenInt ("\n\t\r ");
}
{
// Get second Row wicj should be ImagesPerRetraining
if (!fgets (buff, sizeof (buff), f))
{
log.Level (-1) << endl
<< "ActiveLearningReport::Load *** ERROR ***" << endl
<< endl
<< " *** Missing Second Line ***" << endl
<< endl;
fclose (f);
return;
}
KKStr l (buff);
l.Upper ();
KKStr field = l.ExtractToken ("\n\t\r ");
if (field != "\\IMAGESPERRETRAINING")
{
log.Level (-1) << endl
<< "ActiveLearningReport::Load *** ERROR ***" << endl
<< endl
<< " Second Liine Not Valid[" << l << "]" << endl
<< endl;
fclose (f);
return;
}
imagesPerRetraining = l.ExtractTokenInt ("\n\t\r ");
}
SortOrderResultsPtr curSortOrderResults = NULL;
while (fgets (buff, sizeof (buff), f))
{
KKStr l (buff);
if (l.SubStrPart (0, 0) == "\\")
{
if (curSortOrderResults)
{
results.PushOnBack (curSortOrderResults);
curSortOrderResults = NULL;
}
//.........这里部分代码省略.........
示例15: ProcessStatusStr
void RandomSampleJob::ProcessStatusStr (KKStr statusStr)
{
log.Level (30) << "RandomSampleJob::ProcessStatusStr[" << statusStr << "]" << endl;
KKStr fieldName;
KKStr fieldValue;
compMethod = BRNull;
fieldName = statusStr.ExtractToken ("\t\n\r");
while (!fieldName.Empty ())
{
fieldName.Upper ();
fieldValue = statusStr.ExtractToken ("\t\n\r");
fieldValue.TrimLeft ("\n\r\t ");
fieldValue.TrimRight ("\n\r\t ");
if (fieldName == "JOBID")
jobId = atoi (fieldValue.Str ());
else if (fieldName == "STATUS")
status = JobStatusFromStr (fieldValue);
else if (fieldName == "KERNEL")
kernelType = KernalTypeFromStr (fieldValue);
else if (fieldName == "ENCODING")
encodingMethod = EncodingMethodFromStr (fieldValue);
else if (fieldName == "COMPMETHOD")
compMethod = CompressionMethodFromStr (fieldValue);
else if (fieldName == "C_PARAM")
c = atoi (fieldValue.Str ());
else if (fieldName == "GAMMA")
gamma = atof (fieldValue.Str ());
else if (fieldName == "ORDERINGNUM")
orderingNum = atoi (fieldValue.Str ());
else if (fieldName == "EXAMPLESTOKEEP")
numExamplesToKeep = atoi (fieldValue.Str ());
else if (fieldName == "ACCURACY")
accuracy = (float)atof (fieldValue.Str ());
else if (fieldName == "TRAINTIME")
{
trainTime = atof (fieldValue.Str ());
}
else if (fieldName == "PREDTIME")
testTime = (float)atof (fieldValue.Str ());
else if (fieldName == "SUPPORTVECTORS")
supportVectors = (float)atof (fieldValue.Str ());
else
{
log.Level (-1) << "RandomSampleJob::ProcessStatusStr Invalid Field Name[" << fieldName << "]." << endl;
}
fieldName = statusStr.ExtractToken ("\t\n\r");
}
} /* ProcessStatusStr */