mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-02 11:03:44 +00:00
committed by
Konstantin Pastbin
parent
c9cbb64f12
commit
76ffc99abd
42
libs/storage/country_info_reader_light.hpp
Normal file
42
libs/storage/country_info_reader_light.hpp
Normal file
@@ -0,0 +1,42 @@
|
||||
#pragma once
|
||||
|
||||
#include "storage/country_info_getter.hpp"
|
||||
#include "storage/country_name_getter.hpp"
|
||||
#include "storage/storage_defines.hpp"
|
||||
|
||||
#include "coding/files_container.hpp"
|
||||
|
||||
#include "geometry/point2d.hpp"
|
||||
#include "geometry/region2d.hpp"
|
||||
|
||||
#include <cstddef>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace lightweight
|
||||
{
|
||||
class CountryInfoReader : protected storage::CountryInfoGetterBase
|
||||
{
|
||||
public:
|
||||
struct Info
|
||||
{
|
||||
storage::CountryId m_id;
|
||||
std::string m_name;
|
||||
};
|
||||
|
||||
CountryInfoReader();
|
||||
/// @note Be careful here, because "lightweight" has no region's geometry cache.
|
||||
Info GetMwmInfo(m2::PointD const & pt) const;
|
||||
|
||||
protected:
|
||||
void LoadRegionsFromDisk(size_t id, std::vector<m2::RegionD> & regions) const;
|
||||
|
||||
// storage::CountryInfoGetterBase overrides:
|
||||
bool BelongsToRegion(m2::PointD const & pt, size_t id) const override;
|
||||
|
||||
private:
|
||||
std::unique_ptr<FilesContainerR> m_reader;
|
||||
storage::CountryNameGetter m_nameGetter;
|
||||
};
|
||||
} // namespace lightweight
|
||||
Reference in New Issue
Block a user