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

ge0_parser.hpp « map - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 288ac0cd0fab6888397fed515e8ad78914142e97 (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"


namespace url_scheme
{

struct ApiPoint;

class Ge0Parser
{
public:
  Ge0Parser();

  bool Parse(string const & url, url_scheme::ApiPoint & outPoint, double & outZoomLevel);

protected:
  uint8_t DecodeBase64Char(char const c);
  static double DecodeZoom(uint8_t const zoomByte);
  void DecodeLatLon(string const & url, double & lat, double & lon);
  void DecodeLatLonToInt(string const & url, int & lat, int & lon, int const bytes);
  double DecodeLatFromInt(int const lat, int const maxValue);
  double DecodeLonFromInt(int const lon, int const maxValue);
  string DecodeName(string name);
  void SpacesToUnderscore(string & name);
  void ValidateName(string & name);
  static bool IsHexChar(char const a);

private:
  uint8_t m_base64ReverseCharTable[256];
};

}  // namespace url_api