Set HTTP Header Content-Length
std::ostream& cppcms::http::response::out()
Request an output stream to write the body of HTTP response after writing headers.Send all pending output data to the client and finalize the connection. Note, you can't use this object for communication any more.
json
This namespace includes all JSON parsing and formatting related classes and functions.
cppcms::json::value Class Reference
This class is central representation of json objects.
bool cppcms::json::value::load(std::istream& in,bool full,int *line_number = 0)
Read a value from std::istream.
returns true if the value was read successfully, otherwise returns false to indicate a syntax error.
template
T cppcms::json::value::get(std::string const& path) const
inline Get an object of type T from the path path. Throws bad_value_cast if such path does not exists of conversion can't be done
cppcms::applications_pool& cppcms::service::applications_pool()
Get a cppcms::applications_pool instance of this service
cppcms::applications_pool Class Reference
Application pool is the central class that holds user created applications.
void cppcms::applications_pool::mount(booster::intrusive_ptr
Mount an asynchronous application app for processing of any incoming requests. Application would receive PATH_INFO CGI variable for URL matching.
This member function is thread safe.
void cppcms::service::run()
Start the central even loop of CppCMS service. By default, it also install signal handlers on POSIX platforms to handle SIGINT, SIGTERM and SIGUSR1 signals or uses SetConsoleCtrlHandler on Windows platforms waiting on C, BREAK, CLOSE and SHUTDOWN events.
This even call service::shutdown function that stops the main event loop and shutdowns the service properly.
If you want to disable these handlers, you may set service.disable_global_exit_handling option to true.
void cppcms::application::attach(application* app,std::string const& regex,int part)
Register an application app as child and mount it into url_dispatcher calling dispatcher().mount(regex,*app,part);
Ownership of app is transfered to parent.
url_dispatcher& cppcms::application::dispatcher()
Get a dispatched class – class that responsible on mapping between URLs and a member functions of application class.
This member function is application specific and not Connection specific.
template
void cppcms::url_dispatcher::assign(std::string const & regex,void(C::*)() member,C* object)
This template function is a shortcut to assign(regex,callback). It allows assignment of member function of an object with signature void handler() as simple as assign(expr,&bar::foo,this);
In addition to calling member function it calls object->init() before call and object->clean() after the call of the C is derived from cppcms::application
requests,responses,sessions, cache