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

country_polygon.hpp « storage - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9b7cf2b34e83cbb186ff00dab6441250eb02e2fe (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
#pragma once

#include "storage/country_decl.hpp"

#include "indexer/coding_params.hpp"

#include "coding/point_to_integer.hpp"
#include "coding/read_write_utils.hpp"


namespace storage
{
  template <class TSource> void Read(TSource & src, CountryDef & p)
  {
    rw::Read(src, p.m_countryId);

    pair<int64_t, int64_t> r;
    r.first = ReadVarInt<int64_t>(src);
    r.second = ReadVarInt<int64_t>(src);
    p.m_rect = Int64ToRectObsolete(r, serial::CodingParams().GetCoordBits());
  }

  template <class TSink> void Write(TSink & sink, CountryDef const & p)
  {
    rw::Write(sink, p.m_countryId);

    pair<int64_t, int64_t> const r =
        RectToInt64Obsolete(p.m_rect, serial::CodingParams().GetCoordBits());
    WriteVarInt(sink, r.first);
    WriteVarInt(sink, r.second);
  }
}