vega
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
raw_value.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <vector>
4 #include <memory>
5 
6 #include "vega/vega.h"
7 #include "vega/vr.h"
8 
9 namespace vega {
10  namespace dicom {
11  class RawValue {
12  public:
13  class InvalidRawValue : public vega::Exception {};
14 
15  typedef std::vector<char> byte_buffer_type;
16 
17  private:
18  std::shared_ptr<byte_buffer_type> m_bytes;
19 
20  public:
21  RawValue();
22  explicit RawValue(size_t num_bytes);
23  explicit RawValue(const std::string& s);
24  RawValue(const char * const begin, const char * const end);
25 
26  std::shared_ptr<byte_buffer_type> bytes();
27 
28  void set_bytes(std::shared_ptr<byte_buffer_type> bytes);
29 
30  void resize(size_t num_bytes);
31  size_t size() const;
32 
33  char* data();
34  const char* data() const;
35 
36  std::string str() const;
37 
38  byte_buffer_type::iterator begin();
39  byte_buffer_type::const_iterator begin() const;
40 
41  byte_buffer_type::iterator end();
42  byte_buffer_type::const_iterator end() const;
43  };
44  }
45 }
The base class for exceptions that are raised by the vega library.
Definition: vega.h:11
Definition: age.h:6