本文整理汇总了C++中String::ExtractTokenDouble方法的典型用法代码示例。如果您正苦于以下问题:C++ String::ExtractTokenDouble方法的具体用法?C++ String::ExtractTokenDouble怎么用?C++ String::ExtractTokenDouble使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类String
的用法示例。
在下文中一共展示了String::ExtractTokenDouble方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadCurrentStatusFile
void ParameterSearchBinaryCombo::LoadCurrentStatusFile ()
{
log.Level (10) << "ParameterSearchBinaryCombo::LoadCurrentStatusFile - Loading current Status File." << endl;
char buff[10240];
statusFile = fopen (statusFileName, "r");
if (!statusFile)
{
log.Level (-1) << endl
<< "ParameterSearchBinaryCombo::LoadCurrentStatusFile - *** ERROR *** Can not open Status File["
<< statusFileName << "]."
<< endl;
EndBlock ();
exit (1);
osWaitForEnter ();
}
{
fgets (buff, sizeof (buff), statusFile);
String cmdLine (buff);
cmdLine.TrimRight ();
ProcessCmdLineStr (cmdLine);
}
{
// If images are not loadted then we need 2 load trhem now.
if (images.QueueSize () < 1)
{
ReadProblem ();
}
}
{
fgets (buff, sizeof (buff), statusFile);
String buffStr (buff);
numOfProcesses = buffStr.ExtractTokenInt (" ,\n\t");
highestAccuracySoFar = buffStr.ExtractTokenDouble (" ,\n\t");
}
{
// Get Master Class List
delete masterClassList;
fgets (buff, sizeof (buff), statusFile);
String buffStr (buff);
numOfClasses = buffStr.ExtractTokenInt (" ,\n\t");
masterClassList = new ImageClassPtr[numOfClasses];
for (int idx = 0; idx < numOfClasses; idx++)
{
String className = buffStr.ExtractToken (" ,\n\t");
masterClassList[idx] = imageClasses.LookUpByName (className);
if (!masterClassList[idx])
{
cerr << endl
<< "*** ERROR ***, Class[" << className << "] is not one of the classes in the data file." << endl
<< endl;
exit (-1);
}
}
}
{
// Lets get next Class IDX's to perform
fgets (buff, sizeof (buff), statusFile);
String buffStr (buff);
nextClass0IDX = buffStr.ExtractTokenInt (" ,\n\t");
nextClass1IDX = buffStr.ExtractTokenInt (" ,\n\t");
}
if (processes)
{
delete processes;
processes = NULL;
}
processes = new ParameterProcessList (true);
for (int processLineNum = 0; processLineNum < numOfProcesses; processLineNum++)
{
fgets (buff, sizeof (buff), statusFile);
String buffStr (buff);
processes->PushOnBack (new ParameterProcess (log, imageClasses, buffStr));
}
fclose (statusFile);
statusFile = NULL;
return;
} /* LoadCurrentStatusFile */
示例2: LoadCurrentStatusFile
void ParameterSearch::LoadCurrentStatusFile ()
{
log.Level (10) << "ParameterSearch::LoadCurrentStatusFile - Loading current Status File." << endl;
char buff[10240];
statusFile = fopen (statusFileName, "r");
if (!statusFile)
{
log.Level (-1) << endl
<< "ParameterSearch::LoadCurrentStatusFile - *** ERROR *** Can not open Status File["
<< statusFileName << "]."
<< endl;
EndBlock ();
exit (1);
osWaitForEnter ();
}
{
fgets (buff, sizeof (buff), statusFile);
String cmdLine (buff);
cmdLine.TrimRight ();
ProcessCmdLineStr (cmdLine);
}
{
fgets (buff, sizeof (buff), statusFile);
String buffStr (buff);
numOfProcesses = buffStr.ExtractTokenInt (" ,\n\t");
nextJobId = buffStr.ExtractTokenInt (" ,\n\t");
highestAccuracySoFar = buffStr.ExtractTokenDouble (" ,\n\t");
}
{
fgets (buff, sizeof (buff), statusFile);
String buffStr (buff);
nextC = buffStr.ExtractTokenInt (" ,\n\t");
nextGamma = buffStr.ExtractTokenDouble (" ,\n\t");
nextA = buffStr.ExtractTokenInt (" ,\n\t");
}
if (processes)
{
delete processes;
processes = NULL;
}
processes = new ParameterJobList (true);
for (int processLineNum = 0; processLineNum < numOfProcesses; processLineNum++)
{
fgets (buff, sizeof (buff), statusFile);
String buffStr (buff);
processes->PushOnBack (new ParameterJob (log, buffStr));
}
fclose (statusFile);
statusFile = NULL;
return;
} /* LoadCurrentStatusFile */