static
| 482 | |
| 483 | // static |
| 484 | bool EditableMapObject::ValidateHouseNumber(string const & houseNumber) |
| 485 | { |
| 486 | // TODO(mgsergio): Use LooksLikeHouseNumber! |
| 487 | |
| 488 | if (houseNumber.empty()) |
| 489 | return true; |
| 490 | |
| 491 | strings::UniString us = strings::MakeUniString(houseNumber); |
| 492 | // TODO: Improve this basic limit - it was choosen by @Zverik. |
| 493 | auto constexpr kMaxHouseNumberLength = 15; |
| 494 | if (us.size() > kMaxHouseNumberLength) |
| 495 | return false; |
| 496 | |
| 497 | // TODO: Should we allow arabic numbers like U+0661 ١ Arabic-Indic Digit One? |
| 498 | strings::NormalizeDigits(us); |
| 499 | for (auto const c : us) |
| 500 | { |
| 501 | // Valid house numbers contain at least one digit. |
| 502 | if (strings::IsASCIIDigit(c)) |
| 503 | return true; |
| 504 | } |
| 505 | return false; |
| 506 | } |
| 507 | |
| 508 | bool EditableMapObject::CheckHouseNumberWhenIsAddress() const |
| 509 | { |
nothing calls this directly
no test coverage detected