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:
authorSergey Magidovich <mgsergio@mapswithme.com>2017-06-21 16:14:51 +0300
committerYuri Gorshenin <mipt.vi002@gmail.com>2017-07-05 16:41:38 +0300
commitab085ab12534c987bc2cb0a1770c34ae7281dd2f (patch)
treead4c5e2081a4d53463075be45ef665c322c2f0b9
parentffbeb2b683d48dc6068585086b1cd19546240fc6 (diff)
Add missig files.
-rw-r--r--ugc/storage.cpp33
-rw-r--r--ugc/storage.hpp27
2 files changed, 60 insertions, 0 deletions
diff --git a/ugc/storage.cpp b/ugc/storage.cpp
new file mode 100644
index 0000000000..15fd9babb6
--- /dev/null
+++ b/ugc/storage.cpp
@@ -0,0 +1,33 @@
+#include "ugc/storage.hpp"
+
+#include "indexer/feature_decl.hpp"
+
+namespace ugc
+{
+Storage::Storage(std::string const & filename)
+ : m_filename(filename)
+{
+ Load();
+}
+
+UGCUpdate const * Storage::GetUGCUpdate(FeatureID const & id) const
+{
+ auto const it = m_ugc.find(id);
+ if (it != end(m_ugc))
+ return &it->second;
+ return nullptr;
+}
+
+void Storage::SetUGCUpdate(FeatureID const & id, UGCUpdate const & ugc)
+{
+ m_ugc[id] = ugc;
+}
+
+void Storage::Load()
+{
+}
+
+void Storage::Save()
+{
+}
+} // namespace ugc
diff --git a/ugc/storage.hpp b/ugc/storage.hpp
new file mode 100644
index 0000000000..2086dbad15
--- /dev/null
+++ b/ugc/storage.hpp
@@ -0,0 +1,27 @@
+#pragma once
+
+#include "ugc/types.hpp"
+
+#include <map>
+#include <string>
+
+struct FeatureID;
+
+namespace ugc
+{
+class Storage
+{
+public:
+ explicit Storage(std::string const & filename);
+
+ UGCUpdate const * GetUGCUpdate(FeatureID const & id) const;
+ void SetUGCUpdate(FeatureID const & id, UGCUpdate const & ugc);
+
+ void Save();
+ void Load();
+
+private:
+ std::string m_filename;
+ std::map<FeatureID, UGCUpdate> m_ugc;
+};
+} // namespace ugc