5#include <boost/filesystem/operations.hpp>
7#include <userver/fs/blocking/c_file.hpp>
8#include <userver/utils/cpu_relax.hpp>
9#include <userver/utils/fast_pimpl.hpp>
11#include <userver/dump/factory.hpp>
12#include <userver/dump/operations.hpp>
14USERVER_NAMESPACE_BEGIN
19class FileWriter
final :
public Writer {
23 explicit FileWriter(std::string path, boost::filesystem::perms perms,
29 void WriteRaw(std::string_view data)
override;
32 std::string final_path_;
34 boost::filesystem::perms perms_;
39class FileReader
final :
public Reader {
48 std::string_view ReadRaw(std::size_t max_size)
override;
52 std::string curr_chunk_;
57 explicit FileOperationsFactory(boost::filesystem::perms perms);
59 std::unique_ptr<Reader> CreateReader(std::string full_path)
override;
61 std::unique_ptr<Writer> CreateWriter(std::string full_path,
62 tracing::ScopeTime& scope)
override;
65 const boost::filesystem::perms perms_;