Wexus2 0.20
|
#include <FileHTTPHandler.h>
Classes | |
class | FileException |
Public Types | |
enum | FileHTTPHandlerFlags { IndexHtml = 0x1, AutoDirIndex = 0x2, AllowAllMimeTypes = 0x4 } |
Public Member Functions | |
FileHTTPHandler (const QString &docdir, int flags=0) | |
virtual void | handleRequest (wexus::HTTPRequest &req, wexus::HTTPReply &reply) |
handler | |
Static Public Member Functions | |
static void | processRequest (int flags, const QString &docdir, const QString &relpath, wexus::HTTPReply &reply) |
static bool | sendFile (const QString &filename, QIODevice *outputdev) |
Static Protected Member Functions | |
static void | generateDirIndex (const QString &fullpath, const QString &relpath, wexus::HTTPReply &reply) |
Protected Attributes | |
QString | dm_docdir |
int | dm_flags |
A HTTP handler that servces up statis files.
wexus::FileHTTPHandler::FileHTTPHandler | ( | const QString & | docdir, |
int | flags = 0 |
||
) |
Constructor. dir is the dir to serve files from. Subdirectories will be included.
static void wexus::FileHTTPHandler::processRequest | ( | int | flags, |
const QString & | docdir, | ||
const QString & | relpath, | ||
wexus::HTTPReply & | reply | ||
) | [static] |
The core handler itself, reusable in other places (like FileApp) and without an FileHTTPHandler instance.
static bool wexus::FileHTTPHandler::sendFile | ( | const QString & | filename, |
QIODevice * | outputdev | ||
) | [static] |
Sends the given file to the given device (often reply.output().device().
Returns true on success, false on cant-open-file, and throws on critical errors.