rikitiki  v0.1.67
Build C++ web server modules that allow easy routing and deployment.
rikitiki::ConnContext Class Referenceabstract

#include <connContext.h>

Inheritance diagram for rikitiki::ConnContext:
rikitiki::apache::ApacheConnContext rikitiki::mongoose::MongooseConnContext

Public Types

enum  Method {
  ANY = 0, GET = 1, POST = 2, HEAD = 3,
  PUT = 4, DELETE = 5, TRACE = 6, OPTIONS = 7,
  CONNECT = 8, PATCH = 9, OTHER
}
 

Public Member Functions

HeaderCollection::value_type & AddRequestHeader (const char *, const char *)
 This is a conv. function to add REQUEST headers, not response headers (use the stream operator for that). This function exists so the raw conncontext drivers can just kick down unsanitized header data and this function does the right thing. Namely that means lower-casing it.
 
std::multimap< double,
ContentType::t > & 
Accepts ()
 
PostCollectionPost ()
 
ContentType::t ContentType ()
 
QueryStringCollection & QueryString ()
 
HeaderCollectionHeaders ()
 
CookieCollection & Cookies ()
 
std::string & Payload ()
 
virtual const char * URI ()=0
 
Method RequestMethod ()
 
ConnContextoperator<< (std::function< void(std::ostream &)>)
 
template<class T >
auto operator<< (const T &obj) -> decltype(instance_of< Response >::value<< obj,(ConnContext &)*(ConnContext *) 0)
 
template<class T >
auto operator<< (T &) -> decltype(valid_conversions< T >::Out::Instance(), instance_of< ConnContext >::value)
 
template<class T >
auto operator>> (T &) -> decltype(valid_conversions< T >::In::Instance(), instance_of< ConnContext >::value)
 
template<class T >
auto operator<< (const T &obj) -> decltype(instance_of< Response >::value<< obj,(ConnContext &)*(ConnContext *) 0)
 
template<class T >
auto operator<< (T &obj) -> decltype(valid_conversions< T >::Out::Instance(), instance_of< ConnContext >::value)
 
template<class T >
auto operator>> (T &s) -> decltype(valid_conversions< T >::In::Instance(), instance_of< ConnContext >::value)
 

Public Attributes

const Serverserver
 
bool handled
 
Response response
 

Protected Member Functions

virtual void FillAccepts ()
 
virtual void FillContentType ()
 
virtual void FillPayload ()=0
 
virtual void FillPost ()
 
virtual void FillQueryString ()=0
 
virtual void FillHeaders ()=0
 
virtual void FillRequestMethod ()=0
 
virtual void FillCookies ()
 
virtual void writeResponse ()=0
 
 ConnContext (const Server *)
 

Protected Attributes

bool mappedPost
 
bool mappedQs
 
bool mappedHeaders
 
bool mappedCookies
 
bool mappedPayload
 
bool mappedContentType
 
PostCollection _post
 
QueryStringCollection _qs
 
HeaderCollection _headers
 
CookieCollection _cookies
 
std::multimap< double,
ContentType::t > * 
_accepts
 
ContentType::t _contentType
 
std::string _payload
 
Method _method
 

Friends

class Server
 

Detailed Description

Connection Context object. This is the main object in which handlers use both to read request data and write response data.

In general, you can just stream ('<<') whatever you want into it, and there should be an override that does the right thing.


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