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:
authorAlex Zolotarev <deathbaba@gmail.com>2010-12-05 19:24:16 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-22 22:33:57 +0300
commitd6e12b7ce4bcbf0ccd1c07eb25de143422913c34 (patch)
treea7e910c330ce4da9b4f2d8be76067adece2561c4 /indexer/drawing_rule_def.cpp
One Month In Minsk. Made in Belarus.
Diffstat (limited to 'indexer/drawing_rule_def.cpp')
-rw-r--r--indexer/drawing_rule_def.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/indexer/drawing_rule_def.cpp b/indexer/drawing_rule_def.cpp
new file mode 100644
index 0000000000..bfb48a7f1c
--- /dev/null
+++ b/indexer/drawing_rule_def.cpp
@@ -0,0 +1,36 @@
+#include "../base/SRC_FIRST.hpp"
+
+#include "drawing_rule_def.hpp"
+
+#include "../base/macros.hpp"
+#include "../base/assert.hpp"
+#include "../base/string_utils.hpp"
+
+#include "../std/stdio.hpp"
+
+#include "../base/start_mem_debug.hpp"
+
+namespace drule
+{
+ string Key::toString() const
+ {
+ char buffer[50];
+ sprintf(buffer, "%d|%d|%d|%d", m_scale, m_type, m_index, m_priority);
+ return buffer;
+ }
+
+ void Key::fromString(string const & s)
+ {
+ int * arrParams[] = { &m_scale, &m_type, &m_index, &m_priority };
+
+ utils::TokenizeIterator it(s, "|");
+ size_t i = 0;
+ while (!it.end())
+ {
+ ASSERT ( i < ARRAY_SIZE(arrParams), (i) );
+
+ *(arrParams[i++]) = atoi((*it).c_str());
+ ++it;
+ }
+ }
+}