2 #ifndef VFS_HTTPD_BROWSER_H
3 #define VFS_HTTPD_BROWSER_H
9 #include <QJsonDocument>
18 Q_INVOKABLE
VFS_httpd_browser(QString dataRootPath, quint16 port, QHostAddress addr=QHostAddress::Any,
bool ssl=
false, QString sslCertPath=
"", QString sslKeyPath=
"");
29 virtual void handle(QHttpRequest *req, QHttpResponse *resp);
A subclass of VFS_request.
virtual void execute()
Execute the request now that it has been satisfied.
VFS_httpd_browser_responder * _m_responder
The responder object used during execute()
VFS_httpd_browser_request(VFS_request::requestType type, VFS_node *t, VFS_httpd_browser_responder *r)
virtual ~VFS_httpd_browser_request()
A subclass of VFS_httpd_responder.
QJsonValue getSystemValue(QString which)
Return information about the system running VFS.
VFS_node * _node
The VFS_node that is _dataRoot. This is unused.
virtual void respond()
based on http status, write page contents or an error to the responder
QByteArray fetchResponse()
Actually fetch and/or prep the response data.
QByteArray lsDir()
Convert an incoming json object to an html <ul> for display.
virtual void validatePath(QUrl url)
Based on the incoming url, decide what work needs to be done.
QJsonDocument _data
The response data, populated after a VFS_request is complete, or immediately if not asynchronous.
virtual ~VFS_httpd_browser_responder()
void done()
Mark the responder as _done, and schedule a deletion with deleteLater().
QByteArray processRHTML(QByteArray page)
Detokenize an .rhtml file.
QString _mode
either browse, report, command, or file. Used in fetchFile()
bool _process
A flag meaning that the response data must be detokenized. This is used for .rhtml files.
quint16 _port
The port that VFS_httpd_browser is listening on. Only used as a print value when processing ....
VFS_httpd_browser_responder(QHttpRequest *req, QHttpResponse *resp, VFS_node *node, quint16 port)
bool _needsToIssueRequest
A flag that means the request is asynchronous and will be satisfied after a VFS_request completes.
bool _done
If the _m_resp has finished, or was aborted or deleted, mark this as true.
A subclass of VFS_httpd which will display a summary of the current state of the VFS.
Q_INVOKABLE VFS_httpd_browser(QString dataRootPath, quint16 port, QHostAddress addr=QHostAddress::Any, bool ssl=false, QString sslCertPath="", QString sslKeyPath="")
virtual void handle(QHttpRequest *req, QHttpResponse *resp)
Handle an incoming request.
VFS_node * dataRoot()
Resolve the _dataRootPath into a VFS_node.
virtual ~VFS_httpd_browser()
VFS_node * _dataRoot
The node found by resolving _dataRootPath.
QString _dataRootPath
The VFS root path to serve from.
Holds the request and response objects for future use.
Creates httpd server node for VFS.
VFS_node is the base class from which all other VFS_node classes derive.
The base class for all requests between nodes.
requestType
Requests perform one of these actions.