GDCM: gdcmPDBElement.h Source File

GDCM 3.2.8

gdcmPDBElement.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 GDCMPDBELEMENT_H
15#define GDCMPDBELEMENT_H
16
17#include "gdcmTag.h"
18#include "gdcmVM.h"
19#include "gdcmVR.h"
20#include "gdcmByteValue.h"
21#include "gdcmSmartPointer.h"
22
23namespace gdcm
24{
29 class GDCM_EXPORT PDBElement
30{
31public:
32 PDBElement() = default;
33
34 friend std::ostream& operator<<(std::ostream &os, const PDBElement &val);
35
37 const char *GetName() const { return NameField.c_str(); }
38 void SetName(const char *name) { NameField = name; }
39
41 const char *GetValue() const { return ValueField.c_str(); }
42 void SetValue(const char *value) { ValueField = value; }
43
44 bool operator==(const PDBElement &de) const
45 {
46 return ValueField == de.ValueField
47 && NameField == de.NameField;
48 }
49
50protected:
51 std::string NameField;
52 std::string ValueField;
53};
54//-----------------------------------------------------------------------------
55 inline std::ostream& operator<<(std::ostream &os, const PDBElement &val)
56{
57 os << val.NameField;
58 os << " \"";
59 os << val.ValueField;
60 os << "\"";
61
62 return os;
63}
64
65} // end namespace gdcm
66
67#endif //GDCMPDBELEMENT_H
gdcm::PDBElement::SetValue
void SetValue(const char *value)
Definition gdcmPDBElement.h:42
gdcm::PDBElement::operator==
bool operator==(const PDBElement &de) const
Definition gdcmPDBElement.h:44
gdcm::PDBElement::operator<<
friend std::ostream & operator<<(std::ostream &os, const PDBElement &val)
Definition gdcmPDBElement.h:55
gdcm::PDBElement::GetValue
const char * GetValue() const
Set/Get Value.
Definition gdcmPDBElement.h:41
gdcm::PDBElement::NameField
std::string NameField
Definition gdcmPDBElement.h:51
gdcm::PDBElement::SetName
void SetName(const char *name)
Definition gdcmPDBElement.h:38
gdcm::PDBElement::GetName
const char * GetName() const
Set/Get Name.
Definition gdcmPDBElement.h:37
gdcm::PDBElement::PDBElement
PDBElement()=default
gdcm::PDBElement::ValueField
std::string ValueField
Definition gdcmPDBElement.h:52
gdcmByteValue.h
gdcmSmartPointer.h
gdcmTag.h
gdcmVM.h
gdcmVR.h
GDCM_EXPORT
#define GDCM_EXPORT
Definition gdcmWin32.h:34
gdcm
Definition gdcmASN1.h:21
gdcm::operator<<
std::ostream & operator<<(std::ostream &os, const Directory &d)
Definition gdcmDirectory.h:88