comparison Core/Toolbox.h @ 2063:ed383e7a6753

cont
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 04 Jul 2016 15:50:11 +0200
parents 54417b0831c4
children 272094362301
comparison
equal deleted inserted replaced
2062:40ffd0e8676a 2063:ed383e7a6753
63 const std::string& source); 63 const std::string& source);
64 64
65 void ToLowerCase(std::string& result, 65 void ToLowerCase(std::string& result,
66 const std::string& source); 66 const std::string& source);
67 67
68 #if !defined(ORTHANC_SANDBOXED) || ORTHANC_SANDBOXED != 1
68 void ReadFile(std::string& content, 69 void ReadFile(std::string& content,
69 const std::string& path); 70 const std::string& path);
70 71 #endif
72
73 #if !defined(ORTHANC_SANDBOXED) || ORTHANC_SANDBOXED != 1
71 bool ReadHeader(std::string& header, 74 bool ReadHeader(std::string& header,
72 const std::string& path, 75 const std::string& path,
73 size_t headerSize); 76 size_t headerSize);
74 77 #endif
78
79 #if !defined(ORTHANC_SANDBOXED) || ORTHANC_SANDBOXED != 1
75 void WriteFile(const std::string& content, 80 void WriteFile(const std::string& content,
76 const std::string& path); 81 const std::string& path);
77 82 #endif
83
84 #if !defined(ORTHANC_SANDBOXED) || ORTHANC_SANDBOXED != 1
78 void WriteFile(const void* content, 85 void WriteFile(const void* content,
79 size_t size, 86 size_t size,
80 const std::string& path); 87 const std::string& path);
88 #endif
81 89
82 #if !defined(ORTHANC_SANDBOXED) || ORTHANC_SANDBOXED != 1 90 #if !defined(ORTHANC_SANDBOXED) || ORTHANC_SANDBOXED != 1
83 void USleep(uint64_t microSeconds); 91 void USleep(uint64_t microSeconds);
84 #endif 92 #endif
85 93
94 #if !defined(ORTHANC_SANDBOXED) || ORTHANC_SANDBOXED != 1
86 void RemoveFile(const std::string& path); 95 void RemoveFile(const std::string& path);
96 #endif
87 97
88 void SplitUriComponents(UriComponents& components, 98 void SplitUriComponents(UriComponents& components,
89 const std::string& uri); 99 const std::string& uri);
90 100
91 void TruncateUri(UriComponents& target, 101 void TruncateUri(UriComponents& target,
98 std::string AutodetectMimeType(const std::string& path); 108 std::string AutodetectMimeType(const std::string& path);
99 109
100 std::string FlattenUri(const UriComponents& components, 110 std::string FlattenUri(const UriComponents& components,
101 size_t fromLevel = 0); 111 size_t fromLevel = 0);
102 112
113 #if !defined(ORTHANC_SANDBOXED) || ORTHANC_SANDBOXED != 1
103 uint64_t GetFileSize(const std::string& path); 114 uint64_t GetFileSize(const std::string& path);
115 #endif
104 116
105 #if !defined(ORTHANC_ENABLE_MD5) || ORTHANC_ENABLE_MD5 == 1 117 #if !defined(ORTHANC_ENABLE_MD5) || ORTHANC_ENABLE_MD5 == 1
106 void ComputeMD5(std::string& result, 118 void ComputeMD5(std::string& result,
107 const std::string& data); 119 const std::string& data);
108 120
175 187
176 void TokenizeString(std::vector<std::string>& result, 188 void TokenizeString(std::vector<std::string>& result,
177 const std::string& source, 189 const std::string& source,
178 char separator); 190 char separator);
179 191
192 #if !defined(ORTHANC_SANDBOXED) || ORTHANC_SANDBOXED != 1
180 void MakeDirectory(const std::string& path); 193 void MakeDirectory(const std::string& path);
181 194 #endif
195
196 #if !defined(ORTHANC_SANDBOXED) || ORTHANC_SANDBOXED != 1
182 bool IsExistingFile(const std::string& path); 197 bool IsExistingFile(const std::string& path);
198 #endif
183 199
184 #if ORTHANC_PUGIXML_ENABLED == 1 200 #if ORTHANC_PUGIXML_ENABLED == 1
185 void JsonToXml(std::string& target, 201 void JsonToXml(std::string& target,
186 const Json::Value& source, 202 const Json::Value& source,
187 const std::string& rootElement = "root", 203 const std::string& rootElement = "root",
199 bool StartsWith(const std::string& str, 215 bool StartsWith(const std::string& str,
200 const std::string& prefix); 216 const std::string& prefix);
201 217
202 int GetProcessId(); 218 int GetProcessId();
203 219
220 #if !defined(ORTHANC_SANDBOXED) || ORTHANC_SANDBOXED != 1
204 bool IsRegularFile(const std::string& path); 221 bool IsRegularFile(const std::string& path);
222 #endif
205 223
206 FILE* OpenFile(const std::string& path, 224 FILE* OpenFile(const std::string& path,
207 FileMode mode); 225 FileMode mode);
208 226
209 void UriEncode(std::string& target, 227 void UriEncode(std::string& target,