MCPcopy Create free account
hub / github.com/LAStools/LAStools / ValueSubStr

Method ValueSubStr

src/wktparser.cpp:302–316  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

300}
301
302std::string WktParser::ValueSubStr(const std::string& key, const std::string sub, const std::string def) {
303 std::string keylc = BOOST_PRE to_lower_copy(key);
304 std::string subcc = BOOST_PRE to_lower_copy(sub);
305 auto range = map.equal_range(keylc);
306 for (auto item = range.first; item != range.second; ++item) {
307 std::string val = item->second;
308 std::string out;
309 if (GetTokenNext(val, "|", out) && (BOOST_PRE to_lower_copy(out).compare(sub) == 0)) {
310 if (GetTokenNext(val, "|", out)) {
311 return out;
312 }
313 }
314 }
315 return def;
316}
317
318int WktParser::ValueSubInt(const std::string& key, const std::string sub, const int def) {
319 std::string res = ValueSubStr(key, sub);

Callers

nothing calls this directly

Calls 2

to_lower_copyFunction · 0.85
GetTokenNextFunction · 0.85

Tested by

no test coverage detected