本文整理汇总了C++中st::string::isinlist方法的典型用法代码示例。如果您正苦于以下问题:C++ string::isinlist方法的具体用法?C++ string::isinlist怎么用?C++ string::isinlist使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类st::string
的用法示例。
在下文中一共展示了string::isinlist方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parse
//.........这里部分代码省略.........
out(errormessages);
}
else
{
logfileopen = false;
logout.close();
out("NOTE: logfile " + logfilepath + " closed\n");
}
return false;
} // end: logclose
else if (firsttoken == "drop")
{
modelStandard m;
optionlist dropoptions;
usePathWrite uw;
command drop("drop",&m,&dropoptions,&uw,required,notallowed,
notallowed,notallowed,notallowed,notallowed);
drop.parse(in);
errormessages = drop.geterrormessages();
vector<ST::string> objectnames = m.getModelVarnamesAsVector();
if (objectnames.size() == 0)
errormessages.push_back("ERROR: objectlist required\n");
if (errormessages.empty())
{
int j;
for (j=0;j<objectnames.size();j++)
{
int recognized = 0;
int i=0;
while ( (i < objects.size()) && (recognized == 0) )
{
if ( objectnames[j] == objects[i]->getname())
{
ST::string type = objects[i]->gettype();
dropobjects(objectnames[j],type);
recognized = 1;
}
i++;
}
if (recognized == 0)
errormessages.push_back(
"ERROR: object " + objectnames[j] + " is not existing\n");
} // end: for (j=0;j<objectnames.size();j++)
} // end: if (errormessages.empty())
out(errormessages);
return false;
} // end: drop
else if (firsttoken.isinlist(objecttyps) >= 0) // create a new object
{
if (pointpos == -1)
objectname = create(in);
else
objectname = create(in.substr(0,pointpos));
if ( (errormessages.empty()) && (pointpos > 0) )
{
if (in.length()-1-pointpos <= 0)
errormessages.push_back("ERROR: invalid syntax\n");
else
parseexisting(objectname,in.substr(pointpos+1,in.length()-1-pointpos));
}
out(errormessages);
return false;
} // end: create a new object
else // existing object
{
if (pointpos != firsttoken.length())
errormessages.push_back("ERROR: invalid syntax\n");
else
if (in.length() > pointpos+1)
parseexisting(firsttoken,in.substr(pointpos+1,in.length()-pointpos-1));
else
errormessages.push_back("ERROR: invalid syntax\n");
out(errormessages);
return false;
}
} // end: if (firsttoken.length() > 0)
else // empty command
return false;
}