Darknet/YOLO v3.0-88-gdee7eef
Object Detection Framework
 
Loading...
Searching...
No Matches
httplib::detail Namespace Reference

Classes

struct  ci
 
class  stream_line_reader
 

Functions

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

Function Documentation

◆ base64_encode()

std::string httplib::detail::base64_encode ( const std::string &  in)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ close_socket()

int httplib::detail::close_socket ( socket_t  sock)
inlineprivate
Here is the caller graph for this function:

◆ create_socket()

template<typename Fn >
socket_t httplib::detail::create_socket ( const char *  host,
int  port,
Fn  fn,
int  socket_flags = 0 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ decode_url()

std::string httplib::detail::decode_url ( const std::string &  s)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ encode_url()

std::string httplib::detail::encode_url ( const std::string &  s)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ file_extension()

std::string httplib::detail::file_extension ( const std::string &  path)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ find_content_type()

const char * httplib::detail::find_content_type ( const std::string &  path)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ from_hex_to_i()

bool httplib::detail::from_hex_to_i ( const std::string &  s,
size_t  i,
size_t  cnt,
int &  val 
)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ from_i_to_hex()

std::string httplib::detail::from_i_to_hex ( size_t  n)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_header_value()

const char * httplib::detail::get_header_value ( const Headers headers,
const char *  key,
size_t  id = 0,
const char *  def = nullptr 
)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_header_value_uint64()

uint64_t httplib::detail::get_header_value_uint64 ( const Headers headers,
const char *  key,
int  def = 0 
)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_multipart_ranges_data_length()

size_t httplib::detail::get_multipart_ranges_data_length ( const Request req,
Response res,
const std::string &  boundary,
const std::string &  content_type 
)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_range_offset_and_length() [1/2]

std::pair< size_t, size_t > httplib::detail::get_range_offset_and_length ( const Request req,
const Response res,
size_t  index 
)
inlineprivate
Here is the call graph for this function:

◆ get_range_offset_and_length() [2/2]

std::pair< size_t, size_t > httplib::detail::get_range_offset_and_length ( const Request req,
size_t  content_length,
size_t  index 
)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_remote_addr()

std::string httplib::detail::get_remote_addr ( socket_t  sock)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ has_header()

bool httplib::detail::has_header ( const Headers headers,
const char *  key 
)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_chunked_transfer_encoding()

bool httplib::detail::is_chunked_transfer_encoding ( const Headers headers)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_connection_error()

bool httplib::detail::is_connection_error ( )
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_dir()

bool httplib::detail::is_dir ( const std::string &  path)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_file()

bool httplib::detail::is_file ( const std::string &  path)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_hex()

bool httplib::detail::is_hex ( char  c,
int &  v 
)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_valid_path()

bool httplib::detail::is_valid_path ( const std::string &  path)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ make_content_range_header_field()

std::string httplib::detail::make_content_range_header_field ( size_t  offset,
size_t  length,
size_t  content_length 
)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ make_multipart_data_boundary()

std::string httplib::detail::make_multipart_data_boundary ( )
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ make_multipart_ranges_data()

std::string httplib::detail::make_multipart_ranges_data ( const Request req,
Response res,
const std::string &  boundary,
const std::string &  content_type 
)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_multipart_boundary()

bool httplib::detail::parse_multipart_boundary ( const std::string &  content_type,
std::string &  boundary 
)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_multipart_formdata()

bool httplib::detail::parse_multipart_formdata ( const std::string &  boundary,
const std::string &  body,
MultipartFiles files 
)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_query_text()

void httplib::detail::parse_query_text ( const std::string &  s,
Params params 
)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_range_header()

bool httplib::detail::parse_range_header ( const std::string &  s,
Ranges ranges 
)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ process_and_close_socket()

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,
callback 
)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ process_multipart_ranges_data()

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 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_content()

template<typename T >
bool httplib::detail::read_content ( Stream strm,
T &  x,
size_t  payload_max_length,
int &  status,
Progress  progress,
ContentReceiver  receiver 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_content_chunked()

bool httplib::detail::read_content_chunked ( Stream strm,
ContentReceiver  out 
)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_content_with_length()

bool httplib::detail::read_content_with_length ( Stream strm,
uint64_t  len,
Progress  progress,
ContentReceiver  out 
)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_content_without_length()

bool httplib::detail::read_content_without_length ( Stream strm,
ContentReceiver  out 
)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_file()

void httplib::detail::read_file ( const std::string &  path,
std::string &  out 
)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_headers()

bool httplib::detail::read_headers ( Stream strm,
Headers headers 
)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ redirect()

template<typename T >
bool httplib::detail::redirect ( T &  cli,
const Request req,
Response res,
const std::string &  path 
)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ select_read()

int httplib::detail::select_read ( socket_t  sock,
time_t  sec,
time_t  usec 
)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_nonblocking()

void httplib::detail::set_nonblocking ( socket_t  sock,
bool  nonblocking 
)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shutdown_socket()

int httplib::detail::shutdown_socket ( socket_t  sock)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ skip_content_with_length()

void httplib::detail::skip_content_with_length ( Stream strm,
uint64_t  len 
)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ split()

template<class Fn >
void httplib::detail::split ( const char *  b,
const char *  e,
char  d,
Fn  fn 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ status_message()

const char * httplib::detail::status_message ( int  status)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ to_lower()

std::string httplib::detail::to_lower ( const char *  beg,
const char *  end 
)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ to_utf8()

size_t httplib::detail::to_utf8 ( int  code,
char *  buff 
)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wait_until_socket_is_ready()

bool httplib::detail::wait_until_socket_is_ready ( socket_t  sock,
time_t  sec,
time_t  usec 
)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_content()

ssize_t httplib::detail::write_content ( Stream strm,
ContentProviderWithCloser  content_provider,
size_t  offset,
size_t  length 
)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_content_chunked()

ssize_t httplib::detail::write_content_chunked ( Stream strm,
ContentProviderWithCloser  content_provider 
)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_headers()

template<typename T >
int httplib::detail::write_headers ( Stream strm,
const T &  info,
const Headers headers 
)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_multipart_ranges_data()

bool httplib::detail::write_multipart_ranges_data ( Stream strm,
const Request req,
Response res,
const std::string &  boundary,
const std::string &  content_type 
)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function: