Mercurial > hg > orthanc-databases
comparison Framework/Common/BinaryStringValue.h @ 243:f5dc59c56e65
simplification
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 13 Apr 2021 17:53:53 +0200 |
parents | 3236894320d6 |
children | 16aac0287485 |
comparison
equal
deleted
inserted
replaced
242:b97a537f4613 | 243:f5dc59c56e65 |
---|---|
31 { | 31 { |
32 private: | 32 private: |
33 std::string content_; | 33 std::string content_; |
34 | 34 |
35 public: | 35 public: |
36 explicit BinaryStringValue() | |
37 { | |
38 } | |
39 | |
40 explicit BinaryStringValue(const std::string& content) : | 36 explicit BinaryStringValue(const std::string& content) : |
41 content_(content) | 37 content_(content) |
42 { | 38 { |
43 } | |
44 | |
45 BinaryStringValue(const void* content, | |
46 size_t size) | |
47 { | |
48 content_.assign(reinterpret_cast<const char*>(content), size); | |
49 } | |
50 | |
51 std::string& GetContent() | |
52 { | |
53 return content_; | |
54 } | 39 } |
55 | 40 |
56 const std::string& GetContent() const | 41 const std::string& GetContent() const |
57 { | 42 { |
58 return content_; | 43 return content_; |
72 { | 57 { |
73 return ValueType_BinaryString; | 58 return ValueType_BinaryString; |
74 } | 59 } |
75 | 60 |
76 virtual IValue* Convert(ValueType target) const ORTHANC_OVERRIDE; | 61 virtual IValue* Convert(ValueType target) const ORTHANC_OVERRIDE; |
77 | |
78 virtual std::string Format() const ORTHANC_OVERRIDE; | |
79 }; | 62 }; |
80 } | 63 } |