comparison OrthancFramework/Sources/SystemToolbox.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 ab4d015af660
comparison
equal deleted inserted replaced
4184:dbd74fa2f446 4185:b289a1234822
50 50
51 static ServerBarrierEvent ServerBarrier(); 51 static ServerBarrierEvent ServerBarrier();
52 52
53 static void ReadFile(std::string& content, 53 static void ReadFile(std::string& content,
54 const std::string& path, 54 const std::string& path,
55 bool log = true); 55 bool log);
56
57 static void ReadFile(std::string& content,
58 const std::string& path)
59 {
60 ReadFile(content, path, true /* log */);
61 }
56 62
57 static bool ReadHeader(std::string& header, 63 static bool ReadHeader(std::string& header,
58 const std::string& path, 64 const std::string& path,
59 size_t headerSize); 65 size_t headerSize);
60 66
61 static void WriteFile(const void* content, 67 static void WriteFile(const void* content,
62 size_t size, 68 size_t size,
63 const std::string& path); 69 const std::string& path,
70 bool callFsync);
71
72 static void WriteFile(const void* content,
73 size_t size,
74 const std::string& path)
75 {
76 WriteFile(content, size, path, false /* don't automatically call fsync */);
77 }
64 78
65 static void WriteFile(const std::string& content, 79 static void WriteFile(const std::string& content,
66 const std::string& path); 80 const std::string& path,
81 bool callFsync);
82
83 static void WriteFile(const std::string& content,
84 const std::string& path)
85 {
86 WriteFile(content, path, false /* don't automatically call fsync */);
87 }
67 88
68 static void RemoveFile(const std::string& path); 89 static void RemoveFile(const std::string& path);
69 90
70 static uint64_t GetFileSize(const std::string& path); 91 static uint64_t GetFileSize(const std::string& path);
71 92