本文整理汇总了C++中StringTokenizer::hasMoreTokens方法的典型用法代码示例。如果您正苦于以下问题:C++ StringTokenizer::hasMoreTokens方法的具体用法?C++ StringTokenizer::hasMoreTokens怎么用?C++ StringTokenizer::hasMoreTokens使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringTokenizer
的用法示例。
在下文中一共展示了StringTokenizer::hasMoreTokens方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: inFailList
bool inFailList(int s){
StringTokenizer strtok = StringTokenizer(src,",");
while(strtok.hasMoreTokens()){
string cur = strtok.nextToken();
int c = atoi(cur.c_str());
if(c==s) return true;
}
return false;
}
示例2: checkNumberTokens
void Tree::checkNumberTokens( StringTokenizer& str, const int& n,
const string& tag, const int& ln )
{
if( n != str.countTokens() )
{
cerr << "The input-file seems corrupt for the " << Node::getAlphabetName() << " alphabet, line: " << ln << endl << tag << " ";
cerr << "Line has " << str.countTokens()+1 << " space separated words, should have: " << n + 1 << endl;
while( str.hasMoreTokens() )cout << str.nextToken() << " ";
cout << endl;
exit( 2 ); // THROW EXCEPTION!!
}
}
示例3: StringTokenizer
gdx_cpp::files::FileHandle& TileAtlas::getRelativeFileHandle (const gdx_cpp::files::FileHandle& path,const std::string& relativePath) {
if (relativePath.trim().length() == 0) {
return path;
}
FileHandle child = path;
StringTokenizer tokenizer = new StringTokenizer(relativePath, "\\/");
while (tokenizer.hasMoreTokens()) {
String token = tokenizer.nextToken();
if (token.equals("..")) {
child = child.parent();
} else {
child = child.child(token);
}
}
return child;
}
示例4: theGuard
void
AVT::nextToken(
StylesheetConstructionContext& constructionContext,
const LocatorType* locator,
StringTokenizer& tokenizer,
XalanDOMString& token)
{
if (tokenizer.hasMoreTokens() == false)
{
GetCachedString theGuard(constructionContext);
constructionContext.error(
XalanMessageLoader::getMessage(
theGuard.get(),
XalanMessages::AttributeValueTemplateHasMissing),
0,
locator);
}
else
{
tokenizer.nextToken(token);
}
}