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: 57f1f896a095aa403e1c284fb487c966f2f7c4ec (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 "storage/country_decl.hpp"

#include "coding/geometry_coding.hpp"
#include "coding/point_to_integer.hpp"
#include "coding/read_write_utils.hpp"
#include "coding/varint.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::GeometryCodingParams().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::GeometryCodingParams().GetCoordBits());

  WriteVarInt(sink, r.first);
  WriteVarInt(sink, r.second);
}
}  // namespace storage