5 #ifndef JODA_JODACLIENT_H
6 #define JODA_JODACLIENT_H
8 #include <rapidjson/document.h>
10 #include "../../../../../extern/cpp-httplib/httplib.h"
13 #define JODA_CLIENT_NON_INTERACTIVE_BATCH_SIZE 5000
14 #define JODA_CLIENT_TIMEOUT 600
19 : runtime_error(
"Client Error: " + what){};
25 : runtime_error(
"Server Error: " + what){};
37 static rapidjson::Document
parseResponse(httplib::Response &res);
38 static void checkError(
const rapidjson::Document &doc);
45 static constexpr
auto prefix =
"/api/v2";
50 std::string &
ltrim(std::string &str);
51 std::string &
rtrim(std::string &str);
Definition: JodaClient.h:16
JodaClientException(const std::string &what)
Definition: JodaClient.h:18
Definition: JodaClient.h:58
JodaClientNoResponseException()
Definition: JodaClient.h:60
Definition: JodaClient.h:28
static void getStringWindowSize(const std::string &str, int &y, int &x)
Definition: JodaClient.cpp:216
std::string query
Definition: JodaClient.h:42
void browseReturn(unsigned long id, unsigned long max)
Definition: JodaClient.cpp:63
static constexpr auto prefix
Definition: JodaClient.h:45
static rapidjson::Document parseResponse(httplib::Response &res)
Definition: JodaClient.cpp:313
void cli()
Definition: JodaClient.cpp:19
static void checkError(const rapidjson::Document &doc)
Definition: JodaClient.cpp:299
static constexpr size_t VERSION
Definition: JodaClient.h:39
std::string & rtrim(std::string &str)
Definition: JodaClient.cpp:48
httplib::Client client
Definition: JodaClient.h:43
std::string parseCommand()
Definition: JodaClient.cpp:56
std::string & ltrim(std::string &str)
Definition: JodaClient.cpp:40
void nonInteractiveQuery(const std::string &query, unsigned long offset, unsigned long count)
Definition: JodaClient.cpp:234
JodaClient(const std::string &addr, int port)
Definition: JodaClient.cpp:283
static void handleError(JodaClientException &e)
Definition: JodaClient.cpp:289
Definition: JodaClient.h:70
JodaServerAPIErrorException(const std::string &what)
Definition: JodaClient.h:72
Definition: JodaClient.h:22
JodaServerException(const std::string &what)
Definition: JodaClient.h:24
Definition: JodaClient.h:64
JodaServerHTTPException(int status)
Definition: JodaClient.h:66
Definition: JodaClient.h:76
JodaServerInvalidJSONException(const std::string &what)
Definition: JodaClient.h:78
Definition: JodaClient.h:12