Files
barrier/lib/http/XHTTP.h
crs fee4095624 Reorganized source tree. Moved client.cpp into cmd/synergy as
synergy.cpp and server.cpp into cmd/synergyd as synergyd.cpp.
Moved and renamed related files.  Moved remaining source files
into lib/....  Modified and added makefiles as appropriate.
Result is that library files are under lib with each library
in its own directory and program files are under cmd with each
command in its own directory.
2002-07-30 16:52:46 +00:00

68 lines
1.2 KiB
C++

#ifndef XHTTP_H
#define XHTTP_H
#include "BasicTypes.h"
#include "XBase.h"
class CHTTPReply;
//! Generic HTTP exception
class XHTTP : public XBase {
public:
/*!
Use the HTTP \c statusCode as the failure reason.
*/
XHTTP(SInt32 statusCode);
/*!
Use the HTTP \c statusCode as the failure reason. Use \c reasonPhrase
as the human readable reason for the failure.
*/
XHTTP(SInt32 statusCode, const CString& reasonPhrase);
~XHTTP();
//@{
//! @name accessors
//! Get the HTTP status code
SInt32 getStatus() const;
//! Get the reason phrase
CString getReason() const;
//! Modify reply for error
/*!
Override to modify an HTTP reply to further describe the error.
*/
virtual void addHeaders(CHTTPReply&) const;
//@}
protected:
virtual CString getWhat() const throw();
private:
static const char* getReason(SInt32 status);
private:
SInt32 m_status;
CString m_reason;
};
class XHTTPAllow : public XHTTP {
public:
/*!
\c allowedMethods is added as an `Allow' header to a reply in
addHeaders().
*/
XHTTPAllow(const CString& allowedMethods);
~XHTTPAllow();
// XHTTP overrides
virtual void addHeaders(CHTTPReply&) const;
private:
CString m_allowed;
};
#endif