20 this->profile = profile;
21 this->tags = std::map<std::string, std::string>();
28 return this->profile == profile;
38int ExtraTags::asInt(std::string tag,
bool *r_ok)
40 if (tags.find(tag) == tags.end()) {
45 return atoi(tags[tag].c_str());
48float ExtraTags::asFloat(std::string tag,
bool *r_ok)
50 if (tags.find(tag) == tags.end()) {
55 return float(atof(tags[tag].c_str()));
58std::string ExtraTags::asString(std::string tag,
bool *r_ok)
60 if (tags.find(tag) == tags.end()) {
71 int tmp = asInt(tag, &ok);
81 int tmp = asInt(tag, &ok);
91 float tmp = asFloat(tag, &ok);
101 int tmp = asInt(tag, &ok);
111 std::string tmp = asString(tag, &ok);
112 return (ok) ? tmp :
data;
118 const std::string value = asString(tag, &ok);
120 return std::vector<std::string>();
123 std::vector<std::string> values;
125 const std::regex newline_re(
"[^\\s][^\\r\\n]+");
126 const std::sregex_token_iterator end;
127 std::sregex_token_iterator iter(value.begin(), value.end(), newline_re);
128 for (; iter != end; iter++) {
129 values.push_back(*iter);
draw_view in_light_buf[] float