comparison OrthancFramework/Sources/FileStorage/FilesystemStorage.h @ 4185:b289a1234822

giving a try to cross-platform compilation of SyncStorageArea
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 14 Sep 2020 18:09:30 +0200
parents bf7b9edf6b81
children 7112a8af0b63
comparison
equal deleted inserted replaced
4184:dbd74fa2f446 4185:b289a1234822
46 friend class FilesystemHttpSender; 46 friend class FilesystemHttpSender;
47 friend class FileStorageAccessor; 47 friend class FileStorageAccessor;
48 48
49 private: 49 private:
50 boost::filesystem::path root_; 50 boost::filesystem::path root_;
51 bool fsyncOnWrite_;
51 52
52 boost::filesystem::path GetPath(const std::string& uuid) const; 53 boost::filesystem::path GetPath(const std::string& uuid) const;
53 54
55 void Setup(const std::string& root);
56
54 public: 57 public:
55 explicit FilesystemStorage(std::string root); 58 explicit FilesystemStorage(const std::string& root) :
59 fsyncOnWrite_(false)
60 {
61 Setup(root);
62 }
63
64 FilesystemStorage(const std::string& root,
65 bool fsyncOnWrite) :
66 fsyncOnWrite_(fsyncOnWrite)
67 {
68 Setup(root);
69 }
56 70
57 virtual void Create(const std::string& uuid, 71 virtual void Create(const std::string& uuid,
58 const void* content, 72 const void* content,
59 size_t size, 73 size_t size,
60 FileContentType type); 74 FileContentType type);