Darknet/YOLO v3.0-88-gdee7eef
Object Detection Framework
 
Loading...
Searching...
No Matches
httplib.hpp File Reference
This graph shows which files directly or indirectly include this file:

Classes

class  httplib::BufferStream
 
class  httplib::Client
 
struct  httplib::detail::ci
 
class  httplib::detail::stream_line_reader
 
struct  httplib::MultipartFile
 
struct  httplib::MultipartFormData
 
struct  httplib::Request
 
struct  httplib::Response
 
class  httplib::Server
 
class  httplib::SocketStream
 
class  httplib::Stream
 
class  httplib::TaskQueue
 
class  httplib::ThreadPool
 
struct  httplib::ThreadPool::worker
 

Namespaces

namespace  httplib
 
namespace  httplib::detail
 

Macros

#define CPPHTTPLIB_KEEPALIVE_MAX_COUNT   5
 
#define CPPHTTPLIB_KEEPALIVE_TIMEOUT_SECOND   5
 
#define CPPHTTPLIB_KEEPALIVE_TIMEOUT_USECOND   0
 
#define CPPHTTPLIB_PAYLOAD_MAX_LENGTH   (std::numeric_limits<size_t>::max)()
 
#define CPPHTTPLIB_READ_TIMEOUT_SECOND   5
 
#define CPPHTTPLIB_READ_TIMEOUT_USECOND   0
 
#define CPPHTTPLIB_RECV_BUFSIZ   size_t(4096u)
 
#define CPPHTTPLIB_REDIRECT_MAX_COUNT   20
 
#define CPPHTTPLIB_REQUEST_URI_MAX_LENGTH   8192
 
#define CPPHTTPLIB_THREAD_POOL_COUNT   8
 
#define INVALID_SOCKET   -1
 

Typedefs

using httplib::ContentProvider = std::function< void(size_t offset, size_t length, DataSink sink)>
 
using httplib::ContentProviderWithCloser = std::function< void(size_t offset, size_t length, DataSink sink, Done done)>
 
using httplib::ContentReader = std::function< bool(ContentReceiver receiver)>
 
using httplib::ContentReceiver = std::function< bool(const char *data, size_t data_length)>
 
using httplib::DataSink = std::function< void(const char *data, size_t data_len)>
 
using httplib::Done = std::function< void()>
 
using httplib::Headers = std::multimap< std::string, std::string, detail::ci >
 
using httplib::Match = std::smatch
 
using httplib::MultipartFiles = std::multimap< std::string, MultipartFile >
 
using httplib::MultipartFormDataItems = std::vector< MultipartFormData >
 
using httplib::Params = std::multimap< std::string, std::string >
 
using httplib::Progress = std::function< bool(uint64_t current, uint64_t total)>
 
using httplib::Range = std::pair< ssize_t, ssize_t >
 
using httplib::Ranges = std::vector< Range >
 
using httplib::ResponseHandler = std::function< bool(const Response &response)>
 
using socket_t = int
 

Enumerations

enum class  httplib::HttpVersion {
  httplib::v1_0 = 0 ,
  httplib::v1_1
}
 

Functions

std::string httplib::detail::base64_encode (const std::string &in)
 
int httplib::detail::close_socket (socket_t sock)
 
template<typename Fn >
socket_t httplib::detail::create_socket (const char *host, int port, Fn fn, int socket_flags=0)
 
std::string httplib::detail::decode_url (const std::string &s)
 
std::string httplib::detail::encode_url (const std::string &s)
 
std::string httplib::detail::file_extension (const std::string &path)
 
const char * httplib::detail::find_content_type (const std::string &path)
 
bool httplib::detail::from_hex_to_i (const std::string &s, size_t i, size_t cnt, int &val)
 
std::string httplib::detail::from_i_to_hex (size_t n)
 
void httplib::Get (std::vector< Request > &requests, const char *path)
 
void httplib::Get (std::vector< Request > &requests, const char *path, const Headers &headers)
 
const char * httplib::detail::get_header_value (const Headers &headers, const char *key, size_t id=0, const char *def=nullptr)
 
uint64_t httplib::detail::get_header_value_uint64 (const Headers &headers, const char *key, int def=0)
 
size_t httplib::detail::get_multipart_ranges_data_length (const Request &req, Response &res, const std::string &boundary, const std::string &content_type)
 
std::pair< size_t, size_t > httplib::detail::get_range_offset_and_length (const Request &req, const Response &res, size_t index)
 
std::pair< size_t, size_t > httplib::detail::get_range_offset_and_length (const Request &req, size_t content_length, size_t index)
 
std::string httplib::detail::get_remote_addr (socket_t sock)
 
bool httplib::detail::has_header (const Headers &headers, const char *key)
 
bool httplib::detail::is_chunked_transfer_encoding (const Headers &headers)
 
bool httplib::detail::is_connection_error ()
 
bool httplib::detail::is_dir (const std::string &path)
 
bool httplib::detail::is_file (const std::string &path)
 
bool httplib::detail::is_hex (char c, int &v)
 
bool httplib::detail::is_valid_path (const std::string &path)
 
std::pair< std::string, std::string > httplib::make_basic_authentication_header (const std::string &username, const std::string &password)
 
std::string httplib::detail::make_content_range_header_field (size_t offset, size_t length, size_t content_length)
 
std::string httplib::detail::make_multipart_data_boundary ()
 
std::string httplib::detail::make_multipart_ranges_data (const Request &req, Response &res, const std::string &boundary, const std::string &content_type)
 
std::pair< std::string, std::string > httplib::make_range_header (Ranges ranges)
 
bool httplib::detail::parse_multipart_boundary (const std::string &content_type, std::string &boundary)
 
bool httplib::detail::parse_multipart_formdata (const std::string &boundary, const std::string &body, MultipartFiles &files)
 
void httplib::detail::parse_query_text (const std::string &s, Params &params)
 
bool httplib::detail::parse_range_header (const std::string &s, Ranges &ranges)
 
void httplib::Post (std::vector< Request > &requests, const char *path, const Headers &headers, const std::string &body, const char *content_type)
 
void httplib::Post (std::vector< Request > &requests, const char *path, const std::string &body, const char *content_type)
 
template<typename T >
bool httplib::detail::process_and_close_socket (bool is_client_request, socket_t sock, size_t keep_alive_max_count, time_t read_timeout_sec, time_t read_timeout_usec, T callback)
 
template<typename SToken , typename CToken , typename Content >
bool httplib::detail::process_multipart_ranges_data (const Request &req, Response &res, const std::string &boundary, const std::string &content_type, SToken stoken, CToken ctoken, Content content)
 
template<typename T >
bool httplib::detail::read_content (Stream &strm, T &x, size_t payload_max_length, int &status, Progress progress, ContentReceiver receiver)
 
bool httplib::detail::read_content_chunked (Stream &strm, ContentReceiver out)
 
bool httplib::detail::read_content_with_length (Stream &strm, uint64_t len, Progress progress, ContentReceiver out)
 
bool httplib::detail::read_content_without_length (Stream &strm, ContentReceiver out)
 
void httplib::detail::read_file (const std::string &path, std::string &out)
 
bool httplib::detail::read_headers (Stream &strm, Headers &headers)
 
template<typename T >
bool httplib::detail::redirect (T &cli, const Request &req, Response &res, const std::string &path)
 
int httplib::detail::select_read (socket_t sock, time_t sec, time_t usec)
 
void httplib::detail::set_nonblocking (socket_t sock, bool nonblocking)
 
int httplib::detail::shutdown_socket (socket_t sock)
 
void httplib::detail::skip_content_with_length (Stream &strm, uint64_t len)
 
template<class Fn >
void httplib::detail::split (const char *b, const char *e, char d, Fn fn)
 
const char * httplib::detail::status_message (int status)
 
std::string httplib::detail::to_lower (const char *beg, const char *end)
 
size_t httplib::detail::to_utf8 (int code, char *buff)
 
bool httplib::detail::wait_until_socket_is_ready (socket_t sock, time_t sec, time_t usec)
 
ssize_t httplib::detail::write_content (Stream &strm, ContentProviderWithCloser content_provider, size_t offset, size_t length)
 
ssize_t httplib::detail::write_content_chunked (Stream &strm, ContentProviderWithCloser content_provider)
 
template<typename T >
int httplib::detail::write_headers (Stream &strm, const T &info, const Headers &headers)
 
bool httplib::detail::write_multipart_ranges_data (Stream &strm, const Request &req, Response &res, const std::string &boundary, const std::string &content_type)
 

Macro Definition Documentation

◆ CPPHTTPLIB_KEEPALIVE_MAX_COUNT

#define CPPHTTPLIB_KEEPALIVE_MAX_COUNT   5

◆ CPPHTTPLIB_KEEPALIVE_TIMEOUT_SECOND

#define CPPHTTPLIB_KEEPALIVE_TIMEOUT_SECOND   5

◆ CPPHTTPLIB_KEEPALIVE_TIMEOUT_USECOND

#define CPPHTTPLIB_KEEPALIVE_TIMEOUT_USECOND   0

◆ CPPHTTPLIB_PAYLOAD_MAX_LENGTH

#define CPPHTTPLIB_PAYLOAD_MAX_LENGTH   (std::numeric_limits<size_t>::max)()

◆ CPPHTTPLIB_READ_TIMEOUT_SECOND

#define CPPHTTPLIB_READ_TIMEOUT_SECOND   5

◆ CPPHTTPLIB_READ_TIMEOUT_USECOND

#define CPPHTTPLIB_READ_TIMEOUT_USECOND   0

◆ CPPHTTPLIB_RECV_BUFSIZ

#define CPPHTTPLIB_RECV_BUFSIZ   size_t(4096u)

◆ CPPHTTPLIB_REDIRECT_MAX_COUNT

#define CPPHTTPLIB_REDIRECT_MAX_COUNT   20

◆ CPPHTTPLIB_REQUEST_URI_MAX_LENGTH

#define CPPHTTPLIB_REQUEST_URI_MAX_LENGTH   8192

◆ CPPHTTPLIB_THREAD_POOL_COUNT

#define CPPHTTPLIB_THREAD_POOL_COUNT   8

◆ INVALID_SOCKET

#define INVALID_SOCKET   -1

Typedef Documentation

◆ socket_t

using socket_t = int