hobbes
a language, embedded compiler, and runtime for efficient dynamic expression evaluation, data storage and analysis
Classes | Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
hi::WWWServer Class Reference

#include <www.H>

Collaboration diagram for hi::WWWServer:
Collaboration graph

Classes

struct  HxpFile
 

Public Member Functions

 WWWServer (int port, hobbes::cc *)
 
 ~WWWServer ()
 

Private Types

typedef void(* PrintPageFn) (int fd, const hobbes::array< char > *queryString)
 
typedef std::unordered_map< std::string, HxpFileHxpFiles
 
typedef std::map< std::string, std::string > MIMETypes
 
typedef std::pair< const hobbes::array< char > *, const hobbes::array< char > * > VarBindingDesc
 
typedef hobbes::array< VarBindingDescVarBindingDescs
 

Private Member Functions

void printDefaultPage (int)
 
void printQueryResult (int, const std::string &)
 
void printFileContents (int, const std::string &)
 
const HxpFilehxpFile (const std::string &fpath)
 
void evalHxpFile (const hobbes::HTTPRequest &, int fd, const std::string &fpath, const std::string &queryString)
 
std::string mimeType (const std::string &fpath)
 
std::string mimeTypeForExt (const std::string &ext)
 
void eval (const hobbes::HTTPRequest &req, int fd)
 
VarBindingDescsgetVarBindingDescs ()
 

Static Private Member Functions

static void evalHTTPRequest (const hobbes::HTTPRequest &req, int fd, void *ud)
 

Private Attributes

int port
 
hobbes::ccc
 
HxpFiles hxpFiles
 
MIMETypes mimeTypes
 

Member Typedef Documentation

◆ HxpFiles

typedef std::unordered_map<std::string, HxpFile> hi::WWWServer::HxpFiles
private

◆ MIMETypes

typedef std::map<std::string, std::string> hi::WWWServer::MIMETypes
private

◆ PrintPageFn

typedef void(* hi::WWWServer::PrintPageFn) (int fd, const hobbes::array< char > *queryString)
private

◆ VarBindingDesc

typedef std::pair<const hobbes::array<char>*, const hobbes::array<char>*> hi::WWWServer::VarBindingDesc
private

◆ VarBindingDescs

Constructor & Destructor Documentation

◆ WWWServer()

hi::WWWServer::WWWServer ( int  port,
hobbes::cc c 
)

◆ ~WWWServer()

hi::WWWServer::~WWWServer ( )

Member Function Documentation

◆ eval()

void hi::WWWServer::eval ( const hobbes::HTTPRequest req,
int  fd 
)
private

◆ evalHTTPRequest()

void hi::WWWServer::evalHTTPRequest ( const hobbes::HTTPRequest req,
int  fd,
void *  ud 
)
staticprivate

◆ evalHxpFile()

void hi::WWWServer::evalHxpFile ( const hobbes::HTTPRequest ,
int  fd,
const std::string &  fpath,
const std::string &  queryString 
)
private

◆ getVarBindingDescs()

WWWServer::VarBindingDescs * hi::WWWServer::getVarBindingDescs ( )
private

◆ hxpFile()

const WWWServer::HxpFile & hi::WWWServer::hxpFile ( const std::string &  fpath)
private

◆ mimeType()

std::string hi::WWWServer::mimeType ( const std::string &  fpath)
private

◆ mimeTypeForExt()

std::string hi::WWWServer::mimeTypeForExt ( const std::string &  ext)
private

◆ printDefaultPage()

void hi::WWWServer::printDefaultPage ( int  fd)
private

◆ printFileContents()

void hi::WWWServer::printFileContents ( int  fd,
const std::string &  fpath 
)
private

◆ printQueryResult()

void hi::WWWServer::printQueryResult ( int  fd,
const std::string &  expr 
)
private

Member Data Documentation

◆ c

hobbes::cc* hi::WWWServer::c
private

◆ hxpFiles

HxpFiles hi::WWWServer::hxpFiles
private

◆ mimeTypes

MIMETypes hi::WWWServer::mimeTypes
private

◆ port

int hi::WWWServer::port
private

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