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

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

#include "platform/http_client.hpp"

#include <chrono>
#include <string>

namespace partners_api
{
namespace http
{
struct Result
{
  Result(bool result, int errorCode, std::string const & data)
    : m_result(result), m_errorCode(errorCode), m_data(data)
  {
  }

  operator bool() const { return m_result && m_errorCode == 200; }

  bool m_result = false;
  int m_errorCode = platform::HttpClient::kNoError;
  std::string m_data;
};

Result RunSimpleRequest(std::string const & url);
}  // namespace http

std::string FormatTime(std::chrono::system_clock::time_point p, std::string const & format);
}  // namespace partners_api