| 123456789101112131415161718192021222324252627282930 |
- #ifndef __FILESERVER_H__
- #define __FILESERVER_H__
- #include <httplib.h>
- #include <stdint.h>
- #include <thread>
- class FileServer
- {
- public:
- explicit FileServer();
- ~FileServer();
- std::string addr() const;
- uint16_t port() const;
- bool isRunning() const;
- void run(const char *addr, unsigned short port);
- void start();
- void stop();
- private:
- std::string m_addr;
- uint16_t m_port;
- bool m_isRunning;
- std::thread m_thread;
- httplib::Server m_server;
- };
- #endif // FILESERVER_H
|