17#ifndef Foundation_Bugcheck_INCLUDED
18#define Foundation_Bugcheck_INCLUDED
21#include "Poco/Foundation.h"
42 static void assertion(
const char* cond,
const char* file,
int line,
const char* text = 0);
46 static void nullPointer(
const char* ptr,
const char* file,
int line);
50 static void bugcheck(
const char* file,
int line);
54 static void bugcheck(
const char* msg,
const char* file,
int line);
64 static void debugger(
const char* file,
int line);
68 static void debugger(
const char* msg,
const char* file,
int line);
73 static std::string
what(
const char* msg,
const char* file,
int line,
const char* text = 0);
83#if defined(__KLOCWORK__) || defined(__clang_analyzer__)
93#define poco_assert_dbg(cond) do { if (!(cond)) std::abort(); } while (0
)
94#define poco_assert_msg_dbg(cond, text) do { if (!(cond)) std::abort(); } while (0
)
95#define poco_assert(cond) do { if (!(cond)) std::abort(); } while (0
)
96#define poco_assert_msg(cond, text) do { if (!(cond)) std::abort(); } while (0
)
97#define poco_check_ptr(ptr) do { if (!(ptr)) std::abort(); } while (0
)
98#define poco_bugcheck() do { std::abort(); } while (0
)
99#define poco_bugcheck_msg(msg) do { std::abort(); } while (0
)
106 #define poco_assert_dbg(cond)
107 if (!(cond)) Poco::Bugcheck::assertion(#cond, __FILE__, __LINE__); else (void) 0
109 #define poco_assert_msg_dbg(cond, text)
110 if (!(cond)) Poco::Bugcheck::assertion(#cond, __FILE__, __LINE__, text); else (void) 0
112 #define poco_assert_msg_dbg(cond, text)
113 #define poco_assert_dbg(cond)
117#define poco_assert(cond)
118 if (!(cond)) Poco::Bugcheck::assertion(#cond, __FILE__, __LINE__); else (void) 0
121#define poco_assert_msg(cond, text)
122 if (!(cond)) Poco::Bugcheck::assertion(#cond, __FILE__, __LINE__, text); else (void) 0
125#define poco_check_ptr(ptr)
126 if (!(ptr)) Poco::Bugcheck::nullPointer(#ptr, __FILE__, __LINE__); else (void) 0
129#define poco_bugcheck()
130 Poco::Bugcheck::bugcheck(__FILE__, __LINE__)
133#define poco_bugcheck_msg(msg)
134 Poco::Bugcheck::bugcheck(msg, __FILE__, __LINE__)
140#define poco_unexpected()
141 Poco::Bugcheck::unexpected(__FILE__, __LINE__);
144#define poco_debugger()
145 Poco::Bugcheck::debugger(__FILE__, __LINE__)
148#define poco_debugger_msg(msg)
149 Poco::Bugcheck::debugger(msg, __FILE__, __LINE__)
153# define poco_stdout_dbg(outstr)
154 std::cout << __FILE__ << '(' << std::dec << __LINE__ << "):" << outstr << std::endl;
156# define poco_stdout_dbg(outstr)
161# define poco_stderr_dbg(outstr)
162 std::cerr << __FILE__ << '(' << std::dec << __LINE__ << "):" << outstr << std::endl;
164# define poco_stderr_dbg(outstr)
176struct POCO_STATIC_ASSERTION_FAILURE;
180struct POCO_STATIC_ASSERTION_FAILURE<
true>
195#if defined(__GNUC__) && (__GNUC__ == 3
) && ((__GNUC_MINOR__ == 3
) || (__GNUC_MINOR__ == 4
))
196#define poco_static_assert(B)
197 typedef char POCO_JOIN(poco_static_assert_typedef_, __LINE__)
198 [POCO_STATIC_ASSERTION_FAILURE<(bool) (B)>::value]
200#define poco_static_assert(B)
201 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (B)>)>
#define POCO_DO_JOIN2(X, Y)
#define POCO_DO_JOIN(X, Y)
#define POCO_EXTERNAL_OPENSSL_SLPRO
virtual std::unique_ptr< ArkApi::ICommands > & GetCommands()=0
void WriteRequest(std::function< void(bool, std::string)> callback, bool success, std::string result)
std::string GetResponse(Poco::Net::HTTPClientSession *session, Poco::Net::HTTPResponse &response)
Poco::Net::HTTPRequest ConstructRequest(const std::string &url, Poco::Net::HTTPClientSession *&session, const std::vector< std::string > &headers, const std::string &request_type)
std::vector< RequestData > RequestsVec_
Requests(Requests &&)=delete
ARK_API bool CreateGetRequest(const std::string &url, const std::function< void(bool, std::string)> &callback, std::vector< std::string > headers={})
Creates an async GET Request that runs in another thread but calls the callback from the main thread.
ARK_API bool CreatePostRequest(const std::string &url, const std::function< void(bool, std::string)> &callback, const std::vector< std::string > &post_ids, const std::vector< std::string > &post_data, std::vector< std::string > headers={})
Creates an async POST Request that runs in another thread but calls the callback from the main thread...
Requests & operator=(Requests &&)=delete
ARK_API bool CreateDeleteRequest(const std::string &url, const std::function< void(bool, std::string)> &callback, std::vector< std::string > headers={})
Creates an async DELETE Request that runs in another thread but calls the callback from the main thre...
Requests & operator=(const Requests &)=delete
ARK_API bool CreatePostRequest(const std::string &url, const std::function< void(bool, std::string)> &callback, const std::string &post_data, std::vector< std::string > headers={})
Creates an async POST Request with application/x-www-form-urlencoded content type that runs in anothe...
static ARK_API Requests & Get()
ARK_API bool CreatePostRequest(const std::string &url, const std::function< void(bool, std::string)> &callback, const std::string &post_data, const std::string &content_type, std::vector< std::string > headers={})
Creates an async POST Request that runs in another thread but calls the callback from the main thread...
std::unique_ptr< impl > pimpl
Requests(const Requests &)=delete
virtual void AddOnTickCallback(const FString &id, const std::function< void(float)> &callback)=0
Added function will be called every frame.
virtual bool RemoveOnTickCallback(const FString &id)=0
Removes a on-tick callback.
static std::shared_ptr< spdlog::logger > & GetLog()
static std::string what(const char *msg, const char *file, int line, const char *text=0)
static void bugcheck(const char *msg, const char *file, int line)
static void nullPointer(const char *ptr, const char *file, int line)
static void debugger(const char *msg, const char *file, int line)
static void debugger(const char *file, int line)
static void bugcheck(const char *file, int line)
static void assertion(const char *cond, const char *file, int line, const char *text=0)
static void unexpected(const char *file, int line)
std::string displayText() const
Returns the exception code if defined.
virtual std::istream & receiveResponse(HTTPResponse &response)
virtual std::ostream & sendRequest(HTTPRequest &request)
Returns the connection timeout for HTTP connections.
static const std::string HTTP_1_1
void setContentLength(std::streamsize length)
Returns the HTTP version for this message.
HTTPRequest(const std::string &method, const std::string &uri, const std::string &version)
Creates a HTTP/1.0 request with the given method and URI.
static const std::string HTTP_GET
static const std::string HTTP_DELETE
static const std::string HTTP_POST
const std::string & getReason() const
Sets the HTTP reason phrase.
HTTPResponse(HTTPStatus status)
HTTPStatus getStatus() const
HTTPSClientSession(const std::string &host, Poco::UInt16 port, Context::Ptr pContext, Session::Ptr pSession)
std::string proxyRequestPrefix() const
Sends the given HTTPRequest over an existing connection.
HTTPSClientSession(Context::Ptr pContext, Session::Ptr pSession)
Session::Ptr sslSession()
HTTPSClientSession(Context::Ptr pContext)
Creates a HTTPSClientSession using the given host and port.
void proxyAuthenticate(HTTPRequest &request)
Checks if we can reuse a persistent connection.
int read(char *buffer, std::streamsize length)
HTTPSClientSession(const HTTPSClientSession &)
void connect(const SocketAddress &address)
Refills the internal buffer.
HTTPSClientSession(const SecureStreamSocket &socket, Session::Ptr pSession)
X509Certificate serverCertificate()
HTTPSClientSession & operator=(const HTTPSClientSession &)
HTTPSClientSession(const std::string &host, Poco::UInt16 port=HTTPS_PORT)
HTTPSClientSession(const SecureStreamSocket &socket)
Creates an unconnected HTTPSClientSession.
HTTPSClientSession(const std::string &host, Poco::UInt16 port, Context::Ptr pContext)
RejectCertificateHandler(bool handleErrorsOnServerSide)
void initializeClient(PrivateKeyPassphraseHandlerPtr ptrPassphraseHandler, InvalidCertificateHandlerPtr ptrHandler, Context::Ptr ptrContext)
static SSLManager & instance()
This stream discards all characters written to it.
static std::streamsize copyStream(std::istream &istr, std::ostream &ostr, std::size_t bufferSize=8192)
const std::string & getHost() const
Sets the user-info part of the URI.
const std::string & getScheme() const
URI(const std::string &uri)
Creates an empty URI.
unsigned short getPort() const
Sets the host part of the URI.
std::string getPathAndQuery() const
Returns the encoded path, query and fragment parts of the URI.
std::unique_ptr< IBaseApi > game_api
void NetSSL_API initializeSSL()
void Net_API uninitializeNetwork()
void Net_API initializeNetwork()
void NetSSL_API uninitializeSSL()
std::function< void(bool, std::string)> callback
static std::string escape(const std::string &s, bool strictJSON=false)