本文整理汇总了C++中StringBijection::hasString方法的典型用法代码示例。如果您正苦于以下问题:C++ StringBijection::hasString方法的具体用法?C++ StringBijection::hasString怎么用?C++ StringBijection::hasString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringBijection
的用法示例。
在下文中一共展示了StringBijection::hasString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sta
SVCPermissions
parseVehicleClasses(const std::string& allowedS) {
if (allowedS == "all") {
return SVCAll;
}
// check if allowedS was previously cached
if (parseVehicleClassesCached.count(allowedS) == 0) {
SVCPermissions result = 0;
StringTokenizer sta(allowedS, " ");
while (sta.hasNext()) {
const std::string s = sta.next();
if (!SumoVehicleClassStrings.hasString(s)) {
WRITE_ERROR("Unknown vehicle class '" + s + "' encountered.");
} else {
const SUMOVehicleClass vc = getVehicleClassID(s);
const std::string& realName = SumoVehicleClassStrings.getString(vc);
if (realName != s) {
deprecatedVehicleClassesSeen.insert(s);
}
result |= vc;
}
}
// save parsed vehicle class cached
parseVehicleClassesCached[allowedS] = result;
}
return parseVehicleClassesCached.at(allowedS);
}
示例2: InvalidArgument
SUMOVehicleClass
getVehicleClassID(const std::string& name) {
if (SumoVehicleClassStrings.hasString(name)) {
return SumoVehicleClassStrings.get(name);
}
throw InvalidArgument("Unknown vehicle class '" + name + "'.");
}
示例3:
int
NWWriter_OpenDrive::getID(const std::string& origID, StringBijection<int>& map, int& lastID) {
if (map.hasString(origID)) {
return map.get(origID);
}
map.insert(origID, lastID++);
return lastID - 1;
}
示例4: sta
bool
canParseVehicleClasses(const std::string& classes) {
if (classes == "all") {
return true;
}
StringTokenizer sta(classes, " ");
while (sta.hasNext()) {
if (!SumoVehicleClassStrings.hasString(sta.next())) {
return false;
}
}
return true;
}
示例5:
bool
canParseVehicleShape(const std::string& shape) {
return SumoVehicleShapeStrings.hasString(shape);
}