static
| 513 | |
| 514 | // static |
| 515 | bool 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 |
| 537 | bool EditableMapObject::ValidatePostCode(string const & postCode) |