本文整理汇总了C++中String::ExtractChar方法的典型用法代码示例。如果您正苦于以下问题:C++ String::ExtractChar方法的具体用法?C++ String::ExtractChar怎么用?C++ String::ExtractChar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类String
的用法示例。
在下文中一共展示了String::ExtractChar方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: log
ParameterJob::ParameterJob (RunLog& _log,
String _desc
):
log (_log)
{
accuracy = 0;
startTime = 0;
_desc.TrimLeft ();
curStatus = _desc.ExtractChar ();
if ((curStatus == '0') ||
(curStatus == '1') ||
(curStatus == '2') ||
(curStatus == '3')
)
{
// We Are Ok
}
else
{
log.Level (-1) << endl
<< "ParameterJob: We have an invalid Cur Status."
<< endl;
osWaitForEnter ();
}
{
String processsNumField = _desc.ExtractToken (" ,\t");
processNum = atoi (processsNumField.Str ());
}
{
String jobIdField = _desc.ExtractToken (" ,\t");
jobId = atoi (jobIdField.Str ());
}
{
String cParmStr = _desc.ExtractToken (" ,\t");
cParm = atoi (cParmStr.Str ());
}
{
String gammaParmStr = _desc.ExtractToken (" ,\t");
gammaParm = atof (gammaParmStr.Str ());
}
{
String aParmStr = _desc.ExtractToken (" ,\t");
aParm = atoi (aParmStr.Str ());
}
{
String accuracyField = _desc.ExtractToken (" ,\t");
accuracy = atof (accuracyField.Str ());
}
}
示例2: log
ParameterProcess::ParameterProcess (RunLog& _log,
ImageClassList& imageClasses,
String _desc
):
log (_log)
{
highestAccuracy = (FFLOAT)0.0;
startTime = 0;
_desc.TrimLeft ();
curStatus = _desc.ExtractChar ();
if ((curStatus == '0') ||
(curStatus == '1') ||
(curStatus == '2')
)
{
// We Are Ok
}
else
{
log.Level (-1) << endl
<< "ParameterProcess: We have an invalid Cur Status[" << curStatus << "]."
<< endl;
exit (-1);
}
{
String processsNumField = _desc.ExtractToken (" ,\t");
processNum = atoi (processsNumField.Str ());
}
{
String jobIdField = _desc.ExtractToken (" ,\t");
jobId = atoi (jobIdField.Str ());
}
{
// Lets get the two Classes that we are running for
String class0Name = _desc.ExtractToken (" ,\t");
String class1Name = _desc.ExtractToken (" ,\t");
if (class0Name == "NoName")
{
class0 = class1 = NULL;
}
else
{
class0 = imageClasses.LookUpByName (class0Name);
class1 = imageClasses.LookUpByName (class1Name);
if (!class0)
{
cerr << endl
<< "*** ERROR *** ParameterProcess, Invalid Class0[" << class0Name << "]." << endl
<< endl;
exit (-1);
}
if (!class1)
{
cerr << endl
<< "*** ERROR *** ParameterProcess, Invalid Class0[" << class1Name << "]." << endl
<< endl;
exit (-1);
}
}
}
{
String cParmStr = _desc.ExtractToken (" ,\t");
cParm = atoi (cParmStr.Str ());
}
{
String gammaParmStr = _desc.ExtractToken (" ,\t");
gammaParm = atof (gammaParmStr.Str ());
}
{
String aParmStr = _desc.ExtractToken (" ,\t");
aParm = atoi (aParmStr.Str ());
}
{
String highestAccuracyField = _desc.ExtractToken (" ,\t");
highestAccuracy = (FFLOAT)atof (highestAccuracyField.Str ());
}
}