本文整理汇总了C++中VectorKKStr::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ VectorKKStr::begin方法的具体用法?C++ VectorKKStr::begin怎么用?C++ VectorKKStr::begin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VectorKKStr
的用法示例。
在下文中一共展示了VectorKKStr::begin方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ParseParameterStr
void DataBaseServer::ParseParameterStr (const KKStr& parameterStr)
{
VectorKKStr parameterPairs = parameterStr.Split ("\t");
VectorKKStr::iterator idx;
for (idx = parameterPairs.begin (); idx != parameterPairs.end (); idx++)
{
VectorKKStr fields = (*idx).Split (":="); // Split by either ':' or '='
if (fields.size () < 2)
{
// Should be two fields; line must be malformed.
continue;
}
KKStr parameterName = fields[0].ToUpper ();
if ((parameterName == "EMBEDDED") || (parameterName == "EMB") || (parameterName == "E")) embedded = fields[1].ToBool ();
else if ((parameterName == "MYSQLDATADIR") || (parameterName == "MYSQL") || (parameterName == "MDD")) mySqlDataDir = fields[1];
else if ((parameterName == "DESCRIPTION") || (parameterName == "DESC") || (parameterName == "D")) description = fields[1];
else if ((parameterName == "HOSTNAME") || (parameterName == "HOST") || (parameterName == "H")) hostName = fields[1];
else if ((parameterName == "USERNAME") || (parameterName == "USER") || (parameterName == "U")) userName = fields[1];
else if ((parameterName == "PASSWORD") || (parameterName == "PW") || (parameterName == "P")) passWord = fields[1];
else if ((parameterName == "PORTNUM") || (parameterName == "PN")) portNum = fields[1].ToUint32 ();
else if ((parameterName == "DATABASENAME") || (parameterName == "DATABASE") || (parameterName == "DB")) dataBaseName = fields[1];
}
if (description.EqualIgnoreCase ("Embedded"))
embedded = true;
} /* ParseParameterStr */
示例2: FileInStack
bool FileInStack (const KKStr& cmdFileName,
const VectorKKStr& cmdFileStack
)
{
VectorKKStr::const_iterator idx;
for (idx = cmdFileStack.begin (); idx != cmdFileStack.end (); idx++)
{
if (*idx == cmdFileName)
return true;
}
return false;
} /* FileInStack */
示例3: if
void AbundanceCorrectionStatsBuilder::Main ()
{
if (Abort ())
return;
if (reportFileName.Empty ())
{
DateTime d = osGetLocalDateTime ();
KKStr reportDir = osAddSlash (SipperVariables::PicesReportDir ()) + "AbundanceAdjustments";
osCreateDirectoryPath (reportDir);
if (configFileName.Empty ())
reportFileName = osAddSlash (reportDir) + "NoConfigFile" + "_" + d.YYYYMMDDHHMMSS () + ".txt";
else
reportFileName = osAddSlash (reportDir) + osGetRootName (configFileName) + "_" + d.YYYYMMDDHHMMSS () + ".txt";
}
report = new ofstream (reportFileName.Str ());
PrintComandLineParameters ();
if (configFileName.Empty ())
{
log.Level (-1) << endl << endl
<< "AbundanceCorrectionStatsBuilder::Main ***ERROR*** Configuration File was not specified." << endl
<< endl;
Abort (true);
*report << endl << "*** NO CONFIGURATION FILE SPECIFIED ***" << endl << endl;
return;
}
delete config;
config = new TrainingConfiguration2 (fileDesc,
configFileFullPath,
log,
true /**< 'true' = validateDirectories. */
);
if (!config->FormatGood ())
{
log.Level (-1) << endl
<< "AbundanceCorrectionStatsBuilder::Main Config[" << configFileName << "] has invalid format." << endl
<< endl;
VectorKKStr errors = config->FormatErrorsWithLineNumbers ();
VectorKKStr::const_iterator idx;
log.Level (-1) << endl;
for (idx = errors.begin (); idx != errors.end (); ++idx)
log.Level (-1) << (*idx) << endl;
log.Level (-1) << endl << endl;
*report << endl << endl << "*** Configuratiuon file[" << configFileName << " contains formatting errors." << endl << endl;
config->PrintFormatErrors (*report);
return;
}
bool changesMadeToTrainingLibraries = false;
bool cancelFlag = false;
DateTime latestImageTimeStamp;
delete trainLibData;
trainLibData = config->LoadFeatureDataFromTrainingLibraries (latestImageTimeStamp, changesMadeToTrainingLibraries, cancelFlag);
if (!trainLibData)
{
log.Level (-1) << endl
<< "AbundanceCorrectionStatsBuilder::Main ***ERROR*** No training data was loaded." << endl
<< endl;
*report << endl << "*** Failed to load training data ***" << endl;
return;
}
otherClass = config->OtherClass ();
if (!otherClass)
otherClass = MLClass::CreateNewMLClass ("Other", -1);
configClasses = config->ExtractClassList ();
configClasses->SortByName ();
if (configClasses->PtrToIdx (otherClass) >= 0)
{
log.Level (-1) << endl
<< "AbundanceCorrectionStatsBuilder::Main ***ERROR*** OtherClass[" << otherClass->Name () << "] is specified as a Training Class; it must be swepcified separatly." << endl
<< endl;
*report << endl << "*** Failed to load other class data ***" << endl;
return;
}
trainLibDataClasses = trainLibData->ExtractMLClassConstList ();
trainLibDataClasses->SortByName ();
if ((*configClasses) != (*trainLibDataClasses))
{
Abort (true);
log.Level (-1) << endl
<< "AbundanceCorrectionStatsBuilder::Main ***ERROR*** Class make up of training data does not correspond to configuration file." << endl
<< endl;
*report << endl << "*** Training data contains different classes that Confg File ***" << endl;
return;
}
//.........这里部分代码省略.........