diff --git a/indexer/feature_utils.cpp b/indexer/feature_utils.cpp index 7ba86bf400..89e836780a 100644 --- a/indexer/feature_utils.cpp +++ b/indexer/feature_utils.cpp @@ -464,6 +464,12 @@ string GetReadableWheelchairType(TypesHolder const & types) return readableTypes[0]; } +ftraits::WheelchairAvailability GetWheelchairType(TypesHolder const & types) +{ + auto const opt = ftraits::Wheelchair::GetValue(types); + return opt ? *opt : ftraits::WheelchairAvailability::No; +} + bool HasAtm(TypesHolder const & types) { auto const & isAtmType = ftypes::IsATMChecker::Instance(); diff --git a/indexer/feature_utils.hpp b/indexer/feature_utils.hpp index c62bae61ff..06c5751815 100644 --- a/indexer/feature_utils.hpp +++ b/indexer/feature_utils.hpp @@ -3,6 +3,8 @@ #include #include +#include "indexer/ftraits.hpp" + struct FeatureID; class StringUtf8Multilang; @@ -10,6 +12,7 @@ namespace feature { static constexpr uint8_t kMaxStarsCount = 7; static constexpr std::string_view kFieldsSeparator = " • "; + static constexpr std::string_view kWheelchairSymbol = "♿️"; // Address house numbers interpolation. enum class InterpolType { None, Odd, Even, Any }; @@ -134,6 +137,9 @@ namespace feature // Returns readable wheelchair type. std::string GetReadableWheelchairType(TypesHolder const & types); + + /// @returns wheelchair availability. + ftraits::WheelchairAvailability GetWheelchairType(TypesHolder const & types); /// Returns true if feature has ATM type. bool HasAtm(TypesHolder const & types); diff --git a/indexer/map_object.cpp b/indexer/map_object.cpp index dc7d48ebd8..e5c76b023e 100644 --- a/indexer/map_object.cpp +++ b/indexer/map_object.cpp @@ -203,12 +203,6 @@ int MapObject::GetStars() const return count; } -ftraits::WheelchairAvailability MapObject::GetWheelchairType() const -{ - auto const opt = ftraits::Wheelchair::GetValue(m_types); - return opt ? *opt : ftraits::WheelchairAvailability::No; -} - bool MapObject::IsPointType() const { return m_geomType == feature::GeomType::Point; } bool MapObject::IsBuilding() const { return ftypes::IsBuildingChecker::Instance()(m_types); } bool MapObject::IsPublicTransportStop() const { return ftypes::IsPublicTransportStopChecker::Instance()(m_types); } diff --git a/indexer/map_object.hpp b/indexer/map_object.hpp index 5778f24360..21089eb388 100644 --- a/indexer/map_object.hpp +++ b/indexer/map_object.hpp @@ -97,7 +97,6 @@ public: std::string_view GetOpeningHours() const; Internet GetInternet() const; int GetStars() const; - ftraits::WheelchairAvailability GetWheelchairType() const; /// @returns true if feature has ATM type. bool HasAtm() const; diff --git a/map/place_page_info.cpp b/map/place_page_info.cpp index 4fdeab5090..b0ca81749d 100644 --- a/map/place_page_info.cpp +++ b/map/place_page_info.cpp @@ -19,7 +19,6 @@ namespace place_page { -static constexpr std::string_view kWheelchairSymbol = "♿️"; static constexpr std::string_view kAtmSymbol = "💳"; bool Info::IsBookmark() const @@ -188,8 +187,8 @@ std::string Info::FormatSubtitle(bool withType) const append(kToiletsSymbol); // Wheelchair - if (GetWheelchairType() == ftraits::WheelchairAvailability::Yes) - append(kWheelchairSymbol); + if (feature::GetWheelchairType(m_types) == ftraits::WheelchairAvailability::Yes) + append(feature::kWheelchairSymbol); // Fee. auto const fee = GetLocalizedFeeType();