comparison Core/Images/PamReader.h @ 2705:5c18a22cb981

fix portability of PAM reader/writer
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 06 Jul 2018 16:33:03 +0200
parents be6d7acf4e94
children 9b4251721f22
comparison
equal deleted inserted replaced
2704:b71c59312bae 2705:5c18a22cb981
33 33
34 #pragma once 34 #pragma once
35 35
36 #include "ImageAccessor.h" 36 #include "ImageAccessor.h"
37 37
38 #include "../Enumerations.h"
39
40 #include <vector>
41 #include <stdint.h>
42 #include <boost/shared_ptr.hpp>
43 #include <boost/noncopyable.hpp>
44 #include <istream>
45
46 #if !defined(ORTHANC_SANDBOXED) 38 #if !defined(ORTHANC_SANDBOXED)
47 # error The macro ORTHANC_SANDBOXED must be defined 39 # error The macro ORTHANC_SANDBOXED must be defined
48 #endif 40 #endif
41
42 #include <boost/noncopyable.hpp>
49 43
50 namespace Orthanc 44 namespace Orthanc
51 { 45 {
52 class PamReader : 46 class PamReader :
53 public ImageAccessor, 47 public ImageAccessor,
54 public boost::noncopyable 48 public boost::noncopyable
55 { 49 {
56 private: 50 private:
57 std::vector<char> data_; 51 void ParseContent();
52
53 std::string content_;
58 54
59 public: 55 public:
60 PamReader() {}
61 virtual ~PamReader() {}
62
63 #if ORTHANC_SANDBOXED == 0 56 #if ORTHANC_SANDBOXED == 0
64 void ReadFromFile(const std::string& filename); 57 void ReadFromFile(const std::string& filename);
65 #endif 58 #endif
66 59
67 void ReadFromMemory(const void* buffer,
68 size_t size);
69
70 void ReadFromMemory(const std::string& buffer); 60 void ReadFromMemory(const std::string& buffer);
71
72 protected:
73 void ReadFromStream(std::istream& input);
74 }; 61 };
75 } 62 }