mirror of
https://github.com/debauchee/barrier.git
synced 2026-07-05 03:17:51 +08:00
added basic support for an embedded HTTP server. server
currently supports editing the screen map but changing the map won't behave correctly if there are connected screens.
This commit is contained in:
44
http/XHTTP.h
Normal file
44
http/XHTTP.h
Normal file
@@ -0,0 +1,44 @@
|
||||
#ifndef XHTTP_H
|
||||
#define XHTTP_H
|
||||
|
||||
#include "BasicTypes.h"
|
||||
#include "CString.h"
|
||||
#include "XBase.h"
|
||||
|
||||
class CHTTPReply;
|
||||
|
||||
class XHTTP : public XBase {
|
||||
public:
|
||||
XHTTP(SInt32 statusCode);
|
||||
XHTTP(SInt32 statusCode, const CString& reasonPhrase);
|
||||
~XHTTP();
|
||||
|
||||
SInt32 getStatus() const;
|
||||
CString getReason() const;
|
||||
|
||||
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:
|
||||
XHTTPAllow(const CString& allowedMethods);
|
||||
~XHTTPAllow();
|
||||
|
||||
// XHTTP overrides
|
||||
virtual void addHeaders(CHTTPReply&) const;
|
||||
|
||||
private:
|
||||
CString m_allowed;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user