Go to the documentation of this file.
15 m_httpServerThread(new
MThread(
"HTTPServer"))
19 qRegisterMetaType<HTTPHandler>();
20 qRegisterMetaType<HTTPHandlers>();
21 qRegisterMetaType<HTTPServices>();
22 qRegisterMetaType<DataPayload>();
23 qRegisterMetaType<DataPayloads>();
24 qRegisterMetaType<StringPayload>();
void start(QThread::Priority p=QThread::InheritPriority)
Tell MThread to start running the thread in the near future.
void quit(void)
calls exit(0)
bool wait(std::chrono::milliseconds time=std::chrono::milliseconds::max())
Wait for the MThread to exit, with a maximum timeout.
void EnableHTTP(bool Enable)
void RemovePaths(const QStringList &Paths)
MythHTTPScopedInstance(const HTTPHandlers &Handlers)
A convenience class to manage the lifetime of a MythHTTPInstance.
void AddErrorPageHandler(const HTTPHandler &Handler)
void AddHandlers(const HTTPHandlers &Handlers)
void AddPaths(const QStringList &Paths)
static void AddPaths(const QStringList &Paths)
Add path(s) for the MythHTTPServer instance to handle.
static void Addservices(const HTTPServices &Services)
~MythHTTPScopedInstance()
QThread * qthread(void)
Returns the thread, this will always return the same pointer no matter how often you restart the thre...
static void RemoveServices(const HTTPServices &Services)
static void AddHandlers(const HTTPHandlers &Handlers)
Add function handlers for specific paths.
static MythHTTPInstance & Instance()
static void RemovePaths(const QStringList &Paths)
Remove path(s) from the MythHTTPServer instance.
MThread * m_httpServerThread
MythHTTPServer * m_httpServer
void RemoveHandlers(const HTTPHandlers &Handlers)
static void StopHTTPService()
Stop and delete the MythHTTPServer instance.
This is a wrapper around QThread that does several additional things.
static void EnableHTTPService(bool Enable=true)
Signals to the MythHTTPServer instance whether to start or stop listening.
void AddServices(const HTTPServices &Services)
std::vector< HTTPService > HTTPServices
void RemoveServices(const HTTPServices &Services)
static void RemoveHandlers(const HTTPHandlers &Handlers)
std::pair< QString, HTTPFunction > HTTPHandler
std::vector< HTTPHandler > HTTPHandlers
static void AddErrorPageHandler(const HTTPHandler &Handler)