Welcome to mirror list, hosted at ThFree Co, Russian Federation.

countries.hpp « storage - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 891833c832096f31e9a01c92525b10f52f49aa10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#pragma once
#include "../base/base.hpp"

#include "../std/string.hpp"
#include "../std/vector.hpp"

template <class T> class SimpleTree;

namespace mapinfo
{
  /// used in SimpleTree when loading countries.txt
  class CountryTreeNode
  {
    /// group, country or region
    string m_name;
    /// cell ids for the country
    vector<uint16_t> m_ids;

  public:
    CountryTreeNode(string const & name = string()) : m_name(name) {}

    bool operator<(CountryTreeNode const & other) const
    {
      return m_name < other.m_name;
    }

    string const & Name() const { return m_name; }

    void AddCellId(string const & cellId);
  };

  /// loads tree from given stream
  bool LoadCountries(SimpleTree<CountryTreeNode> & tree, std::istream & stream);
}