comparison Core/TemporaryFile.h @ 2143:fd5875662670

creation of namespace SystemToolbox
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 09 Nov 2016 16:54:23 +0100
parents 5a8840920121
children a3a65de1840f
comparison
equal deleted inserted replaced
2142:5a8840920121 2143:fd5875662670
30 **/ 30 **/
31 31
32 32
33 #pragma once 33 #pragma once
34 34
35 #include <string>
36
37 #if !defined(ORTHANC_SANDBOXED) 35 #if !defined(ORTHANC_SANDBOXED)
38 # define ORTHANC_SANDBOXED 0 36 # error The macro ORTHANC_SANDBOXED must be defined
39 #endif 37 #endif
40 38
41 #if ORTHANC_SANDBOXED == 1 39 #if ORTHANC_SANDBOXED == 1
42 # error The class TemporaryFile cannot be used in sandboxed environments 40 # error The class TemporaryFile cannot be used in sandboxed environments
43 #endif 41 #endif
44 42
45 #include "Toolbox.h" 43 #include <string>
46 44
47 namespace Orthanc 45 namespace Orthanc
48 { 46 {
49 class TemporaryFile 47 class TemporaryFile
50 { 48 {
61 const std::string& GetPath() const 59 const std::string& GetPath() const
62 { 60 {
63 return path_; 61 return path_;
64 } 62 }
65 63
66 void Write(const std::string& content) 64 void Write(const std::string& content);
67 {
68 SystemToolbox::WriteFile(content, path_);
69 }
70 65
71 void Read(std::string& content) const 66 void Read(std::string& content) const;
72 {
73 SystemToolbox::ReadFile(content, path_);
74 }
75 }; 67 };
76 } 68 }