diff options
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 |
