MCPcopy Create free account
hub / github.com/comaps/comaps / ValidateFlats

Method ValidateFlats

libs/indexer/editable_map_object.cpp:515–534  ·  view source on GitHub ↗

static

Source from the content-addressed store, hash-verified

513
514// static
515bool EditableMapObject::ValidateFlats(string const & flats)
516{
517 if (strings::CountChar(flats) > kMaximumOsmChars)
518 return false;
519
520 for (auto it = strings::SimpleTokenizer(flats, ";"); it; ++it)
521 {
522 string_view token = *it;
523 strings::Trim(token);
524
525 auto range = strings::Tokenize(token, "-");
526 if (range.empty() || range.size() > 2)
527 return false;
528
529 for (auto const & rangeBorder : range)
530 if (!all_of(begin(rangeBorder), end(rangeBorder), ::isalnum))
531 return false;
532 }
533 return true;
534}
535
536// static
537bool EditableMapObject::ValidatePostCode(string const & postCode)

Callers

nothing calls this directly

Calls 8

CountCharFunction · 0.85
SimpleTokenizerClass · 0.85
TrimFunction · 0.85
TokenizeFunction · 0.50
beginFunction · 0.50
endFunction · 0.50
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected