33 VL(uint32_t vl = 0) : ValueLength(vl) { }
40 return ValueLength == 0xFFFFFFFF;
43 ValueLength = 0xFFFFFFFF;
48 return !IsUndefined() && ValueLength % 2;
53 ValueLength += vl.ValueLength;
61 uint32_t tmp(ValueLength);
66 operator uint32_t ()
const {
return ValueLength; }
74 friend std::ostream&
operator<<(std::ostream& os,
const VL& vl);
79 template <
typename TSwap>
80 std::istream &
Read(std::istream &is)
82 is.read((
char*)(&ValueLength),
sizeof(uint32_t));
83 TSwap::SwapArray(&ValueLength,1);
87 template <
typename TSwap>
88 std::istream &
Read16(std::istream &is)
91 is.read((
char*)(©),
sizeof(uint16_t));
92 TSwap::SwapArray(©,1);
94 assert( ValueLength <= 65535 );
98 template <
typename TSwap>
99 const std::ostream &
Write(std::ostream &os)
const
101 uint32_t copy = ValueLength;
106 TSwap::SwapArray(©,1);
107 return os.write((
char*)(©),
sizeof(uint32_t));
110 template <
typename TSwap>
111 const std::ostream &
Write16(std::ostream &os)
const
113 assert( ValueLength <= 65535 );
114 uint16_t copy = (uint16_t)ValueLength;
119 TSwap::SwapArray(©,1);
120 return os.write((
char*)(©),
sizeof(uint16_t));
124 uint32_t ValueLength;
129 os << val.ValueLength;
VL GetLength() const
Definition: gdcmVL.h:68
VL operator++(int)
Definition: gdcmVL.h:60
VL(uint32_t vl=0)
Definition: gdcmVL.h:33
#define GDCM_EXPORT
Definition: gdcmWin32.h:34
Value Length.
Definition: gdcmVL.h:29
static uint16_t GetVL16Max()
Definition: gdcmVL.h:37
bool IsOdd() const
Return whether or not the VL is odd or not.
Definition: gdcmVL.h:47
std::ostream & operator<<(std::ostream &os, const Directory &d)
Definition: gdcmDirectory.h:88
std::istream & Read(std::istream &is)
Definition: gdcmVL.h:80
void SetToUndefined()
Definition: gdcmVL.h:42
const std::ostream & Write16(std::ostream &os) const
Definition: gdcmVL.h:111
const std::ostream & Write(std::ostream &os) const
Definition: gdcmVL.h:99
static uint32_t GetVL32Max()
Definition: gdcmVL.h:36
bool IsUndefined() const
Definition: gdcmVL.h:39
VL & operator+=(VL const &vl)
+= operator
Definition: gdcmVL.h:52
std::istream & Read16(std::istream &is)
Definition: gdcmVL.h:88
Definition: gdcmASN1.h:20
VL & operator++()
Definition: gdcmVL.h:56
uint32_t Type
Definition: gdcmVL.h:32