18 this->profile = profile;
19 this->tags = std::map<std::string, std::string>();
26 return this->profile == profile;
36int ExtraTags::asInt(std::string tag,
bool *r_ok)
38 if (tags.find(tag) == tags.end()) {
43 return atoi(tags[tag].c_str());
46float ExtraTags::asFloat(std::string tag,
bool *r_ok)
48 if (tags.find(tag) == tags.end()) {
53 return float(atof(tags[tag].c_str()));
56std::string ExtraTags::asString(std::string tag,
bool *r_ok)
58 if (tags.find(tag) == tags.end()) {
69 int tmp = asInt(tag, &ok);
79 int tmp = asInt(tag, &ok);
89 float tmp = asFloat(tag, &ok);
99 int tmp = asInt(tag, &ok);
109 std::string tmp = asString(tag, &ok);
110 return (ok) ? tmp :
data;
116 const std::string value = asString(tag, &ok);
118 return std::vector<std::string>();
121 std::vector<std::string> values;
123 const std::regex newline_re(
"[^\\s][^\\r\\n]+");
124 const std::sregex_token_iterator end;
125 std::sregex_token_iterator iter(value.begin(), value.end(), newline_re);
126 for (; iter != end; iter++) {
127 values.push_back(*iter);
BMesh const char void * data