diff options
author | Sergey Magidovich <mgsergio@mapswithme.com> | 2015-12-06 10:25:17 +0300 |
---|---|---|
committer | Sergey Yershov <yershov@corp.mail.ru> | 2016-03-23 16:03:58 +0300 |
commit | 791ddf90ce99a497de7919c085dae2d978f8a322 (patch) | |
tree | 4e033b34d4232aae0c0afc4e966c5b1b6144e8bf /editor/xml_feature.hpp | |
parent | 45320c242e76fa6ad86b5716a128923b9cb6eb9c (diff) |
Code review.
Diffstat (limited to 'editor/xml_feature.hpp')
-rw-r--r-- | editor/xml_feature.hpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/editor/xml_feature.hpp b/editor/xml_feature.hpp index 067a61273c..ab13b96801 100644 --- a/editor/xml_feature.hpp +++ b/editor/xml_feature.hpp @@ -7,13 +7,18 @@ #include "std/map.hpp" #include "std/unique_ptr.hpp" +#include "coding/multilang_utf8_string.hpp" + #include "3party/pugixml/src/pugixml.hpp" -namespace indexer +namespace editor { DECLARE_EXCEPTION(XMLFeatureError, RootException); +DECLARE_EXCEPTION(XMLFeatureNoNodeError, XMLFeatureError); +DECLARE_EXCEPTION(XMLFeatureNoLatLonError, XMLFeatureError); +DECLARE_EXCEPTION(XMLFeatureNoTimestampError, XMLFeatureError); class XMLFeature { @@ -21,27 +26,28 @@ public: XMLFeature(); XMLFeature(string const & xml); XMLFeature(pugi::xml_document const & xml); + XMLFeature(pugi::xml_node const & xml); void Save(ostream & ost) const; m2::PointD GetCenter() const; - void SetCenter(m2::PointD const & center); + void SetCenter(m2::PointD const & mercatorCenter); string GetType() const; void SetType(string const & type); - string const GetName(string const & lang) const; - string const GetName(uint8_t const langCode = StringUtf8Multilang::DEFAULT_CODE) const; + string GetName(string const & lang) const; + string GetName(uint8_t const langCode = StringUtf8Multilang::DEFAULT_CODE) const; void SetName(string const & name); void SetName(string const & lang, string const & name); void SetName(uint8_t const langCode, string const & name); - string const GetHouse() const; + string GetHouse() const; void SetHouse(string const & house); time_t GetModificationTime() const; - void SetModificationTime(time_t const time); + void SetModificationTime(time_t const time = ::time(nullptr)); bool HasTag(string const & key) const; bool HasAttribute(string const & key) const; @@ -55,6 +61,7 @@ public: private: pugi::xml_node GetRootNode() const; + pugi::xml_document m_document; }; -} // namespace indexer +} // namespace editor |