GDCM 3.0.24
gdcmPreamble.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: GDCM (Grassroots DICOM). A DICOM library
4
5 Copyright (c) 2006-2011 Mathieu Malaterre
6 All rights reserved.
7 See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
8
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the above copyright notice for more information.
12
13=========================================================================*/
14#ifndef GDCMPREAMBLE_H
15#define GDCMPREAMBLE_H
16
17#include "gdcmTypes.h"
18#include "gdcmVL.h"
19
20namespace gdcm
21{
22
27{
28public:
31
32 friend std::ostream &operator<<(std::ostream &_os, const Preamble &_val);
33
35 void Clear();
36
38 void Valid();
39 void Create();
40 void Remove();
41
43 std::istream &Read(std::istream &is);
44
46 std::ostream const &Write(std::ostream &os) const;
47
49 void Print(std::ostream &os) const;
50
52 const char *GetInternal() const { return Internal; }
53
55 bool IsEmpty() const { return !Internal; }
56
58 VL GetLength() const { return 128 + 4; }
59
60 Preamble(Preamble const &):Internal(nullptr)
61 {
62 Create();
63 }
65 {
66 Create();
67 return *this;
68 }
69protected:
70 //
71 bool IsValid() const {
72 // is (IsValid == true) => Internal was read
73 return true;
74 }
75
76private:
77 char *Internal;
78};
79//-----------------------------------------------------------------------------
80inline std::ostream& operator<<(std::ostream &os, const Preamble &val)
81{
82 os << val.Internal;
83 return os;
84}
85
86} // end namespace gdcm
87
88#endif //GDCMPREAMBLE_H
DICOM Preamble (Part 10)
Definition gdcmPreamble.h:27
Preamble(Preamble const &)
Definition gdcmPreamble.h:60
bool IsValid() const
Definition gdcmPreamble.h:71
void Clear()
Clear.
void Print(std::ostream &os) const
Print Preamble.
void Valid()
Set Preamble to the default one.
bool IsEmpty() const
Check if Preamble is empty.
Definition gdcmPreamble.h:55
std::ostream const & Write(std::ostream &os) const
Write Preamble.
std::istream & Read(std::istream &is)
Read Preamble.
Preamble & operator=(Preamble const &)
Definition gdcmPreamble.h:64
VL GetLength() const
Return size of Preamble.
Definition gdcmPreamble.h:58
const char * GetInternal() const
Get internal pointer to preamble.
Definition gdcmPreamble.h:52
Value Length.
Definition gdcmVL.h:30
#define GDCM_EXPORT
Definition gdcmWin32.h:34
Definition gdcmASN1.h:21
std::ostream & operator<<(std::ostream &os, const Directory &d)
Definition gdcmDirectory.h:88