diff options
| author | Joel Klinghed <the_jk@spawned.biz> | 2021-11-17 22:34:57 +0100 |
|---|---|---|
| committer | Joel Klinghed <the_jk@spawned.biz> | 2021-11-17 22:34:57 +0100 |
| commit | 6232d13f5321b87ddf12a1aa36b4545da45f173d (patch) | |
| tree | 23f3316470a14136debd9d02f9e920ca2b06f4cc /src/send_file.hh | |
Travel3: Simple image and video display site
Reads the images and videos from filesystem and builds a site in
memroy.
Diffstat (limited to 'src/send_file.hh')
| -rw-r--r-- | src/send_file.hh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/send_file.hh b/src/send_file.hh new file mode 100644 index 0000000..aca21b6 --- /dev/null +++ b/src/send_file.hh @@ -0,0 +1,35 @@ +#ifndef SEND_FILE_HH +#define SEND_FILE_HH + +#include "transport.hh" + +#include <filesystem> +#include <memory> +#include <optional> +#include <string_view> + +class Logger; +class Config; + +class SendFile { +public: + virtual ~SendFile() = default; + + static std::unique_ptr<SendFile> create(); + + virtual bool setup(Logger* logger, Config* config, + std::string_view sendfile_header_name, + std::string_view sendfile_path_name) = 0; + + virtual std::unique_ptr<Transport::Response> create_ok_file( + Transport* transport, std::filesystem::path const& full_path, + std::string_view relative_path, std::string_view etag, + std::optional<uint64_t> size) = 0; + +protected: + SendFile() = default; + SendFile(SendFile const&) = delete; + SendFile& operator=(SendFile const&) = delete; +}; + +#endif // SEND_FILE_HH |
