本文整理汇总了C++中StringBijection::getString方法的典型用法代码示例。如果您正苦于以下问题:C++ StringBijection::getString方法的具体用法?C++ StringBijection::getString怎么用?C++ StringBijection::getString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringBijection
的用法示例。
在下文中一共展示了StringBijection::getString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: getVehicleClassID
SVCPermissions
parseVehicleClasses(const std::vector<std::string>& allowedS) {
SVCPermissions result = 0;
for (std::vector<std::string>::const_iterator i = allowedS.begin(); i != allowedS.end(); ++i) {
const SUMOVehicleClass vc = getVehicleClassID(*i);
const std::string& realName = SumoVehicleClassStrings.getString(vc);
if (realName != *i) {
WRITE_WARNING("The vehicle class '" + (*i) + "' is deprecated, use '" + realName + "' instead.");
}
result |= getVehicleClassID(*i);
}
return result;
}
示例3: sta
SVCPermissions
parseVehicleClasses(const std::string& allowedS) {
if (allowedS == "all") {
return SVCAll;
}
SVCPermissions result = 0;
StringTokenizer sta(allowedS, " ");
while (sta.hasNext()) {
const std::string s = sta.next();
const SUMOVehicleClass vc = getVehicleClassID(s);
const std::string& realName = SumoVehicleClassStrings.getString(vc);
if (realName != s) {
deprecatedVehicleClassesSeen.insert(s);
}
result |= vc;
}
return result;
}
示例4:
std::string
getVehicleShapeName(SUMOVehicleShape id) {
return SumoVehicleShapeStrings.getString(id);
}