5MP Motion Camera JPEG Image and Movie Catcher  1.1.1.1
A CGI interface to capture and display pictures and movies using OpenCV.
http_io Class Reference

#include <http_io.hpp>

Public Member Functions

void get_env (char *env_p[])
 
 http_io ()
 
void print_env (ostream &o_stream)
 
void respond (ostringstream &o_stream, int status=200, string mime="text/plain", string charset="utf-8")
 

Public Attributes

map< string, string > env
 
map< string, string > header
 
map< int, string > http_status
 
bool https {false}
 
string locale
 
string_util su
 

Private Attributes

const string content_type_parser = R"END(^(.*?);\s(.*)$)END"
 
regex content_type_regex {content_type_parser, std::regex_constants::optimize}
 

Constructor & Destructor Documentation

◆ http_io()

http_io::http_io ( )
explicit

Class to handle basic web server CGI input/output and shell environment tasks.

Member Function Documentation

◆ get_env()

void http_io::get_env ( char *  env_p[])

Parses the web server CGI shell environment into http_io::env. Puts the HTTP message body into http_io::env["body"].

Parameters
env_pThe CGI shell environment passed into the third argument to main().

◆ print_env()

void http_io::print_env ( ostream &  o_stream)

Dump http_io::env to a stream.

Parameters
o_streamThe stream to print the output to; stdout or a file typically.

◆ respond()

void http_io::respond ( ostringstream &  o_stream,
int  status = 200,
string  mime = "text/plain",
string  charset = "utf-8" 
)

Send an HTTP response to an HTTP query.

Parameters
o_streamThe stream to print the output to..
statusThe HTTP Status code
See also
http_io::http_status
Parameters
mimeThe HTTP Content-Type
charsetThe character set

Member Data Documentation

◆ content_type_parser

const string http_io::content_type_parser = R"END(^(.*?);\s(.*)$)END"
private

◆ content_type_regex

regex http_io::content_type_regex {content_type_parser, std::regex_constants::optimize}
private

◆ env

map<string, string> http_io::env

◆ header

map<string, string> http_io::header

◆ http_status

map<int, string> http_io::http_status

◆ https

bool http_io::https {false}

◆ locale

string http_io::locale

◆ su

string_util http_io::su

The documentation for this class was generated from the following files: