Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvng <viktor.govako@gmail.com>2015-07-15 15:39:53 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:57:11 +0300
commit05c79ca2a68b7950f7cf5a26a28ea176deee7a00 (patch)
tree0d987664e8f3974b3f7545f10b6371a7005541b1 /indexer
parent29aa3a7d7d7c30a3024456cfb4c11c1406986dfc (diff)
Factor out DebugPrint for MwmSet::MwmId.
Diffstat (limited to 'indexer')
-rw-r--r--indexer/feature_decl.cpp2
-rw-r--r--indexer/mwm_set.cpp12
-rw-r--r--indexer/mwm_set.hpp11
3 files changed, 15 insertions, 10 deletions
diff --git a/indexer/feature_decl.cpp b/indexer/feature_decl.cpp
index 063b1afd89..e3df79d2f6 100644
--- a/indexer/feature_decl.cpp
+++ b/indexer/feature_decl.cpp
@@ -6,6 +6,6 @@
string DebugPrint(FeatureID const & id)
{
ostringstream ss;
- ss << "{ " << id.m_mwmId << ", " << id.m_ind << " }";
+ ss << "{ " << DebugPrint(id.m_mwmId) << ", " << id.m_ind << " }";
return ss.str();
}
diff --git a/indexer/mwm_set.cpp b/indexer/mwm_set.cpp
index d176473a9b..7f1b05718c 100644
--- a/indexer/mwm_set.cpp
+++ b/indexer/mwm_set.cpp
@@ -8,6 +8,8 @@
#include "base/stl_add.hpp"
#include "std/algorithm.hpp"
+#include "std/sstream.hpp"
+
using platform::CountryFile;
using platform::LocalCountryFile;
@@ -24,6 +26,16 @@ MwmInfo::MwmTypeT MwmInfo::GetType() const
return COASTS;
}
+string DebugPrint(MwmSet::MwmId const & id)
+{
+ ostringstream ss;
+ if (id.m_info.get())
+ ss << "MwmId [" << id.m_info->GetCountryName() << "]";
+ else
+ ss << "MwmId [invalid]";
+ return ss.str();
+}
+
MwmSet::MwmHandle::MwmHandle() : m_mwmSet(nullptr), m_mwmId(), m_value(nullptr) {}
MwmSet::MwmHandle::MwmHandle(MwmSet & mwmSet, MwmId const & mwmId)
diff --git a/indexer/mwm_set.hpp b/indexer/mwm_set.hpp
index 72ad83be95..3195955529 100644
--- a/indexer/mwm_set.hpp
+++ b/indexer/mwm_set.hpp
@@ -10,7 +10,6 @@
#include "base/macros.hpp"
#include "std/deque.hpp"
-#include "std/iostream.hpp"
#include "std/map.hpp"
#include "std/mutex.hpp"
#include "std/shared_ptr.hpp"
@@ -18,6 +17,7 @@
#include "std/utility.hpp"
#include "std/vector.hpp"
+
/// Information about stored mwm.
class MwmInfo
{
@@ -97,14 +97,7 @@ public:
inline bool operator!=(MwmId const & rhs) const { return !(*this == rhs); }
inline bool operator<(MwmId const & rhs) const { return GetInfo() < rhs.GetInfo(); }
- friend ostream & operator<<(ostream & os, MwmId const & id)
- {
- if (id.m_info.get())
- os << "MwmId [" << id.m_info->GetCountryName() << "]";
- else
- os << "MwmId [invalid]";
- return os;
- }
+ friend string DebugPrint(MwmId const & id);
private:
shared_ptr<MwmInfo> m_info;