tnt::HttpError Class Reference

HTTP-error-class. More...

#include <tnt/httperror.h>

Inheritance diagram for tnt::HttpError:
tnt::HttpMessage tnt::MovedTemporarily tnt::NotAuthorized tnt::NotFoundException

Public Member Functions

 HttpError (unsigned errcode)
 HttpError (unsigned errcode, const std::string &msg)
 HttpError (unsigned errcode, const std::string &msg, const std::string &b)
 ~HttpError () throw ()
const char * what () const throw ()
std::string getErrcodeStr () const
unsigned getErrcode () const
std::string getErrmsg () const
const std::string & getBody () const
 returns the body of the message.
- Public Member Functions inherited from tnt::HttpMessage
 HttpMessage ()
virtual ~HttpMessage ()
virtual void clear ()
 Remove all request-specific content.
const char * getHeader (const char *key, const char *def="") const
 Get the content of the specified header if it is set, the passed default otherwise.
unsigned short getMajorVersion () const
 Get the major http version number.
unsigned short getMinorVersion () const
 Get the minor http version number.
void setVersion (unsigned short majorVersion, unsigned short minorVersion)
 Set the http version number.
header_type::const_iterator header_begin () const
 Get a constant iterator which points to the first header.
header_type::const_iterator header_end () const
 Get a constant iterator which points past the last header.
void setHeader (const std::string &key, const std::string &value, bool replace=true)
 Add the specified header to the message.
void removeHeader (const std::string &key)
 Remove the specified header from the message.
std::string dumpHeader () const
 Get all headers in one string.
void dumpHeader (std::ostream &out) const
 Print all headers to the specified output stream.
bool hasHeader (const char *key) const
bool hasHeader (const std::string &key) const

Additional Inherited Members

- Public Types inherited from tnt::HttpMessage
typedef Messageheader header_type
- Static Public Member Functions inherited from tnt::HttpMessage
static std::string htdateCurrent ()
 Get a string for the current time, formatted as needed in http.
static void htdateCurrent (char *current)
 Get a string for the current time, formatted as needed in http buffer must point to at least 30 bytes.
static bool checkUrl (const std::string &url)
 Check for double-dot-url.
static std::string htdate (time_t t)
static std::string htdate (const struct::tm *tm)
static void htdate (char *date, time_t t)
static void htdate (char *date, const struct::tm *tm)
- Protected Attributes inherited from tnt::HttpMessage
header_type header
Cookies httpcookies

Detailed Description

HTTP-error-class.

Constructor & Destructor Documentation

tnt::HttpError::HttpError ( unsigned  errcode)
explicit
tnt::HttpError::HttpError ( unsigned  errcode,
const std::string &  msg 
)
tnt::HttpError::HttpError ( unsigned  errcode,
const std::string &  msg,
const std::string &  b 
)
tnt::HttpError::~HttpError ( ) throw ()
inline

Member Function Documentation

const std::string& tnt::HttpError::getBody ( ) const
inline

returns the body of the message.

unsigned tnt::HttpError::getErrcode ( ) const
inline
std::string tnt::HttpError::getErrcodeStr ( ) const
inline
std::string tnt::HttpError::getErrmsg ( ) const
const char* tnt::HttpError::what ( ) const throw ()
inline

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