10 #include <QHostAddress>
18 #ifndef WOLF_BASE_EXPORT
19 #define WOLF_BASE_EXPORT Q_DECL_IMPORT
35 bool hasHeader(
const QString&)
const;
37 bool hasCgiHeader(
const QString&)
const;
39 QByteArray header(
const QString&)
const;
41 QByteArray cgiHeader(
const QString&)
const;
43 QByteArray bodyData()
const;
49 QByteArray dump()
const;
52 QString pathInfo()
const;
54 QString hostInfo()
const;
59 void setBody(
const QByteArray&);
64 QMap<QByteArray,QByteArray>mhead;
81 bool setStatus(
short code,QString str);
83 bool setHeader(
const QString&,
const QString&);
85 void setBody(
const QString&);
87 void setBody(
const QByteArray&);
92 QByteArray toWireFormat()
const;
95 QByteArray mStatStr,mBody;
96 QMap<QString,QPair<QString,QString> >mHead;
112 WServer(
const QString&path,
bool removeIfExist=
true,QObject*parent=0);
118 WServer(
const QHostAddress&addr,
unsigned short port,QObject*parent=0);
123 bool isActive()
const{
return tcpserv!=0 || locserv!=0;}
130 quint16 tcpPort()
const;
137 void registerInterface(
const QString&path,
WInterface*ifc);
142 void registerStatic(
const QString&path,
const QString&content);
144 void unregisterPath(
const QString&);
146 void register404(
const QString&);
148 void register400(
const QString&);
150 void setReceiveTimeout(
int);
152 void restrictSourceHosts(
const QPair<QHostAddress,int>&);
154 void enableDebugUrl(
bool enable=
true);
158 void newConnection();
160 void handleConnection(QIODevice*);
166 QLocalServer*locserv;
167 QMap<QString,WInterface*>iface;
168 QMap<QString,QString>statcontent;
169 QString err404,err400;
171 QPair<QHostAddress,int>sourcehost;
#define WOLF_BASE_EXPORT
Definition: server.h:19
Definition: server_p.h:12
int receiveTimeout() const
Definition: server.h:127
reply object for the server side: contains the data sent back to the client
Definition: server.h:70
Encapsulates the request as it comes in via (S)CGI.
Definition: server.h:23
bool isActive() const
returns true if this is a working server (i.e. the constructor did not have errors) ...
Definition: server.h:123
base class of all interfaces
Definition: interface.h:28
Q_DECLARE_METATYPE(WServerRequest)