This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <optional> | |
#include <variant> | |
#include <boost/beast.hpp> | |
#include <boost/asio/ssl/stream.hpp> | |
#include <boost/asio/ssl/rfc2818_verification.hpp> | |
#include "easyhttp/easyhttp.hpp" | |
#include "./url_parser.hpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <optional> | |
#include <variant> | |
#include <boost/beast.hpp> | |
#include <boost/asio/ssl/stream.hpp> | |
#include <boost/asio/ssl/rfc2818_verification.hpp> | |
#include "easyhttp/easyhttp.hpp" | |
#include "./url_parser.hpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
std::string easyhttp::sync::post(std::string post_url, std::string post_content, std::string content_type) | |
{ | |
try | |
{ | |
auto url = parse_url(post_url); | |
boost::asio::io_context io; | |
boost::asio::ssl::context ssl_ctx(boost::asio::ssl::context::sslv23); | |
ssl_ctx.set_default_verify_paths(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string> | |
#if defined(_MSC_VER) && _MSC_VER < 1920 | |
#include <stdlib.h> | |
#define strtoll _strtoi64 | |
#endif | |
namespace Traits{ | |
template<int digits> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string> | |
namespace Traits{ | |
template<int> | |
struct ScaleTraits; | |
template<> | |
struct ScaleTraits<4> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string> | |
class decimal | |
{ | |
long long fixed_float; | |
private: | |
void from_string(const std::string& string_reprent) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class decimal | |
{ | |
long long fixed_float; | |
public: | |
decimal() : fixed_float(0) {} | |
decimal(int i) : fixed_float(i * 10000) {} | |
decimal(unsigned i) : fixed_float(i * 10000) {} | |
decimal(long i) : fixed_float(i * 10000) {} | |
decimal(unsigned long i) : fixed_float(i * 10000) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <boost/config/warning_disable.hpp> | |
#include <boost/spirit/include/qi.hpp> | |
#include <boost/spirit/include/phoenix.hpp> | |
#include "url_parser.hpp" | |
namespace qi = boost::spirit::qi; | |
BOOST_FUSION_ADAPT_STRUCT( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <boost/config/warning_disable.hpp> | |
#include <boost/spirit/include/qi.hpp> | |
#include <boost/spirit/include/phoenix.hpp> | |
struct KV | |
{ | |
std::string k; | |
std::string v; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <boost/noncopyable.hpp> | |
#include <boost/beast/websocket.hpp> | |
#include <boost/beast/websocket/ssl.hpp> | |
struct websocket_stream : boost::noncopyable |
NewerOlder