forked from organicmaps/organicmaps
Add missig files.
This commit is contained in:
parent
ffbeb2b683
commit
ab085ab125
2 changed files with 60 additions and 0 deletions
33
ugc/storage.cpp
Normal file
33
ugc/storage.cpp
Normal file
|
@ -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
|
27
ugc/storage.hpp
Normal file
27
ugc/storage.hpp
Normal file
|
@ -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
|
Loading…
Add table
Reference in a new issue