WIP: [3party] Integrate magic_enum lib #9479
171 changed files with 243 additions and 1959 deletions
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -62,3 +62,6 @@
|
|||
[submodule "3party/utfcpp"]
|
||||
path = 3party/utfcpp
|
||||
url = https://github.com/nemtrif/utfcpp.git
|
||||
[submodule "3party/magic_enum"]
|
||||
path = 3party/magic_enum
|
||||
url = https://github.com/Neargye/magic_enum.git
|
||||
|
|
|
@ -57,6 +57,7 @@ endif()
|
|||
|
||||
add_subdirectory(agg)
|
||||
add_subdirectory(bsdiff-courgette)
|
||||
add_subdirectory(magic_enum)
|
||||
add_subdirectory(minizip)
|
||||
add_subdirectory(open-location-code)
|
||||
add_subdirectory(opening_hours)
|
||||
|
|
1
3party/magic_enum
Submodule
1
3party/magic_enum
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 126539e13cccdc2e75ce770e94f3c26403099fa5
|
|
@ -143,13 +143,13 @@ Java_app_organicmaps_editor_Editor_nativeGetMaxEditableBuildingLevels(JNIEnv *,
|
|||
JNIEXPORT jboolean JNICALL
|
||||
Java_app_organicmaps_editor_Editor_nativeHasWifi(JNIEnv *, jclass)
|
||||
{
|
||||
return g_editableMapObject.GetInternet() == feature::Internet::Wlan;
|
||||
return g_editableMapObject.GetInternet() == feature::Internet::wlan;
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_app_organicmaps_editor_Editor_nativeSetHasWifi(JNIEnv *, jclass, jboolean hasWifi)
|
||||
{
|
||||
g_editableMapObject.SetInternet(hasWifi ? feature::Internet::Wlan : feature::Internet::Unknown);
|
||||
g_editableMapObject.SetInternet(hasWifi ? feature::Internet::wlan : feature::Internet::Unknown);
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL
|
||||
|
|
|
@ -108,7 +108,7 @@ omim_add_library(${PROJECT_NAME} ${SRC})
|
|||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
find_package(Threads REQUIRED)
|
||||
target_link_libraries(${PROJECT_NAME} INTERFACE Threads::Threads)
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC utf8cpp::utf8cpp)
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC utf8cpp::utf8cpp magic_enum::magic_enum)
|
||||
|
||||
if (NOT WITH_SYSTEM_PROVIDED_3PARTY)
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE "${OMIM_ROOT}/3party/fast_double_parser/include")
|
||||
|
|
|
@ -15,33 +15,33 @@ UNIT_TEST(GeoObjectId_Smoke)
|
|||
GeoObjectId const node(GeoObjectId::Type::ObsoleteOsmNode, 12345);
|
||||
TEST_EQUAL(node.GetSerialId(), 12345ULL, ());
|
||||
TEST_EQUAL(node.GetType(), GeoObjectId::Type::ObsoleteOsmNode, ());
|
||||
TEST_EQUAL(DebugPrint(node), "Osm Node 12345", ());
|
||||
TEST_EQUAL(DebugPrint(node), "ObsoleteOsmNode 12345", ());
|
||||
|
||||
GeoObjectId const way(GeoObjectId::Type::ObsoleteOsmWay, 93245123456332ULL);
|
||||
TEST_EQUAL(way.GetSerialId(), 93245123456332ULL, ());
|
||||
TEST_EQUAL(way.GetType(), GeoObjectId::Type::ObsoleteOsmWay, ());
|
||||
TEST_EQUAL(DebugPrint(way), "Osm Way 93245123456332", ());
|
||||
TEST_EQUAL(DebugPrint(way), "ObsoleteOsmWay 93245123456332", ());
|
||||
|
||||
GeoObjectId const relation(GeoObjectId::Type::ObsoleteOsmRelation, 5);
|
||||
TEST_EQUAL(relation.GetSerialId(), 5ULL, ());
|
||||
TEST_EQUAL(relation.GetType(), GeoObjectId::Type::ObsoleteOsmRelation, ());
|
||||
TEST_EQUAL(DebugPrint(relation), "Osm Relation 5", ());
|
||||
TEST_EQUAL(DebugPrint(relation), "ObsoleteOsmRelation 5", ());
|
||||
|
||||
// 2^48 - 1, maximal possible serial id.
|
||||
GeoObjectId const surrogate(GeoObjectId::Type::OsmSurrogate, 281474976710655ULL);
|
||||
TEST_EQUAL(surrogate.GetSerialId(), 281474976710655ULL, ());
|
||||
TEST_EQUAL(surrogate.GetType(), GeoObjectId::Type::OsmSurrogate, ());
|
||||
TEST_EQUAL(DebugPrint(surrogate), "Osm Surrogate 281474976710655", ());
|
||||
TEST_EQUAL(DebugPrint(surrogate), "OsmSurrogate 281474976710655", ());
|
||||
|
||||
// 0 is not prohibited by the encoding even though OSM ids start from 1.
|
||||
GeoObjectId const booking(GeoObjectId::Type::BookingComNode, 0);
|
||||
TEST_EQUAL(booking.GetSerialId(), 0, ());
|
||||
TEST_EQUAL(booking.GetType(), GeoObjectId::Type::BookingComNode, ());
|
||||
TEST_EQUAL(DebugPrint(booking), "Booking.com 0", ());
|
||||
TEST_EQUAL(DebugPrint(booking), "BookingComNode 0", ());
|
||||
|
||||
GeoObjectId const fias(GeoObjectId::Type::Fias, 0xf1a5);
|
||||
GeoObjectId const fias(GeoObjectId::Type::FIAS, 0xf1a5);
|
||||
TEST_EQUAL(fias.GetSerialId(), 0xf1a5, ());
|
||||
TEST_EQUAL(fias.GetType(), GeoObjectId::Type::Fias, ());
|
||||
TEST_EQUAL(fias.GetType(), GeoObjectId::Type::FIAS, ());
|
||||
TEST_EQUAL(DebugPrint(fias), "FIAS 61861", ());
|
||||
}
|
||||
|
||||
|
|
|
@ -48,15 +48,4 @@ void Cancellable::CheckDeadline() const
|
|||
m_status = Status::DeadlineExceeded;
|
||||
}
|
||||
}
|
||||
|
||||
std::string DebugPrint(Cancellable::Status status)
|
||||
{
|
||||
switch (status)
|
||||
{
|
||||
case Cancellable::Status::Active: return "Active";
|
||||
case Cancellable::Status::CancelCalled: return "CancelCalled";
|
||||
case Cancellable::Status::DeadlineExceeded: return "DeadlineExceeded";
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
} // namespace base
|
||||
|
|
|
@ -51,6 +51,4 @@ private:
|
|||
|
||||
std::optional<std::chrono::steady_clock::time_point> m_deadline;
|
||||
};
|
||||
|
||||
std::string DebugPrint(Cancellable::Status status);
|
||||
} // namespace base
|
||||
|
|
|
@ -43,7 +43,7 @@ GeoObjectId::Type GeoObjectId::GetType() const
|
|||
case 0x03: return Type::OsmRelation;
|
||||
case 0x04: return Type::BookingComNode;
|
||||
case 0x05: return Type::OsmSurrogate;
|
||||
case 0x06: return Type::Fias;
|
||||
case 0x06: return Type::FIAS;
|
||||
case 0x40: return Type::ObsoleteOsmNode;
|
||||
case 0x80: return Type::ObsoleteOsmWay;
|
||||
case 0xC0: return Type::ObsoleteOsmRelation;
|
||||
|
@ -80,29 +80,11 @@ std::istream & operator>>(std::istream & os, GeoObjectId & geoObjectId)
|
|||
return os;
|
||||
}
|
||||
|
||||
std::string DebugPrint(GeoObjectId::Type const & t)
|
||||
{
|
||||
switch (t)
|
||||
{
|
||||
case GeoObjectId::Type::Invalid: return "Invalid";
|
||||
case GeoObjectId::Type::OsmNode: return "Osm Node";
|
||||
case GeoObjectId::Type::OsmWay: return "Osm Way";
|
||||
case GeoObjectId::Type::OsmRelation: return "Osm Relation";
|
||||
case GeoObjectId::Type::BookingComNode: return "Booking.com";
|
||||
case GeoObjectId::Type::OsmSurrogate: return "Osm Surrogate";
|
||||
case GeoObjectId::Type::Fias: return "FIAS";
|
||||
case GeoObjectId::Type::ObsoleteOsmNode: return "Osm Node";
|
||||
case GeoObjectId::Type::ObsoleteOsmWay: return "Osm Way";
|
||||
case GeoObjectId::Type::ObsoleteOsmRelation: return "Osm Relation";
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
std::string DebugPrint(GeoObjectId const & id)
|
||||
{
|
||||
std::ostringstream oss;
|
||||
// GetSerialId() does not work for invalid ids but we may still want to print them.
|
||||
oss << DebugPrint(id.GetType()) << " " << (id.GetEncodedId() & kSerialMask);
|
||||
oss << ::DebugPrint(id.GetType()) << " " << (id.GetEncodedId() & kSerialMask);
|
||||
return oss.str();
|
||||
}
|
||||
} // namespace base
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
#include <iosfwd>
|
||||
#include <string>
|
||||
|
||||
#include "magic_enum.hpp"
|
||||
|
||||
namespace base
|
||||
{
|
||||
// GeoObjectId is used to pack the source of a geographical object together with its
|
||||
|
@ -51,7 +53,7 @@ public:
|
|||
OsmSurrogate = 0x05,
|
||||
|
||||
// Federal informational address system. http://www.ifias.ru/
|
||||
Fias = 0x06,
|
||||
FIAS = 0x06,
|
||||
|
||||
ObsoleteOsmNode = 0x40,
|
||||
ObsoleteOsmWay = 0x80,
|
||||
|
@ -89,7 +91,6 @@ GeoObjectId MakeOsmNode(uint64_t id);
|
|||
GeoObjectId MakeOsmWay(uint64_t id);
|
||||
GeoObjectId MakeOsmRelation(uint64_t id);
|
||||
|
||||
std::string DebugPrint(GeoObjectId::Type const & t);
|
||||
std::string DebugPrint(GeoObjectId const & id);
|
||||
} // namespace base
|
||||
|
||||
|
@ -105,3 +106,10 @@ struct hash<base::GeoObjectId>
|
|||
}
|
||||
};
|
||||
} // namespace std
|
||||
|
||||
template <>
|
||||
struct magic_enum::customize::enum_range<base::GeoObjectId::Type>
|
||||
{
|
||||
static constexpr int min = static_cast<const int>(base::GeoObjectId::Type::Invalid);
|
||||
static constexpr int max = static_cast<const int>(base::GeoObjectId::Type::ObsoleteOsmRelation);
|
||||
};
|
||||
|
|
|
@ -20,8 +20,11 @@
|
|||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "magic_enum.hpp"
|
||||
|
||||
/// @name Declarations.
|
||||
//@{
|
||||
|
||||
template <typename T> inline std::string DebugPrint(T const & t);
|
||||
|
||||
inline std::string DebugPrint(std::string s) { return s; }
|
||||
|
@ -51,8 +54,25 @@ template <class Key, class Hash = std::hash<Key>, class Pred = std::equal_to<Key
|
|||
inline std::string DebugPrint(std::unordered_set<Key, Hash, Pred> const & v);
|
||||
template <class Key, class T, class Hash = std::hash<Key>, class Pred = std::equal_to<Key>>
|
||||
inline std::string DebugPrint(std::unordered_map<Key, T, Hash, Pred> const & v);
|
||||
|
||||
template <class EnumT>
|
||||
requires std::is_enum_v<EnumT>
|
||||
inline std::string DebugPrint(EnumT const & value);
|
||||
//@}
|
||||
|
||||
template <class EnumT>
|
||||
requires std::is_enum_v<EnumT>
|
||||
inline std::string DebugPrint(EnumT const & value)
|
||||
{
|
||||
const auto str = magic_enum::enum_name(value);
|
||||
if (str.empty())
|
||||
{
|
||||
return std::string{magic_enum::enum_type_name<EnumT>()} + "(" +
|
||||
std::to_string(magic_enum::enum_integer(value)) + ")";
|
||||
}
|
||||
return std::string{str};
|
||||
}
|
||||
|
||||
template <typename T> inline std::string DebugPrint(T const & t)
|
||||
{
|
||||
std::ostringstream out;
|
||||
|
|
|
@ -8,12 +8,12 @@
|
|||
|
||||
#if SRC_LOGGING
|
||||
#ifndef __OBJC__
|
||||
#define SRC() base::SrcPoint(__FILE__, __LINE__, __FUNCTION__, "()")
|
||||
#define SRC() ::base::SrcPoint(__FILE__, __LINE__, __FUNCTION__, "()")
|
||||
#else
|
||||
#define SRC() base::SrcPoint(__FILE__, __LINE__, __FUNCTION__)
|
||||
#define SRC() ::base::SrcPoint(__FILE__, __LINE__, __FUNCTION__)
|
||||
#endif
|
||||
#else
|
||||
#define SRC() base::SrcPoint()
|
||||
#define SRC() ::base::SrcPoint()
|
||||
#endif
|
||||
|
||||
namespace base
|
||||
|
|
|
@ -241,15 +241,3 @@ DayTimeType GetDayTime(time_t timeUtc, double latitude, double longitude)
|
|||
|
||||
return DayTimeType::Day;
|
||||
}
|
||||
|
||||
std::string DebugPrint(DayTimeType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DayTimeType::Day: return "Day";
|
||||
case DayTimeType::Night: return "Night";
|
||||
case DayTimeType::PolarDay: return "PolarDay";
|
||||
case DayTimeType::PolarNight: return "PolarNight";
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
|
|
@ -11,8 +11,6 @@ enum class DayTimeType
|
|||
PolarNight
|
||||
};
|
||||
|
||||
std::string DebugPrint(DayTimeType type);
|
||||
|
||||
/// Helpers which calculates 'is day time' without a time calculation error.
|
||||
/// @param timeUtc - utc time
|
||||
/// @param latitude - latutude, -90...+90 degrees
|
||||
|
|
|
@ -63,17 +63,4 @@ private:
|
|||
std::mutex m_mutex;
|
||||
std::condition_variable m_event;
|
||||
};
|
||||
|
||||
inline std::string DebugPrint(Waiter::Result result)
|
||||
{
|
||||
switch (result)
|
||||
{
|
||||
case Waiter::Result::PreviouslyNotified: return "PreviouslyNotified";
|
||||
case Waiter::Result::NoTimeout: return "NoTimeout";
|
||||
case Waiter::Result::Timeout: return "Timeout";
|
||||
default: ASSERT(false, ("Unsupported value"));
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
} // namespace base
|
||||
|
|
|
@ -462,16 +462,6 @@ unique_ptr<CompressedBitVector> CompressedBitVectorBuilder::FromBitGroups(
|
|||
return make_unique<SparseCBV>(setBits);
|
||||
}
|
||||
|
||||
std::string DebugPrint(CompressedBitVector::StorageStrategy strat)
|
||||
{
|
||||
switch (strat)
|
||||
{
|
||||
case CompressedBitVector::StorageStrategy::Dense: return "Dense";
|
||||
case CompressedBitVector::StorageStrategy::Sparse: return "Sparse";
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
// static
|
||||
unique_ptr<CompressedBitVector> CompressedBitVector::Intersect(CompressedBitVector const & lhs,
|
||||
CompressedBitVector const & rhs)
|
||||
|
|
|
@ -84,8 +84,6 @@ public:
|
|||
virtual std::unique_ptr<CompressedBitVector> Clone() const = 0;
|
||||
};
|
||||
|
||||
std::string DebugPrint(CompressedBitVector::StorageStrategy strat);
|
||||
|
||||
class DenseCBV : public CompressedBitVector
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -89,19 +89,6 @@ public:
|
|||
virtual void Bind() = 0;
|
||||
};
|
||||
|
||||
inline std::string DebugPrint(dp::ApiVersion apiVersion)
|
||||
{
|
||||
switch (apiVersion)
|
||||
{
|
||||
case dp::ApiVersion::Invalid: return "Invalid";
|
||||
case dp::ApiVersion::OpenGLES2: return "OpenGLES2";
|
||||
case dp::ApiVersion::OpenGLES3: return "OpenGLES3";
|
||||
case dp::ApiVersion::Metal: return "Metal";
|
||||
case dp::ApiVersion::Vulkan: return "Vulkan";
|
||||
}
|
||||
return "Unknown";
|
||||
}
|
||||
|
||||
inline dp::ApiVersion ApiVersionFromString(std::string const & str)
|
||||
{
|
||||
#if defined(OMIM_METAL_AVAILABLE)
|
||||
|
|
|
@ -27,7 +27,7 @@ std::string DebugPrint(HWTexture::Params const & p)
|
|||
std::ostringstream ss;
|
||||
ss << "Width = " << p.m_width
|
||||
<< "; Height = " << p.m_height
|
||||
<< "; Format = " << DebugPrint(p.m_format)
|
||||
<< "; Format = " << ::DebugPrint(p.m_format)
|
||||
<< "; IsRenderTarget = " << p.m_isRenderTarget;
|
||||
return ss.str();
|
||||
}
|
||||
|
|
|
@ -16,22 +16,6 @@ enum class TextureFormat : uint8_t
|
|||
Unspecified
|
||||
};
|
||||
|
||||
inline std::string DebugPrint(TextureFormat tf)
|
||||
{
|
||||
switch (tf)
|
||||
{
|
||||
case TextureFormat::RGBA8: return "RGBA8";
|
||||
case TextureFormat::Alpha: return "Alpha";
|
||||
case TextureFormat::RedGreen: return "RedGreen";
|
||||
case TextureFormat::DepthStencil: return "DepthStencil";
|
||||
case TextureFormat::Depth: return "Depth";
|
||||
case TextureFormat::Unspecified: return "Unspecified";
|
||||
}
|
||||
|
||||
UNREACHABLE();
|
||||
return {};
|
||||
}
|
||||
|
||||
enum class TextureFilter : uint8_t
|
||||
{
|
||||
Nearest,
|
||||
|
|
|
@ -109,7 +109,6 @@ set(SRC
|
|||
map_data_provider.cpp
|
||||
map_data_provider.hpp
|
||||
map_shape.hpp
|
||||
message.cpp
|
||||
message.hpp
|
||||
message_acceptor.cpp
|
||||
message_acceptor.hpp
|
||||
|
|
|
@ -91,42 +91,4 @@ bool Animation::GetMaxDuration(Interpolator const & interpolator, double & maxDu
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string DebugPrint(Animation::Type const & type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case Animation::Type::Sequence: return "Sequence";
|
||||
case Animation::Type::Parallel: return "Parallel";
|
||||
case Animation::Type::MapLinear: return "MapLinear";
|
||||
case Animation::Type::MapScale: return "MapScale";
|
||||
case Animation::Type::MapFollow: return "MapFollow";
|
||||
case Animation::Type::Arrow: return "Arrow";
|
||||
case Animation::Type::KineticScroll: return "KineticScroll";
|
||||
}
|
||||
return "Unknown type";
|
||||
}
|
||||
|
||||
std::string DebugPrint(Animation::Object const & object)
|
||||
{
|
||||
switch (object)
|
||||
{
|
||||
case Animation::Object::MyPositionArrow: return "MyPositionArrow";
|
||||
case Animation::Object::MapPlane: return "MapPlane";
|
||||
case Animation::Object::Selection: return "Selection";
|
||||
}
|
||||
return "Unknown object";
|
||||
}
|
||||
|
||||
std::string DebugPrint(Animation::ObjectProperty const & property)
|
||||
{
|
||||
switch (property)
|
||||
{
|
||||
case Animation::ObjectProperty::Position: return "Position";
|
||||
case Animation::ObjectProperty::Scale: return "Scale";
|
||||
case Animation::ObjectProperty::Angle: return "Angle";
|
||||
}
|
||||
return "Unknown property";
|
||||
}
|
||||
|
||||
} // namespace df
|
||||
|
|
|
@ -154,10 +154,5 @@ protected:
|
|||
// Animation could be rewinded in case of finishing.
|
||||
bool m_couldBeRewinded;
|
||||
};
|
||||
|
||||
std::string DebugPrint(Animation::Type const & type);
|
||||
std::string DebugPrint(Animation::Object const & object);
|
||||
std::string DebugPrint(Animation::ObjectProperty const & property);
|
||||
|
||||
} // namespace df
|
||||
|
||||
|
|
|
@ -1673,7 +1673,7 @@ void FrontendRenderer::RenderUserMarksLayer(ScreenBase const & modelView, DepthL
|
|||
return;
|
||||
|
||||
CHECK(m_context != nullptr, ());
|
||||
DEBUG_LABEL(m_context, "User Marks: " + DebugPrint(layerId));
|
||||
DEBUG_LABEL(m_context, "User Marks: " + ::DebugPrint(layerId));
|
||||
m_context->Clear(dp::ClearBits::DepthBit, dp::kClearBitsStoreAll);
|
||||
|
||||
for (drape_ptr<RenderGroup> & group : renderGroups)
|
||||
|
|
|
@ -1,109 +0,0 @@
|
|||
#include "drape_frontend/message.hpp"
|
||||
|
||||
#include "base/assert.hpp"
|
||||
|
||||
namespace df
|
||||
{
|
||||
std::string DebugPrint(Message::Type msgType)
|
||||
{
|
||||
switch (msgType)
|
||||
{
|
||||
case Message::Type::Unknown: return "Unknown";
|
||||
case Message::Type::TileReadStarted: return "TileReadStarted";
|
||||
case Message::Type::TileReadEnded: return "TileReadEnded";
|
||||
case Message::Type::FinishReading: return "FinishReading";
|
||||
case Message::Type::FinishTileRead: return "FinishTileRead";
|
||||
case Message::Type::FlushTile: return "FlushTile";
|
||||
case Message::Type::FlushOverlays: return "FlushOverlays";
|
||||
case Message::Type::MapShapeReaded: return "MapShapeReaded";
|
||||
case Message::Type::OverlayMapShapeReaded: return "OverlayMapShapeReaded";
|
||||
case Message::Type::UpdateReadManager: return "UpdateReadManager";
|
||||
case Message::Type::InvalidateRect: return "InvalidateRect";
|
||||
case Message::Type::InvalidateReadManagerRect: return "InvalidateReadManagerRect";
|
||||
case Message::Type::UpdateUserMarkGroup: return "UpdateUserMarkGroup";
|
||||
case Message::Type::ClearUserMarkGroup: return "ClearUserMarkGroup";
|
||||
case Message::Type::ChangeUserMarkGroupVisibility: return "ChangeUserMarkGroupVisibility";
|
||||
case Message::Type::UpdateUserMarks: return "UpdateUserMarks";
|
||||
case Message::Type::InvalidateUserMarks: return "InvalidateUserMarks";
|
||||
case Message::Type::FlushUserMarks: return "FlushUserMarks";
|
||||
case Message::Type::GuiLayerRecached: return "GuiLayerRecached";
|
||||
case Message::Type::GuiRecache: return "GuiRecache";
|
||||
case Message::Type::GuiLayerLayout: return "GuiLayerLayout";
|
||||
case Message::Type::UpdateMyPositionRoutingOffset: return "UpdateMyPositionRoutingOffset";
|
||||
case Message::Type::MapShapesRecache: return "MapShapesRecache";
|
||||
case Message::Type::MapShapes: return "MapShapes";
|
||||
case Message::Type::ChangeMyPositionMode: return "ChangeMyPositionMode";
|
||||
case Message::Type::CompassInfo: return "CompassInfo";
|
||||
case Message::Type::GpsInfo: return "GpsInfo";
|
||||
case Message::Type::SelectObject: return "SelectObject";
|
||||
case Message::Type::CheckSelectionGeometry: return "CheckSelectionGeometry";
|
||||
case Message::Type::FlushSelectionGeometry: return "FlushSelectionGeometry";
|
||||
case Message::Type::AddSubroute: return "AddSubroute";
|
||||
case Message::Type::RemoveSubroute: return "RemoveSubroute";
|
||||
case Message::Type::PrepareSubrouteArrows: return "PrepareSubrouteArrows";
|
||||
case Message::Type::CacheSubrouteArrows: return "CacheSubrouteArrows";
|
||||
case Message::Type::FlushSubroute: return "FlushSubroute";
|
||||
case Message::Type::FlushSubrouteArrows: return "FlushSubrouteArrows";
|
||||
case Message::Type::FlushSubrouteMarkers: return "FlushSubrouteMarkers";
|
||||
case Message::Type::FollowRoute: return "FollowRoute";
|
||||
case Message::Type::DeactivateRouteFollowing: return "DeactivateRouteFollowing";
|
||||
case Message::Type::SetSubrouteVisibility: return "SetSubrouteVisibility";
|
||||
case Message::Type::AddRoutePreviewSegment: return "AddRoutePreviewSegment";
|
||||
case Message::Type::RemoveRoutePreviewSegment: return "RemoveRoutePreviewSegment";
|
||||
case Message::Type::UpdateMapStyle: return "UpdateMapStyle";
|
||||
case Message::Type::SwitchMapStyle: return "SwitchMapStyle";
|
||||
case Message::Type::Invalidate: return "Invalidate";
|
||||
case Message::Type::Allow3dMode: return "Allow3dMode";
|
||||
case Message::Type::Allow3dBuildings: return "Allow3dBuildings";
|
||||
case Message::Type::EnablePerspective: return "EnablePerspective";
|
||||
case Message::Type::FlushCirclesPack: return "FlushCirclesPack";
|
||||
case Message::Type::CacheCirclesPack: return "CacheCirclesPack";
|
||||
case Message::Type::UpdateGpsTrackPoints: return "UpdateGpsTrackPoints";
|
||||
case Message::Type::ClearGpsTrackPoints: return "ClearGpsTrackPoints";
|
||||
case Message::Type::ShowChoosePositionMark: return "ShowChoosePositionMark";
|
||||
case Message::Type::SetKineticScrollEnabled: return "SetKineticScrollEnabled";
|
||||
case Message::Type::BlockTapEvents: return "BlockTapEvents";
|
||||
case Message::Type::OnEnterForeground: return "OnEnterForeground";
|
||||
case Message::Type::SetAddNewPlaceMode: return "SetAddNewPlaceMode";
|
||||
case Message::Type::AllowAutoZoom: return "AllowAutoZoom";
|
||||
case Message::Type::RequestSymbolsSize: return "RequestSymbolsSize";
|
||||
case Message::Type::RecoverContextDependentResources: return "RecoverContextDependentResources";
|
||||
case Message::Type::SetVisibleViewport: return "SetVisibleViewport";
|
||||
case Message::Type::EnableTraffic: return "EnableTraffic";
|
||||
case Message::Type::FlushTrafficGeometry: return "FlushTrafficGeometry";
|
||||
case Message::Type::RegenerateTraffic: return "RegenerateTraffic";
|
||||
case Message::Type::UpdateTraffic: return "UpdateTraffic";
|
||||
case Message::Type::FlushTrafficData: return "FlushTrafficData";
|
||||
case Message::Type::ClearTrafficData: return "ClearTrafficData";
|
||||
case Message::Type::SetSimplifiedTrafficColors: return "SetSimplifiedTrafficColors";
|
||||
case Message::Type::DrapeApiAddLines: return "DrapeApiAddLines";
|
||||
case Message::Type::DrapeApiRemove: return "DrapeApiRemove";
|
||||
case Message::Type::DrapeApiFlush: return "DrapeApiFlush";
|
||||
case Message::Type::SetCustomFeatures: return "SetCustomFeatures";
|
||||
case Message::Type::RemoveCustomFeatures: return "RemoveCustomFeatures";
|
||||
case Message::Type::SetTrackedFeatures: return "SetTrackedFeatures";
|
||||
case Message::Type::SetPostprocessStaticTextures: return "SetPostprocessStaticTextures";
|
||||
case Message::Type::SetPosteffectEnabled: return "SetPosteffectEnabled";
|
||||
case Message::Type::RunFirstLaunchAnimation: return "RunFirstLaunchAnimation";
|
||||
case Message::Type::UpdateMetalines: return "UpdateMetalines";
|
||||
case Message::Type::PostUserEvent: return "PostUserEvent";
|
||||
case Message::Type::FinishTexturesInitialization: return "FinishTexturesInitialization";
|
||||
case Message::Type::CleanupTextures: return "CleanupTextures";
|
||||
case Message::Type::EnableDebugRectRendering: return "EnableDebugRectRendering";
|
||||
case Message::Type::EnableTransitScheme: return "EnableTransitScheme";
|
||||
case Message::Type::UpdateTransitScheme: return "UpdateTransitScheme";
|
||||
case Message::Type::ClearTransitSchemeData: return "ClearTransitSchemeData";
|
||||
case Message::Type::ClearAllTransitSchemeData: return "ClearAllTransitSchemeData";
|
||||
case Message::Type::RegenerateTransitScheme: return "RegenerateTransitScheme";
|
||||
case Message::Type::FlushTransitScheme: return "FlushTransitScheme";
|
||||
case Message::Type::ShowDebugInfo: return "ShowDebugInfo";
|
||||
case Message::Type::NotifyRenderThread: return "NotifyRenderThread";
|
||||
case Message::Type::NotifyGraphicsReady: return "NotifyGraphicsReady";
|
||||
case Message::Type::EnableIsolines: return "EnableIsolines";
|
||||
case Message::Type::OnEnterBackground: return "OnEnterBackground";
|
||||
case Message::Type::Arrow3dRecache: return "Arrow3dRecache";
|
||||
}
|
||||
ASSERT(false, ("Unknown message type."));
|
||||
return "Unknown type";
|
||||
}
|
||||
} // namespace df
|
|
@ -126,6 +126,4 @@ enum class MessagePriority
|
|||
// This priority allows to process messages after any other messages in queue.
|
||||
Low
|
||||
};
|
||||
|
||||
std::string DebugPrint(Message::Type msgType);
|
||||
} // namespace df
|
||||
|
|
|
@ -92,9 +92,6 @@ private:
|
|||
std::vector<drape_ptr<dp::RenderBucket>> m_renderBuckets;
|
||||
mutable bool m_pendingOnDelete;
|
||||
mutable bool m_canBeDeleted;
|
||||
|
||||
private:
|
||||
friend std::string DebugPrint(RenderGroup const & group);
|
||||
};
|
||||
|
||||
class RenderGroupComparator
|
||||
|
|
|
@ -42,24 +42,4 @@ private:
|
|||
|
||||
extern DepthLayer GetDepthLayer(dp::RenderState const & state);
|
||||
extern dp::RenderState CreateRenderState(gpu::Program program, DepthLayer depthLayer);
|
||||
|
||||
inline std::string DebugPrint(DepthLayer layer)
|
||||
{
|
||||
switch (layer)
|
||||
{
|
||||
case DepthLayer::GeometryLayer: return "GeometryLayer";
|
||||
case DepthLayer::Geometry3dLayer: return "Geometry3dLayer";
|
||||
case DepthLayer::UserLineLayer: return "UserLineLayer";
|
||||
case DepthLayer::OverlayLayer: return "OverlayLayer";
|
||||
case DepthLayer::TransitSchemeLayer: return "TransitSchemeLayer";
|
||||
case DepthLayer::UserMarkLayer: return "UserMarkLayer";
|
||||
case DepthLayer::RoutingBottomMarkLayer: return "RoutingBottomMarkLayer";
|
||||
case DepthLayer::RoutingMarkLayer: return "RoutingMarkLayer";
|
||||
case DepthLayer::SearchMarkLayer: return "SearchMarkLayer";
|
||||
case DepthLayer::GuiLayer: return "GuiLayer";
|
||||
case DepthLayer::LayersCount: CHECK(false, ("Try to output LayersCount"));
|
||||
}
|
||||
CHECK(false, ("Unknown layer"));
|
||||
return {};
|
||||
}
|
||||
} // namespace df
|
||||
|
|
|
@ -135,7 +135,7 @@ std::string DebugPrint(Touch const & t)
|
|||
|
||||
std::string DebugPrint(TouchEvent const & e)
|
||||
{
|
||||
return std::to_string(e.m_type) + "; { " + DebugPrint(e.m_touches[0]) + " }";
|
||||
return ::DebugPrint(e.m_type) + "; { " + DebugPrint(e.m_touches[0]) + " }";
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -393,27 +393,7 @@ OsmOAuth::Response OsmOAuth::DirectRequest(string const & method, bool api) cons
|
|||
|
||||
string DebugPrint(OsmOAuth::Response const & code)
|
||||
{
|
||||
string r;
|
||||
switch (code.first)
|
||||
{
|
||||
case OsmOAuth::HTTP::OK: r = "OK"; break;
|
||||
case OsmOAuth::HTTP::BadXML: r = "BadXML"; break;
|
||||
case OsmOAuth::HTTP::BadAuth: r = "BadAuth"; break;
|
||||
case OsmOAuth::HTTP::Redacted: r = "Redacted"; break;
|
||||
case OsmOAuth::HTTP::NotFound: r = "NotFound"; break;
|
||||
case OsmOAuth::HTTP::WrongMethod: r = "WrongMethod"; break;
|
||||
case OsmOAuth::HTTP::Conflict: r = "Conflict"; break;
|
||||
case OsmOAuth::HTTP::Gone: r = "Gone"; break;
|
||||
case OsmOAuth::HTTP::PreconditionFailed: r = "PreconditionFailed"; break;
|
||||
case OsmOAuth::HTTP::URITooLong: r = "URITooLong"; break;
|
||||
case OsmOAuth::HTTP::TooMuchData: r = "TooMuchData"; break;
|
||||
default:
|
||||
// No data from server in case of NetworkError.
|
||||
if (code.first < 0)
|
||||
return "NetworkError " + strings::to_string(code.first);
|
||||
r = "HTTP " + strings::to_string(code.first);
|
||||
}
|
||||
return r + ": " + code.second;
|
||||
return ::DebugPrint(code.first) + ": " + code.second;
|
||||
}
|
||||
|
||||
} // namespace osm
|
||||
|
|
|
@ -149,3 +149,10 @@ private:
|
|||
std::string DebugPrint(OsmOAuth::Response const & code);
|
||||
|
||||
} // namespace osm
|
||||
|
||||
template <>
|
||||
struct magic_enum::customize::enum_range<osm::OsmOAuth::HTTP>
|
||||
{
|
||||
static constexpr int min = osm::OsmOAuth::HTTP::OK;
|
||||
static constexpr int max = osm::OsmOAuth::HTTP::TooMuchData;
|
||||
};
|
||||
|
|
|
@ -1211,17 +1211,4 @@ bool Editor::IsFeatureUploadedImpl(FeaturesContainer const & features, MwmId con
|
|||
auto const * info = GetFeatureTypeInfo(features, mwmId, index);
|
||||
return info && info->m_uploadStatus == kUploaded;
|
||||
}
|
||||
|
||||
string DebugPrint(Editor::SaveResult saveResult)
|
||||
{
|
||||
switch (saveResult)
|
||||
{
|
||||
case Editor::SaveResult::NothingWasChanged: return "NothingWasChanged";
|
||||
case Editor::SaveResult::SavedSuccessfully: return "SavedSuccessfully";
|
||||
case Editor::SaveResult::NoFreeSpaceError: return "NoFreeSpaceError";
|
||||
case Editor::SaveResult::NoUnderlyingMapError: return "NoUnderlyingMapError";
|
||||
case Editor::SaveResult::SavingError: return "SavingError";
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
} // namespace osm
|
||||
|
|
|
@ -256,6 +256,4 @@ private:
|
|||
|
||||
DECLARE_THREAD_CHECKER(MainThreadChecker);
|
||||
}; // class Editor
|
||||
|
||||
std::string DebugPrint(Editor::SaveResult saveResult);
|
||||
} // namespace osm
|
||||
|
|
|
@ -13,14 +13,4 @@ enum YesNoUnknown
|
|||
Yes = 1,
|
||||
No = 2
|
||||
};
|
||||
|
||||
inline std::string DebugPrint(YesNoUnknown value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case Unknown: return "Unknown";
|
||||
case Yes: return "Yes";
|
||||
case No: return "No";
|
||||
}
|
||||
}
|
||||
} // namespace osm
|
||||
|
|
|
@ -100,18 +100,3 @@ bool ParseLine(std::string_view line, AddressEntry & e)
|
|||
}
|
||||
|
||||
} // namespace tiger
|
||||
|
||||
namespace feature
|
||||
{
|
||||
std::string DebugPrint(InterpolType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case InterpolType::None: return "Interpol::None";
|
||||
case InterpolType::Any: return "Interpol::Any";
|
||||
case InterpolType::Odd: return "Interpol::Odd";
|
||||
case InterpolType::Even: return "Interpol::Even";
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
} // namespace feature
|
||||
|
|
|
@ -19,8 +19,3 @@ void ParseGeometry(std::string_view s, std::vector<ms::LatLon> & geom);
|
|||
feature::InterpolType ParseInterpolation(std::string_view s);
|
||||
bool ParseLine(std::string_view line, AddressEntry & e);
|
||||
} // namespace tiger
|
||||
|
||||
namespace feature
|
||||
{
|
||||
std::string DebugPrint(InterpolType type);
|
||||
} // namespace feature
|
||||
|
|
|
@ -80,7 +80,7 @@ struct RestrictionUTurnForTests
|
|||
string DebugPrint(RestrictionUTurnForTests const & r)
|
||||
{
|
||||
std::ostringstream ss;
|
||||
ss << "[" << DebugPrint(r.m_type) << "]: "
|
||||
ss << "[" << ::DebugPrint(r.m_type) << "]: "
|
||||
<< "feature: " << r.m_featureId << ", "
|
||||
<< "isFirstPoint: " << r.m_viaIsFirstPoint;
|
||||
|
||||
|
|
|
@ -160,16 +160,5 @@ DiffApplicationResult ApplyDiff(std::string const & oldMwmPath, std::string cons
|
|||
return cancellable.IsCancelled() ? DiffApplicationResult::Cancelled
|
||||
: DiffApplicationResult::Failed;
|
||||
}
|
||||
|
||||
std::string DebugPrint(DiffApplicationResult const & result)
|
||||
{
|
||||
switch (result)
|
||||
{
|
||||
case DiffApplicationResult::Ok: return "Ok";
|
||||
case DiffApplicationResult::Failed: return "Failed";
|
||||
case DiffApplicationResult::Cancelled: return "Cancelled";
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
} // namespace mwm_diff
|
||||
} // namespace generator
|
||||
|
|
|
@ -34,7 +34,5 @@ bool MakeDiff(std::string const & oldMwmPath, std::string const & newMwmPath,
|
|||
DiffApplicationResult ApplyDiff(std::string const & oldMwmPath, std::string const & newMwmPath,
|
||||
std::string const & diffPath,
|
||||
base::Cancellable const & cancellable);
|
||||
|
||||
std::string DebugPrint(DiffApplicationResult const & result);
|
||||
} // namespace mwm_diff
|
||||
} // namespace generator
|
||||
|
|
|
@ -175,7 +175,7 @@ void RestrictionWriter::CollectRelation(RelationElement const & relationElement)
|
|||
: ViaType::Way;
|
||||
|
||||
auto const printHeader = [&]() {
|
||||
m_stream << DebugPrint(type) << "," << DebugPrint(viaType) << ",";
|
||||
m_stream << ::DebugPrint(type) << "," << DebugPrint(viaType) << ",";
|
||||
};
|
||||
|
||||
if (viaType == ViaType::Way)
|
||||
|
|
|
@ -74,19 +74,6 @@ std::string DebugPrint(Segment2D const & segment)
|
|||
return "(" + DebugPrint(segment.m_u) + ", " + DebugPrint(segment.m_v) + ")";
|
||||
}
|
||||
|
||||
std::string DebugPrint(IntersectionResult::Type type)
|
||||
{
|
||||
using Type = IntersectionResult::Type;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case Type::Zero: return "Zero";
|
||||
case Type::One: return "One";
|
||||
case Type::Infinity: return "Infinity";
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
std::string DebugPrint(IntersectionResult const & result)
|
||||
{
|
||||
std::ostringstream os;
|
||||
|
@ -94,7 +81,7 @@ std::string DebugPrint(IntersectionResult const & result)
|
|||
if (result.m_type == IntersectionResult::Type::One)
|
||||
os << DebugPrint(result.m_point);
|
||||
else
|
||||
os << DebugPrint(result.m_type);
|
||||
os << ::DebugPrint(result.m_type);
|
||||
os << "]";
|
||||
return os.str();
|
||||
}
|
||||
|
|
|
@ -45,6 +45,5 @@ bool SegmentsIntersect(PointD const & p1, PointD const & p2, PointD const & p3,
|
|||
IntersectionResult Intersect(Segment2D const & seg1, Segment2D const & seg2, double eps);
|
||||
|
||||
std::string DebugPrint(Segment2D const & s);
|
||||
std::string DebugPrint(IntersectionResult::Type type);
|
||||
std::string DebugPrint(IntersectionResult const & result);
|
||||
} // namespace m2
|
||||
|
|
|
@ -123,16 +123,4 @@ void LoadBytes(Source & src, Cont & cont)
|
|||
if (m_type < MapType::World || m_type > MapType::Country || m_scales.size() != kMaxScalesCount)
|
||||
MYTHROW(CorruptedMwmFile, (r.GetName()));
|
||||
}
|
||||
|
||||
std::string DebugPrint(DataHeader::MapType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DataHeader::MapType::World: return "World";
|
||||
case DataHeader::MapType::WorldCoasts: return "WorldCoasts";
|
||||
case DataHeader::MapType::Country: return "Country";
|
||||
}
|
||||
|
||||
UNREACHABLE();
|
||||
}
|
||||
} // namespace feature
|
||||
|
|
|
@ -81,6 +81,4 @@ namespace feature
|
|||
// Is not used now (see data/countries_meta.txt). Can be reused for something else.
|
||||
buffer_vector<uint8_t, 2> m_langs;
|
||||
};
|
||||
|
||||
std::string DebugPrint(DataHeader::MapType type);
|
||||
} // namespace feature
|
||||
|
|
|
@ -311,9 +311,9 @@ void EditableMapObject::SetInternet(feature::Internet internet)
|
|||
uint32_t const wifiType = ftypes::IsWifiChecker::Instance().GetType();
|
||||
bool const hasWiFi = m_types.Has(wifiType);
|
||||
|
||||
if (hasWiFi && internet != feature::Internet::Wlan)
|
||||
if (hasWiFi && internet != feature::Internet::wlan)
|
||||
m_types.Remove(wifiType);
|
||||
else if (!hasWiFi && internet == feature::Internet::Wlan)
|
||||
else if (!hasWiFi && internet == feature::Internet::wlan)
|
||||
m_types.Add(wifiType);
|
||||
}
|
||||
|
||||
|
|
|
@ -4,27 +4,11 @@
|
|||
|
||||
#include <sstream>
|
||||
|
||||
namespace feature
|
||||
{
|
||||
std::string DebugPrint(GeomType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case GeomType::Undefined: return "Undefined";
|
||||
case GeomType::Point: return "Point";
|
||||
case GeomType::Line: return "Line";
|
||||
case GeomType::Area: return "Area";
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
} // namespace feature
|
||||
|
||||
std::string DebugPrint(FeatureID const & id)
|
||||
{
|
||||
return "{ " + DebugPrint(id.m_mwmId) + ", " + std::to_string(id.m_index) + " }";
|
||||
}
|
||||
|
||||
|
||||
std::string FeatureID::GetMwmName() const
|
||||
{
|
||||
return IsValid() ? m_mwmId.GetInfo()->GetCountryName() : std::string();
|
||||
|
|
|
@ -15,8 +15,6 @@ enum class GeomType : int8_t
|
|||
Line = 1,
|
||||
Area = 2
|
||||
};
|
||||
|
||||
std::string DebugPrint(GeomType type);
|
||||
} // namespace feature
|
||||
|
||||
uint32_t constexpr kInvalidFeatureId = std::numeric_limits<uint32_t>::max();
|
||||
|
|
|
@ -516,53 +516,14 @@ string FormatElevation(string_view elevation)
|
|||
return {};
|
||||
}
|
||||
|
||||
constexpr char const * kWlan = "wlan";
|
||||
constexpr char const * kWired = "wired";
|
||||
constexpr char const * kTerminal = "terminal";
|
||||
constexpr char const * kYes = "yes";
|
||||
constexpr char const * kNo = "no";
|
||||
|
||||
string DebugPrint(Internet internet)
|
||||
{
|
||||
switch (internet)
|
||||
{
|
||||
case Internet::No: return kNo;
|
||||
case Internet::Yes: return kYes;
|
||||
case Internet::Wlan: return kWlan;
|
||||
case Internet::Wired: return kWired;
|
||||
case Internet::Terminal: return kTerminal;
|
||||
case Internet::Unknown: break;
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
Internet InternetFromString(std::string_view inet)
|
||||
{
|
||||
if (inet.empty())
|
||||
return Internet::Unknown;
|
||||
if (inet.find(kWlan) != string::npos)
|
||||
return Internet::Wlan;
|
||||
if (inet.find(kWired) != string::npos)
|
||||
return Internet::Wired;
|
||||
if (inet.find(kTerminal) != string::npos)
|
||||
return Internet::Terminal;
|
||||
if (inet == kYes)
|
||||
return Internet::Yes;
|
||||
if (inet == kNo)
|
||||
return Internet::No;
|
||||
return Internet::Unknown;
|
||||
return magic_enum::enum_cast<Internet>(inet).value_or(Internet::Unknown);
|
||||
}
|
||||
|
||||
YesNoUnknown YesNoUnknownFromString(std::string_view str)
|
||||
{
|
||||
if (str.empty())
|
||||
return Unknown;
|
||||
if (str.find(kYes) != string::npos)
|
||||
return Yes;
|
||||
if (str.find(kNo) != string::npos)
|
||||
return No;
|
||||
else
|
||||
return YesNoUnknown::Unknown;
|
||||
return magic_enum::enum_cast<YesNoUnknown>(str).value_or(YesNoUnknown::Unknown);
|
||||
}
|
||||
|
||||
} // namespace feature
|
||||
|
|
|
@ -22,13 +22,12 @@ namespace feature
|
|||
enum class Internet
|
||||
{
|
||||
Unknown, //!< Internet state is unknown (default).
|
||||
Wlan, //!< Wireless Internet access is present.
|
||||
Terminal, //!< A computer with internet service.
|
||||
Wired, //!< Wired Internet access is present.
|
||||
Yes, //!< Unspecified Internet access is available.
|
||||
No //!< There is definitely no any Internet access.
|
||||
wlan, //!< Wireless Internet access is present.
|
||||
terminal, //!< A computer with internet service.
|
||||
wired, //!< Wired Internet access is present.
|
||||
yes, //!< Unspecified Internet access is available.
|
||||
no //!< There is definitely no any Internet access.
|
||||
};
|
||||
std::string DebugPrint(Internet internet);
|
||||
/// @param[in] inet Should be lowercase like in DebugPrint.
|
||||
Internet InternetFromString(std::string_view inet);
|
||||
|
||||
|
|
|
@ -76,17 +76,6 @@ enum class WheelchairAvailability
|
|||
Limited,
|
||||
};
|
||||
|
||||
inline std::string DebugPrint(WheelchairAvailability wheelchair)
|
||||
{
|
||||
switch (wheelchair)
|
||||
{
|
||||
case WheelchairAvailability::No: return "No";
|
||||
case WheelchairAvailability::Yes: return "Yes";
|
||||
case WheelchairAvailability::Limited: return "Limited";
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
class Wheelchair : public TraitsBase<Wheelchair, WheelchairAvailability>
|
||||
{
|
||||
friend TraitsBase;
|
||||
|
|
|
@ -72,49 +72,8 @@ public:
|
|||
return it->second;
|
||||
}
|
||||
};
|
||||
|
||||
char const * HighwayClassToString(ftypes::HighwayClass const cls)
|
||||
{
|
||||
switch (cls)
|
||||
{
|
||||
case ftypes::HighwayClass::Undefined: return "Undefined";
|
||||
case ftypes::HighwayClass::Transported: return "Transported";
|
||||
case ftypes::HighwayClass::Trunk: return "Trunk";
|
||||
case ftypes::HighwayClass::Primary: return "Primary";
|
||||
case ftypes::HighwayClass::Secondary: return "Secondary";
|
||||
case ftypes::HighwayClass::Tertiary: return "Tertiary";
|
||||
case ftypes::HighwayClass::LivingStreet: return "LivingStreet";
|
||||
case ftypes::HighwayClass::Service: return "Service";
|
||||
case ftypes::HighwayClass::Pedestrian: return "Pedestrian";
|
||||
case ftypes::HighwayClass::Count: return "Count";
|
||||
}
|
||||
ASSERT(false, ());
|
||||
return "";
|
||||
}
|
||||
} // namespace
|
||||
|
||||
string DebugPrint(HighwayClass const cls)
|
||||
{
|
||||
stringstream out;
|
||||
out << "[ " << HighwayClassToString(cls) << " ]";
|
||||
return out.str();
|
||||
}
|
||||
|
||||
string DebugPrint(LocalityType const localityType)
|
||||
{
|
||||
switch (localityType)
|
||||
{
|
||||
case LocalityType::None: return "None";
|
||||
case LocalityType::Country: return "Country";
|
||||
case LocalityType::State: return "State";
|
||||
case LocalityType::City: return "City";
|
||||
case LocalityType::Town: return "Town";
|
||||
case LocalityType::Village: return "Village";
|
||||
case LocalityType::Count: return "Count";
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
HighwayClass GetHighwayClass(feature::TypesHolder const & types)
|
||||
{
|
||||
static HighwayClasses highwayClasses;
|
||||
|
|
|
@ -621,8 +621,5 @@ enum class HighwayClass
|
|||
Count // This value is used for internals only.
|
||||
};
|
||||
|
||||
std::string DebugPrint(HighwayClass const cls);
|
||||
std::string DebugPrint(LocalityType const localityType);
|
||||
|
||||
HighwayClass GetHighwayClass(feature::TypesHolder const & types);
|
||||
} // namespace ftypes
|
||||
|
|
|
@ -339,30 +339,30 @@ UNIT_TEST(EditableMapObject_SetInternet)
|
|||
TEST_EQUAL(types.Has(wifiType), hasWifi, ());
|
||||
};
|
||||
|
||||
setInternetAndCheck(emo, feature::Internet::No, false);
|
||||
setInternetAndCheck(emo, feature::Internet::Yes, false);
|
||||
setInternetAndCheck(emo, feature::Internet::Wired, false);
|
||||
setInternetAndCheck(emo, feature::Internet::Wlan, true);
|
||||
setInternetAndCheck(emo, feature::Internet::no, false);
|
||||
setInternetAndCheck(emo, feature::Internet::yes, false);
|
||||
setInternetAndCheck(emo, feature::Internet::wired, false);
|
||||
setInternetAndCheck(emo, feature::Internet::wlan, true);
|
||||
setInternetAndCheck(emo, feature::Internet::Unknown, false);
|
||||
setInternetAndCheck(emo, feature::Internet::Terminal, false);
|
||||
setInternetAndCheck(emo, feature::Internet::terminal, false);
|
||||
|
||||
EditableMapObject bunkerEmo;
|
||||
SetTypes(bunkerEmo, {{"military", "bunker"}});
|
||||
types = bunkerEmo.GetTypes();
|
||||
TEST(!types.Has(wifiType), ());
|
||||
|
||||
setInternetAndCheck(bunkerEmo, feature::Internet::Wlan, true);
|
||||
setInternetAndCheck(bunkerEmo, feature::Internet::No, false);
|
||||
setInternetAndCheck(bunkerEmo, feature::Internet::Wlan, true);
|
||||
setInternetAndCheck(bunkerEmo, feature::Internet::Yes, false);
|
||||
setInternetAndCheck(bunkerEmo, feature::Internet::Wlan, true);
|
||||
setInternetAndCheck(bunkerEmo, feature::Internet::Wired, false);
|
||||
setInternetAndCheck(bunkerEmo, feature::Internet::Wlan, true);
|
||||
setInternetAndCheck(bunkerEmo, feature::Internet::wlan, true);
|
||||
setInternetAndCheck(bunkerEmo, feature::Internet::no, false);
|
||||
setInternetAndCheck(bunkerEmo, feature::Internet::wlan, true);
|
||||
setInternetAndCheck(bunkerEmo, feature::Internet::yes, false);
|
||||
setInternetAndCheck(bunkerEmo, feature::Internet::wlan, true);
|
||||
setInternetAndCheck(bunkerEmo, feature::Internet::wired, false);
|
||||
setInternetAndCheck(bunkerEmo, feature::Internet::wlan, true);
|
||||
setInternetAndCheck(bunkerEmo, feature::Internet::Unknown, false);
|
||||
setInternetAndCheck(bunkerEmo, feature::Internet::Wlan, true);
|
||||
setInternetAndCheck(bunkerEmo, feature::Internet::Terminal, false);
|
||||
setInternetAndCheck(bunkerEmo, feature::Internet::Wlan, true);
|
||||
setInternetAndCheck(bunkerEmo, feature::Internet::Wlan, true);
|
||||
setInternetAndCheck(bunkerEmo, feature::Internet::wlan, true);
|
||||
setInternetAndCheck(bunkerEmo, feature::Internet::terminal, false);
|
||||
setInternetAndCheck(bunkerEmo, feature::Internet::wlan, true);
|
||||
setInternetAndCheck(bunkerEmo, feature::Internet::wlan, true);
|
||||
}
|
||||
|
||||
UNIT_TEST(EditableMapObject_RemoveBlankNames)
|
||||
|
@ -439,7 +439,7 @@ UNIT_TEST(EditableMapObject_FromFeatureType)
|
|||
emo.SetName(names);
|
||||
|
||||
emo.SetMetadata(feature::Metadata::FMD_WEBSITE, "https://some.thing.org");
|
||||
emo.SetInternet(feature::Internet::Wlan);
|
||||
emo.SetInternet(feature::Internet::wlan);
|
||||
|
||||
emo.SetPointType();
|
||||
emo.SetMercator(m2::PointD(1.0, 1.0));
|
||||
|
|
|
@ -421,34 +421,6 @@ void MwmValue::SetTable(MwmInfoEx & info)
|
|||
info.m_table = m_table;
|
||||
}
|
||||
|
||||
string DebugPrint(MwmSet::RegResult result)
|
||||
{
|
||||
switch (result)
|
||||
{
|
||||
case MwmSet::RegResult::Success:
|
||||
return "Success";
|
||||
case MwmSet::RegResult::VersionAlreadyExists:
|
||||
return "VersionAlreadyExists";
|
||||
case MwmSet::RegResult::VersionTooOld:
|
||||
return "VersionTooOld";
|
||||
case MwmSet::RegResult::BadFile:
|
||||
return "BadFile";
|
||||
case MwmSet::RegResult::UnsupportedFileFormat:
|
||||
return "UnsupportedFileFormat";
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
string DebugPrint(MwmSet::Event::Type type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case MwmSet::Event::TYPE_REGISTERED: return "Registered";
|
||||
case MwmSet::Event::TYPE_DEREGISTERED: return "Deregistered";
|
||||
}
|
||||
return "Undefined";
|
||||
}
|
||||
|
||||
string DebugPrint(MwmSet::Event const & event)
|
||||
{
|
||||
ostringstream os;
|
||||
|
|
|
@ -394,9 +394,6 @@ public:
|
|||
bool HasGeometryIndex() const { return m_cont.IsExist(INDEX_FILE_TAG); }
|
||||
}; // class MwmValue
|
||||
|
||||
|
||||
std::string DebugPrint(MwmSet::RegResult result);
|
||||
std::string DebugPrint(MwmSet::Event::Type type);
|
||||
std::string DebugPrint(MwmSet::Event const & event);
|
||||
|
||||
namespace std
|
||||
|
|
|
@ -717,29 +717,9 @@ std::vector<std::string> GetRoadShieldsNames(FeatureType & ft)
|
|||
return names;
|
||||
}
|
||||
|
||||
std::string DebugPrint(RoadShieldType shieldType)
|
||||
{
|
||||
using ftypes::RoadShieldType;
|
||||
switch (shieldType)
|
||||
{
|
||||
case RoadShieldType::Default: return "default";
|
||||
case RoadShieldType::Generic_White: return "white";
|
||||
case RoadShieldType::Generic_Blue: return "blue";
|
||||
case RoadShieldType::Generic_Green: return "green";
|
||||
case RoadShieldType::Generic_Orange: return "orange";
|
||||
case RoadShieldType::Generic_Red: return "red";
|
||||
case RoadShieldType::US_Interstate: return "US interstate";
|
||||
case RoadShieldType::US_Highway: return "US highway";
|
||||
case RoadShieldType::UK_Highway: return "UK highway";
|
||||
case RoadShieldType::Hidden: return "hidden";
|
||||
case RoadShieldType::Count: CHECK(false, ("RoadShieldType::Count is not to be used as a type"));
|
||||
}
|
||||
return std::string();
|
||||
}
|
||||
|
||||
std::string DebugPrint(RoadShield const & shield)
|
||||
{
|
||||
return DebugPrint(shield.m_type) + "/" + shield.m_name +
|
||||
return ::DebugPrint(shield.m_type) + "/" + shield.m_name +
|
||||
(shield.m_additionalText.empty() ? "" : " (" + shield.m_additionalText + ")");
|
||||
}
|
||||
} // namespace ftypes
|
||||
|
|
|
@ -68,7 +68,6 @@ RoadShieldsSetT GetRoadShields(std::string const & rawRoadNumber);
|
|||
// Returns names of road shields if |ft| is a "highway" feature.
|
||||
std::vector<std::string> GetRoadShieldsNames(FeatureType & ft);
|
||||
|
||||
std::string DebugPrint(RoadShieldType shieldType);
|
||||
std::string DebugPrint(RoadShield const & shield);
|
||||
} // namespace ftypes
|
||||
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
typedef enum YesNoUnknown
|
||||
{
|
||||
Unknown = 0,
|
||||
Yes = 1,
|
||||
No = 2
|
||||
yes = 1,
|
||||
no = 2
|
||||
} YesNoUnknown;
|
||||
|
|
|
@ -79,7 +79,7 @@ NSString * GetLocalizedMetadataValueString(MapObject::MetadataID metaID, std::st
|
|||
case MetadataID::FMD_CONTACT_LINE: _line = ToNSString(value); break;
|
||||
case MetadataID::FMD_OPERATOR: _ppOperator = [NSString stringWithFormat:NSLocalizedString(@"operator", nil), ToNSString(value)]; break;
|
||||
case MetadataID::FMD_INTERNET:
|
||||
_wifiAvailable = (rawData.GetInternet() == feature::Internet::No)
|
||||
_wifiAvailable = (rawData.GetInternet() == feature::Internet::no)
|
||||
? NSLocalizedString(@"no_available", nil) : NSLocalizedString(@"yes_available", nil);
|
||||
break;
|
||||
case MetadataID::FMD_LEVEL: _level = ToNSString(value); break;
|
||||
|
|
|
@ -28,10 +28,10 @@
|
|||
|
||||
switch(value)
|
||||
{
|
||||
case Yes:
|
||||
case yes:
|
||||
self.segmentedControl.selectedSegmentIndex = 2;
|
||||
break;
|
||||
case No:
|
||||
case no:
|
||||
self.segmentedControl.selectedSegmentIndex = 0;
|
||||
break;
|
||||
case Unknown:
|
||||
|
@ -46,8 +46,8 @@
|
|||
{
|
||||
switch (value)
|
||||
{
|
||||
case Yes:
|
||||
case No:
|
||||
case yes:
|
||||
case no:
|
||||
self.label.textColor = [UIColor blackPrimaryText];
|
||||
break;
|
||||
case Unknown:
|
||||
|
@ -62,13 +62,13 @@
|
|||
switch (self.segmentedControl.selectedSegmentIndex)
|
||||
{
|
||||
case 0:
|
||||
value = No;
|
||||
value = no;
|
||||
break;
|
||||
case 1:
|
||||
value = Unknown;
|
||||
break;
|
||||
case 2:
|
||||
value = Yes;
|
||||
value = yes;
|
||||
break;
|
||||
default:
|
||||
NSAssert(false, @"Unexpected YesNoUnknown value %ld", static_cast<long>(self.segmentedControl.selectedSegmentIndex));
|
||||
|
|
|
@ -525,7 +525,7 @@ void registerCellsForTableView(std::vector<MWMEditorCellID> const & cells, UITab
|
|||
[tCell configWithDelegate:self
|
||||
icon:[UIImage imageNamed:@"ic_placepage_wifi"]
|
||||
text:L(@"category_wifi")
|
||||
on:m_mapObject.GetInternet() == feature::Internet::Wlan];
|
||||
on:m_mapObject.GetInternet() == feature::Internet::wlan];
|
||||
break;
|
||||
}
|
||||
case MWMEditorCellTypeAdditionalName:
|
||||
|
@ -954,7 +954,7 @@ void registerCellsForTableView(std::vector<MWMEditorCellID> const & cells, UITab
|
|||
switch ([self cellTypeForIndexPath:indexPath])
|
||||
{
|
||||
case MetadataID::FMD_INTERNET:
|
||||
m_mapObject.SetInternet(changeSwitch ? feature::Internet::Wlan : feature::Internet::Unknown);
|
||||
m_mapObject.SetInternet(changeSwitch ? feature::Internet::wlan : feature::Internet::Unknown);
|
||||
break;
|
||||
default: NSAssert(false, @"Invalid field for changeSwitch"); break;
|
||||
}
|
||||
|
@ -968,10 +968,10 @@ void registerCellsForTableView(std::vector<MWMEditorCellID> const & cells, UITab
|
|||
case MetadataID::FMD_DRIVE_THROUGH:
|
||||
switch (changeSegmented)
|
||||
{
|
||||
case Yes:
|
||||
case yes:
|
||||
m_mapObject.SetMetadata(feature::Metadata::FMD_DRIVE_THROUGH, "yes");
|
||||
break;
|
||||
case No:
|
||||
case no:
|
||||
m_mapObject.SetMetadata(feature::Metadata::FMD_DRIVE_THROUGH, "no");
|
||||
break;
|
||||
case Unknown:
|
||||
|
|
|
@ -249,7 +249,7 @@ void SaveCategoryExtendedData(Writer & writer, CategoryData const & categoryData
|
|||
std::string compilationAttributes;
|
||||
if (categoryData.m_compilationId != kInvalidCompilationId)
|
||||
compilationAttributes += " id=\"" + strings::to_string(categoryData.m_compilationId) + "\"";
|
||||
compilationAttributes += " type=\"" + DebugPrint(categoryData.m_type) + "\"";
|
||||
compilationAttributes += " type=\"" + ::DebugPrint(categoryData.m_type) + "\"";
|
||||
writer << kIndent4 << "<" << kCompilation << compilationAttributes << ">\n";
|
||||
}
|
||||
|
||||
|
@ -295,7 +295,7 @@ void SaveCategoryExtendedData(Writer & writer, CategoryData const & categoryData
|
|||
<< "</mwm:reviewsNumber>\n";
|
||||
}
|
||||
|
||||
writer << indent << "<mwm:accessRules>" << DebugPrint(categoryData.m_accessRules)
|
||||
writer << indent << "<mwm:accessRules>" << ::DebugPrint(categoryData.m_accessRules)
|
||||
<< "</mwm:accessRules>\n";
|
||||
|
||||
SaveStringsArray(writer, categoryData.m_tags, "tags", indent);
|
||||
|
|
|
@ -41,33 +41,6 @@ enum class PredefinedColor : uint8_t
|
|||
Count
|
||||
};
|
||||
|
||||
inline std::string DebugPrint(PredefinedColor color)
|
||||
{
|
||||
switch (color)
|
||||
{
|
||||
using enum kml::PredefinedColor;
|
||||
case None: return "None";
|
||||
case Red: return "Red";
|
||||
case Blue: return "Blue";
|
||||
case Purple: return "Purple";
|
||||
case Yellow: return "Yellow";
|
||||
case Pink: return "Pink";
|
||||
case Brown: return "Brown";
|
||||
case Green: return "Green";
|
||||
case Orange: return "Orange";
|
||||
case DeepPurple: return "DeepPurple";
|
||||
case LightBlue: return "LightBlue";
|
||||
case Cyan: return "Cyan";
|
||||
case Teal: return "Teal";
|
||||
case Lime: return "Lime";
|
||||
case DeepOrange: return "DeepOrange";
|
||||
case Gray: return "Gray";
|
||||
case BlueGray: return "BlueGray";
|
||||
case Count: return {};
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
inline dp::Color ColorFromPredefinedColor(PredefinedColor color)
|
||||
{
|
||||
switch (color)
|
||||
|
@ -109,22 +82,6 @@ enum class AccessRules : uint8_t
|
|||
Count
|
||||
};
|
||||
|
||||
inline std::string DebugPrint(AccessRules accessRules)
|
||||
{
|
||||
switch (accessRules)
|
||||
{
|
||||
using enum kml::AccessRules;
|
||||
case Local: return "Local";
|
||||
case Public: return "Public";
|
||||
case DirectLink: return "DirectLink";
|
||||
case P2P: return "P2P";
|
||||
case Paid: return "Paid";
|
||||
case AuthorOnly: return "AuthorOnly";
|
||||
case Count: return {};
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
enum class CompilationType : uint8_t
|
||||
{
|
||||
// Do not change the order because of binary serialization.
|
||||
|
@ -133,18 +90,6 @@ enum class CompilationType : uint8_t
|
|||
Day,
|
||||
};
|
||||
|
||||
inline std::string DebugPrint(CompilationType compilationType)
|
||||
{
|
||||
switch (compilationType)
|
||||
{
|
||||
using enum kml::CompilationType;
|
||||
case Category: return "Category";
|
||||
case Collection: return "Collection";
|
||||
case Day: return "Day";
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
enum class BookmarkIcon : uint16_t
|
||||
{
|
||||
// Do not change the order because of binary serialization.
|
||||
|
|
|
@ -81,17 +81,6 @@ enum class KmlFileType
|
|||
Gpx
|
||||
};
|
||||
|
||||
inline std::string DebugPrint(KmlFileType fileType)
|
||||
{
|
||||
switch (fileType)
|
||||
{
|
||||
case KmlFileType::Text: return "Text";
|
||||
case KmlFileType::Binary: return "Binary";
|
||||
case KmlFileType::Gpx: return "GPX";
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
/// @name File name/path helpers.
|
||||
/// @{
|
||||
std::string GetBookmarksDirectory();
|
||||
|
|
|
@ -27,17 +27,4 @@ struct BookmarksSearchParams
|
|||
using OnResults = std::function<void(Results results, Status status)>;
|
||||
OnResults m_onResults;
|
||||
};
|
||||
|
||||
inline std::string DebugPrint(BookmarksSearchParams::Status status)
|
||||
{
|
||||
using Status = BookmarksSearchParams::Status;
|
||||
switch (status)
|
||||
{
|
||||
case Status::InProgress: return "InProgress";
|
||||
case Status::Completed: return "Completed";
|
||||
case Status::Cancelled: return "Cancelled";
|
||||
}
|
||||
ASSERT(false, ("Unknown status"));
|
||||
return "Unknown";
|
||||
}
|
||||
} // namespace search
|
||||
|
|
|
@ -171,15 +171,3 @@ void IsolinesManager::OnMwmDeregistered(platform::LocalCountryFile const & count
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::string DebugPrint(IsolinesManager::IsolinesState state)
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
case IsolinesManager::IsolinesState::Disabled: return "Disabled";
|
||||
case IsolinesManager::IsolinesState::Enabled: return "Enabled";
|
||||
case IsolinesManager::IsolinesState::ExpiredData: return "ExpiredData";
|
||||
case IsolinesManager::IsolinesState::NoData: return "NoData";
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
|
|
@ -88,5 +88,3 @@ private:
|
|||
std::vector<MwmSet::MwmId> m_lastMwms;
|
||||
mutable std::map<MwmSet::MwmId, Info> m_mwmCache;
|
||||
};
|
||||
|
||||
std::string DebugPrint(IsolinesManager::IsolinesState state);
|
||||
|
|
|
@ -513,20 +513,4 @@ void ParsedMapApi::ExecuteMapApiRequest(Framework & fm) const
|
|||
// Other details will be filled in by BuildPlacePageInfo().
|
||||
fm.BuildAndSetPlacePageInfo(info);
|
||||
}
|
||||
|
||||
std::string DebugPrint(ParsedMapApi::UrlType type)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case ParsedMapApi::UrlType::Incorrect: return "Incorrect";
|
||||
case ParsedMapApi::UrlType::Map: return "Map";
|
||||
case ParsedMapApi::UrlType::Route: return "Route";
|
||||
case ParsedMapApi::UrlType::Search: return "Search";
|
||||
case ParsedMapApi::UrlType::Crosshair: return "Crosshair";
|
||||
case ParsedMapApi::UrlType::OAuth2: return "OAuth2";
|
||||
case ParsedMapApi::UrlType::Menu: return "Menu";
|
||||
case ParsedMapApi::UrlType::Settings: return "Settings";
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
} // namespace url_scheme
|
||||
|
|
|
@ -146,6 +146,4 @@ private:
|
|||
double m_zoomLevel = 0.0;
|
||||
bool m_goBackOnBalloonClick = false;
|
||||
};
|
||||
|
||||
std::string DebugPrint(ParsedMapApi::UrlType type);
|
||||
} // namespace url_scheme
|
||||
|
|
|
@ -18,22 +18,6 @@ enum class EPlaceState
|
|||
CloseSoon
|
||||
};
|
||||
|
||||
inline std::string DebugPrint(EPlaceState state)
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
case EPlaceState::Open:
|
||||
return "EPlaceState::Open";
|
||||
case EPlaceState::OpenSoon:
|
||||
return "EPlaceState::OpenSoon";
|
||||
case EPlaceState::Closed:
|
||||
return "EPlaceState::Closed";
|
||||
case EPlaceState::CloseSoon:
|
||||
return "EPlaceState::CloseSoon";
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
inline EPlaceState PlaceStateCheck(std::string const & openingHours, time_t timestamp)
|
||||
{
|
||||
osmoh::OpeningHours oh(openingHours);
|
||||
|
|
|
@ -122,7 +122,7 @@ public:
|
|||
/// @returns true if Back API button should be displayed.
|
||||
bool HasApiUrl() const { return !m_apiUrl.empty(); }
|
||||
/// TODO: Support all possible Internet types in UI. @See MapObject::GetInternet().
|
||||
bool HasWifi() const { return GetInternet() == feature::Internet::Wlan; }
|
||||
bool HasWifi() const { return GetInternet() == feature::Internet::wlan; }
|
||||
/// Should be used by UI code to generate cool name for new bookmarks.
|
||||
// TODO: Tune new bookmark name. May be add address or some other data.
|
||||
kml::LocalizableString FormatNewBookmarkName() const;
|
||||
|
|
|
@ -79,35 +79,4 @@ FacilitiesState const & GetFacilitiesState(AutoScheme const autoScheme)
|
|||
{
|
||||
return kAutoSchemeToState.at(autoScheme);
|
||||
}
|
||||
|
||||
std::string DebugPrint(Facility const facility)
|
||||
{
|
||||
switch (facility)
|
||||
{
|
||||
case Facility::Buildings3d: return "Buildings3d";
|
||||
case Facility::PerspectiveView: return "PerspectiveView";
|
||||
case Facility::TrackRecording: return "TrackRecording";
|
||||
case Facility::TrafficJams: return "TrafficJams";
|
||||
case Facility::GpsTrackingForTraffic: return "GpsTrackingForTraffic";
|
||||
case Facility::OsmEditsUploading: return "OsmEditsUploading";
|
||||
case Facility::UgcUploading: return "UgcUploading";
|
||||
case Facility::BookmarkCloudUploading: return "BookmarkCloudUploading";
|
||||
case Facility::MapDownloader: return "MapDownloader";
|
||||
case Facility::Count: return "Count";
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
std::string DebugPrint(Scheme const scheme)
|
||||
{
|
||||
switch (scheme)
|
||||
{
|
||||
case Scheme::None: return "None";
|
||||
case Scheme::Normal: return "Normal";
|
||||
case Scheme::EconomyMedium: return "EconomyMedium";
|
||||
case Scheme::EconomyMaximum: return "EconomyMaximum";
|
||||
case Scheme::Auto: return "Auto";
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
} // namespace power_management
|
||||
|
|
|
@ -45,7 +45,4 @@ using FacilitiesState = std::array<bool, static_cast<size_t>(Facility::Count)>;
|
|||
|
||||
FacilitiesState const & GetFacilitiesState(Scheme const scheme);
|
||||
FacilitiesState const & GetFacilitiesState(AutoScheme const autoScheme);
|
||||
|
||||
std::string DebugPrint(Facility const facility);
|
||||
std::string DebugPrint(Scheme const scheme);
|
||||
} // namespace power_management
|
||||
|
|
|
@ -693,16 +693,3 @@ std::string RoadWarningMark::GetLocalizedRoadWarningType(RoadWarningMarkType typ
|
|||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
std::string DebugPrint(RoadWarningMarkType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
using enum RoadWarningMarkType;
|
||||
case Toll: return "Toll";
|
||||
case Ferry: return "Ferry";
|
||||
case Dirty: return "Dirty";
|
||||
case Count: return "Count";
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
|
|
@ -240,5 +240,3 @@ private:
|
|||
uint32_t m_index = 0;
|
||||
std::string m_distance;
|
||||
};
|
||||
|
||||
std::string DebugPrint(RoadWarningMarkType type);
|
||||
|
|
|
@ -561,29 +561,3 @@ void TrafficManager::SetSimplifiedColorScheme(bool simplified)
|
|||
m_hasSimplifiedColorScheme = simplified;
|
||||
m_drapeEngine.SafeCall(&df::DrapeEngine::SetSimplifiedTrafficColors, simplified);
|
||||
}
|
||||
|
||||
std::string DebugPrint(TrafficManager::TrafficState state)
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
case TrafficManager::TrafficState::Disabled:
|
||||
return "Disabled";
|
||||
case TrafficManager::TrafficState::Enabled:
|
||||
return "Enabled";
|
||||
case TrafficManager::TrafficState::WaitingData:
|
||||
return "WaitingData";
|
||||
case TrafficManager::TrafficState::Outdated:
|
||||
return "Outdated";
|
||||
case TrafficManager::TrafficState::NoData:
|
||||
return "NoData";
|
||||
case TrafficManager::TrafficState::NetworkError:
|
||||
return "NetworkError";
|
||||
case TrafficManager::TrafficState::ExpiredData:
|
||||
return "ExpiredData";
|
||||
case TrafficManager::TrafficState::ExpiredApp:
|
||||
return "ExpiredApp";
|
||||
default:
|
||||
ASSERT(false, ("Unknown state"));
|
||||
}
|
||||
return "Unknown";
|
||||
}
|
||||
|
|
|
@ -186,5 +186,3 @@ private:
|
|||
std::mutex m_mutex;
|
||||
threads::SimpleThread m_thread;
|
||||
};
|
||||
|
||||
extern std::string DebugPrint(TrafficManager::TrafficState state);
|
||||
|
|
|
@ -92,26 +92,3 @@ drape_ptr<df::UserPointMark::ColoredSymbolZoomInfo> ColoredMarkPoint::GetColored
|
|||
{
|
||||
return make_unique_dp<ColoredSymbolZoomInfo>(m_coloredSymbols);
|
||||
}
|
||||
|
||||
std::string DebugPrint(UserMark::Type type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case UserMark::Type::API: return "API";
|
||||
case UserMark::Type::SEARCH: return "SEARCH";
|
||||
case UserMark::Type::STATIC: return "STATIC";
|
||||
case UserMark::Type::BOOKMARK: return "BOOKMARK";
|
||||
case UserMark::Type::DEBUG_MARK: return "DEBUG_MARK";
|
||||
case UserMark::Type::ROUTING: return "ROUTING";
|
||||
case UserMark::Type::ROAD_WARNING: return "ROAD_WARNING";
|
||||
case UserMark::Type::SPEED_CAM: return "SPEED_CAM";
|
||||
case UserMark::Type::LOCAL_ADS: return "LOCAL_ADS";
|
||||
case UserMark::Type::TRANSIT: return "TRANSIT";
|
||||
case UserMark::Type::TRACK_INFO: return "TRACK_INFO";
|
||||
case UserMark::Type::TRACK_SELECTION: return "TRACK_SELECTION";
|
||||
case UserMark::Type::COLORED: return "COLORED";
|
||||
case UserMark::Type::USER_MARK_TYPES_COUNT: return "USER_MARK_TYPES_COUNT";
|
||||
case UserMark::Type::USER_MARK_TYPES_COUNT_MAX: return "USER_MARK_TYPES_COUNT_MAX";
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
|
|
@ -155,5 +155,3 @@ public:
|
|||
private:
|
||||
ColoredSymbolZoomInfo m_coloredSymbols;
|
||||
};
|
||||
|
||||
std::string DebugPrint(UserMark::Type type);
|
||||
|
|
|
@ -27,15 +27,4 @@ vector<LocationReferencePoint> & LinearSegment::GetLRPs()
|
|||
{
|
||||
return m_locationReference.m_points;
|
||||
}
|
||||
|
||||
string DebugPrint(LinearSegmentSource source)
|
||||
{
|
||||
switch (source)
|
||||
{
|
||||
case LinearSegmentSource::NotValid: return "NotValid";
|
||||
case LinearSegmentSource::FromLocationReferenceTag: return "FromLocationReferenceTag";
|
||||
case LinearSegmentSource::FromCoordinatesTag: return "FromCoordinatesTag";
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
} // namespace openlr
|
||||
|
|
|
@ -119,6 +119,4 @@ struct LinearSegment
|
|||
uint32_t m_segmentLengthMeters = 0;
|
||||
// uint32_t m_segmentRefSpeed; Always null in partners data. (No docs found).
|
||||
};
|
||||
|
||||
std::string DebugPrint(LinearSegmentSource source);
|
||||
} // namespace openlr
|
||||
|
|
|
@ -7,7 +7,6 @@ set(SRC
|
|||
chunks_download_strategy.cpp
|
||||
chunks_download_strategy.hpp
|
||||
constants.hpp
|
||||
country_defines.cpp
|
||||
country_defines.hpp
|
||||
country_file.cpp
|
||||
country_file.hpp
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
#include "platform/country_defines.hpp"
|
||||
|
||||
#include "base/assert.hpp"
|
||||
|
||||
std::string DebugPrint(MapFileType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case MapFileType::Map: return "Map";
|
||||
case MapFileType::Diff: return "Diff";
|
||||
case MapFileType::Count: return "Count";
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
|
@ -16,5 +16,3 @@ enum class MapFileType : uint8_t
|
|||
using MwmCounter = uint32_t;
|
||||
using MwmSize = uint64_t;
|
||||
using LocalAndRemoteSize = std::pair<MwmSize, MwmSize>;
|
||||
|
||||
std::string DebugPrint(MapFileType type);
|
||||
|
|
|
@ -17,19 +17,6 @@ enum class DownloadStatus
|
|||
FailedSHA,
|
||||
};
|
||||
|
||||
inline std::string DebugPrint(DownloadStatus status)
|
||||
{
|
||||
switch (status)
|
||||
{
|
||||
case DownloadStatus::InProgress: return "In progress";
|
||||
case DownloadStatus::Completed: return "Completed";
|
||||
case DownloadStatus::Failed: return "Failed";
|
||||
case DownloadStatus::FileNotFound: return "File not found";
|
||||
case DownloadStatus::FailedSHA: return "Failed SHA check";
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
struct Progress
|
||||
{
|
||||
static int64_t constexpr kUnknownTotalSize = -1;
|
||||
|
|
|
@ -418,15 +418,4 @@ string CountryIndexes::IndexesDir(LocalCountryFile const & localFile)
|
|||
|
||||
return base::JoinPath(dir, file.GetName());
|
||||
}
|
||||
|
||||
string DebugPrint(CountryIndexes::Index index)
|
||||
{
|
||||
switch (index)
|
||||
{
|
||||
case CountryIndexes::Index::Bits: return "Bits";
|
||||
case CountryIndexes::Index::Nodes: return "Nodes";
|
||||
case CountryIndexes::Index::Offsets: return "Offsets";
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
} // namespace platform
|
||||
|
|
|
@ -18,40 +18,4 @@ MwmTraits::CentersTableFormat MwmTraits::GetCentersTableFormat() const
|
|||
{
|
||||
return CentersTableFormat::EliasFanoMapWithHeader;
|
||||
}
|
||||
|
||||
std::string DebugPrint(MwmTraits::SearchIndexFormat format)
|
||||
{
|
||||
switch (format)
|
||||
{
|
||||
case MwmTraits::SearchIndexFormat::FeaturesWithRankAndCenter:
|
||||
return "FeaturesWithRankAndCenter";
|
||||
case MwmTraits::SearchIndexFormat::CompressedBitVector:
|
||||
return "CompressedBitVector";
|
||||
case MwmTraits::SearchIndexFormat::CompressedBitVectorWithHeader:
|
||||
return "CompressedBitVectorWithHeader";
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
std::string DebugPrint(MwmTraits::HouseToStreetTableFormat format)
|
||||
{
|
||||
switch (format)
|
||||
{
|
||||
case MwmTraits::HouseToStreetTableFormat::HouseToStreetTableWithHeader:
|
||||
return "HouseToStreetTableWithHeader";
|
||||
case MwmTraits::HouseToStreetTableFormat::Unknown:
|
||||
return "Unknown";
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
std::string DebugPrint(MwmTraits::CentersTableFormat format)
|
||||
{
|
||||
switch (format)
|
||||
{
|
||||
case MwmTraits::CentersTableFormat::PlainEliasFanoMap: return "PlainEliasFanoMap";
|
||||
case MwmTraits::CentersTableFormat::EliasFanoMapWithHeader: return "EliasFanoMapWithHeader";
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
} // namespace version
|
||||
|
|
|
@ -64,8 +64,4 @@ private:
|
|||
|
||||
MwmVersion m_version;
|
||||
};
|
||||
|
||||
std::string DebugPrint(MwmTraits::SearchIndexFormat format);
|
||||
std::string DebugPrint(MwmTraits::HouseToStreetTableFormat format);
|
||||
std::string DebugPrint(MwmTraits::CentersTableFormat format);
|
||||
} // namespace version
|
||||
|
|
|
@ -384,35 +384,3 @@ void Platform::CancelTask(Thread thread, base::TaskLoop::TaskId id)
|
|||
case Thread::Background: m_backgroundThread->Cancel(id); return;
|
||||
}
|
||||
}
|
||||
|
||||
std::string DebugPrint(Platform::EError err)
|
||||
{
|
||||
switch (err)
|
||||
{
|
||||
case Platform::ERR_OK: return "Ok";
|
||||
case Platform::ERR_FILE_DOES_NOT_EXIST: return "File does not exist.";
|
||||
case Platform::ERR_ACCESS_FAILED: return "Access failed.";
|
||||
case Platform::ERR_DIRECTORY_NOT_EMPTY: return "Directory not empty.";
|
||||
case Platform::ERR_FILE_ALREADY_EXISTS: return "File already exists.";
|
||||
case Platform::ERR_NAME_TOO_LONG:
|
||||
return "The length of a component of path exceeds {NAME_MAX} characters.";
|
||||
case Platform::ERR_NOT_A_DIRECTORY:
|
||||
return "A component of the path prefix of Path is not a directory.";
|
||||
case Platform::ERR_SYMLINK_LOOP:
|
||||
return "Too many symbolic links were encountered in translating path.";
|
||||
case Platform::ERR_IO_ERROR: return "An I/O error occurred.";
|
||||
case Platform::ERR_UNKNOWN: return "Unknown";
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
std::string DebugPrint(Platform::ChargingStatus status)
|
||||
{
|
||||
switch (status)
|
||||
{
|
||||
case Platform::ChargingStatus::Unknown: return "Unknown";
|
||||
case Platform::ChargingStatus::Plugged: return "Plugged";
|
||||
case Platform::ChargingStatus::Unplugged: return "Unplugged";
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
|
|
@ -345,6 +345,3 @@ private:
|
|||
|
||||
void GetSystemFontNames(FilesList & res) const;
|
||||
};
|
||||
|
||||
std::string DebugPrint(Platform::EError err);
|
||||
std::string DebugPrint(Platform::ChargingStatus status);
|
||||
|
|
|
@ -114,14 +114,8 @@ EditorDialog::EditorDialog(QWidget * parent, osm::EditableMapObject & emo)
|
|||
{
|
||||
grid->addWidget(new QLabel(kInternetObjectName), row, 0);
|
||||
QComboBox * cmb = new QComboBox();
|
||||
std::string const values[] = {DebugPrint(feature::Internet::Unknown),
|
||||
DebugPrint(feature::Internet::Wlan),
|
||||
DebugPrint(feature::Internet::Wired),
|
||||
DebugPrint(feature::Internet::Terminal),
|
||||
DebugPrint(feature::Internet::Yes),
|
||||
DebugPrint(feature::Internet::No)};
|
||||
for (auto const & v : values)
|
||||
cmb->addItem(v.c_str());
|
||||
for (auto const & internet_type : magic_enum::enum_names<feature::Internet>())
|
||||
cmb->addItem(std::string(internet_type).c_str());
|
||||
cmb->setCurrentText(DebugPrint(emo.GetInternet()).c_str());
|
||||
cmb->setObjectName(kInternetObjectName);
|
||||
grid->addWidget(cmb, row++, 1);
|
||||
|
@ -155,7 +149,7 @@ EditorDialog::EditorDialog(QWidget * parent, osm::EditableMapObject & emo)
|
|||
QSignalMapper * signalMapper = new QSignalMapper();
|
||||
connect(deletePOIButton, SIGNAL(clicked()), signalMapper, SLOT(map()));
|
||||
signalMapper->setMapping(deletePOIButton, QDialogButtonBox::DestructiveRole);
|
||||
connect(signalMapper, SIGNAL(mapped(int)), this, SLOT(done(int)));
|
||||
connect(signalMapper, SIGNAL(mappedInt(int)), this, SLOT(done(int)));
|
||||
buttonBox->addButton(deletePOIButton, QDialogButtonBox::DestructiveRole);
|
||||
grid->addWidget(buttonBox, row++, 1);
|
||||
}
|
||||
|
|
|
@ -499,32 +499,4 @@ bool Screenshoter::LoadPoints(std::string const & points)
|
|||
}
|
||||
return !m_pointsToProcess.empty();
|
||||
}
|
||||
|
||||
std::string DebugPrint(Screenshoter::State state)
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
case Screenshoter::State::NotStarted: return "NotStarted";
|
||||
case Screenshoter::State::LoadKml: return "LoadKml";
|
||||
case Screenshoter::State::WaitPosition: return "WaitPosition";
|
||||
case Screenshoter::State::WaitCountries: return "WaitCountries";
|
||||
case Screenshoter::State::WaitGraphics: return "WaitGraphics";
|
||||
case Screenshoter::State::Ready: return "Ready";
|
||||
case Screenshoter::State::FileError: return "FileError";
|
||||
case Screenshoter::State::ParamsError: return "ParamsError";
|
||||
case Screenshoter::State::Done: return "Done";
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
std::string DebugPrint(ScreenshotParams::Mode mode)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
case ScreenshotParams::Mode::KmlFiles: return "KmlFiles";
|
||||
case ScreenshotParams::Mode::Points: return "Points";
|
||||
case ScreenshotParams::Mode::Rects: return "Rects";
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
} // namespace qt
|
||||
|
|
|
@ -88,8 +88,6 @@ private:
|
|||
bool LoadRects(std::string const & rects);
|
||||
bool LoadPoints(std::string const & points);
|
||||
|
||||
friend std::string DebugPrint(State state);
|
||||
|
||||
State m_state = State::NotStarted;
|
||||
ScreenshotParams m_screenshotParams;
|
||||
Framework & m_framework;
|
||||
|
@ -101,7 +99,4 @@ private:
|
|||
std::set<storage::CountryId> m_countriesToDownload;
|
||||
std::string m_nextScreenshotName;
|
||||
};
|
||||
|
||||
std::string DebugPrint(Screenshoter::State state);
|
||||
std::string DebugPrint(ScreenshotParams::Mode mode);
|
||||
} // namespace qt
|
||||
|
|
|
@ -28,7 +28,6 @@ set(SRC
|
|||
coding.hpp
|
||||
cross_border_graph.cpp
|
||||
cross_border_graph.hpp
|
||||
cross_mwm_connector.cpp
|
||||
cross_mwm_connector.hpp
|
||||
cross_mwm_connector_serialization.hpp
|
||||
cross_mwm_graph.cpp
|
||||
|
@ -111,7 +110,6 @@ set(SRC
|
|||
restrictions_serialization.hpp
|
||||
road_access.cpp
|
||||
road_access.hpp
|
||||
road_access_serialization.cpp
|
||||
road_access_serialization.hpp
|
||||
road_graph.cpp
|
||||
road_graph.hpp
|
||||
|
|
|
@ -636,9 +636,9 @@ bool SelectFirstUnrestrictedLane(LaneWay direction, It lanesBegin, It lanesEnd)
|
|||
bool SelectUnrestrictedLane(CarDirection turn, vector<SingleLaneInfo> & lanes)
|
||||
{
|
||||
if (IsTurnMadeFromLeft(turn))
|
||||
return SelectFirstUnrestrictedLane(LaneWay::Left, lanes.begin(), lanes.end());
|
||||
return SelectFirstUnrestrictedLane(LaneWay::left, lanes.begin(), lanes.end());
|
||||
else if (IsTurnMadeFromRight(turn))
|
||||
return SelectFirstUnrestrictedLane(LaneWay::Right, lanes.rbegin(), lanes.rend());
|
||||
return SelectFirstUnrestrictedLane(LaneWay::right, lanes.rbegin(), lanes.rend());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
#include "routing/cross_mwm_connector.hpp"
|
||||
|
||||
namespace routing
|
||||
{
|
||||
namespace connector
|
||||
{
|
||||
std::string DebugPrint(WeightsLoadState state)
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
case WeightsLoadState::Unknown: return "Unknown";
|
||||
case WeightsLoadState::ReadyToLoad: return "ReadyToLoad";
|
||||
case WeightsLoadState::NotExists: return "NotExists";
|
||||
case WeightsLoadState::Loaded: return "Loaded";
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
} // namespace connector
|
||||
} // namespace routing
|
|
@ -33,8 +33,6 @@ enum class WeightsLoadState
|
|||
ReadyToLoad,
|
||||
Loaded
|
||||
};
|
||||
|
||||
std::string DebugPrint(WeightsLoadState state);
|
||||
} // namespace connector
|
||||
|
||||
/// @param CrossMwmId Encoded OSM feature (way) ID that should be equal and unique in all MWMs.
|
||||
|
|
|
@ -247,15 +247,4 @@ bool CrossMwmGraph::TransitCrossMwmSectionExists(NumMwmId numMwmId) const
|
|||
|
||||
return status == MwmStatus::SectionExists;
|
||||
}
|
||||
|
||||
string DebugPrint(CrossMwmGraph::MwmStatus status)
|
||||
{
|
||||
switch (status)
|
||||
{
|
||||
case CrossMwmGraph::MwmStatus::NotLoaded: return "CrossMwmGraph::NotLoaded";
|
||||
case CrossMwmGraph::MwmStatus::SectionExists: return "CrossMwmGraph::SectionExists";
|
||||
case CrossMwmGraph::MwmStatus::NoSection: return "CrossMwmGraph::NoSection";
|
||||
}
|
||||
return string("Unknown CrossMwmGraph::MwmStatus.");
|
||||
}
|
||||
} // namespace routing
|
||||
|
|
|
@ -125,6 +125,4 @@ private:
|
|||
CrossMwmIndexGraph<base::GeoObjectId> m_crossMwmIndexGraph;
|
||||
CrossMwmIndexGraph<connector::TransitId> m_crossMwmTransitGraph;
|
||||
};
|
||||
|
||||
std::string DebugPrint(CrossMwmGraph::MwmStatus status);
|
||||
} // routing
|
||||
|
|
|
@ -63,15 +63,4 @@ private:
|
|||
LatLonWithAltitude m_to;
|
||||
Type m_type = Type::PureFake;
|
||||
};
|
||||
|
||||
inline std::string DebugPrint(FakeVertex::Type type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case FakeVertex::Type::PureFake: return "PureFake";
|
||||
case FakeVertex::Type::PartOfReal: return "PartOfReal";
|
||||
}
|
||||
CHECK(false, ("Unreachable"));
|
||||
return "UnknownFakeVertexType";
|
||||
}
|
||||
} // namespace routing
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Reference in a new issue