GDCM  2.2.0
gdcmPDBElement.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program: GDCM (Grassroots DICOM). A DICOM library
00004 
00005   Copyright (c) 2006-2011 Mathieu Malaterre
00006   All rights reserved.
00007   See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
00008 
00009      This software is distributed WITHOUT ANY WARRANTY; without even
00010      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00011      PURPOSE.  See the above copyright notice for more information.
00012 
00013 =========================================================================*/
00014 #ifndef GDCMPDBELEMENT_H
00015 #define GDCMPDBELEMENT_H
00016 
00017 #include "gdcmTag.h"
00018 #include "gdcmVM.h"
00019 #include "gdcmVR.h"
00020 #include "gdcmByteValue.h"
00021 #include "gdcmSmartPointer.h"
00022 
00023 namespace gdcm
00024 {
00029 class GDCM_EXPORT PDBElement
00030 {
00031 public:
00032   PDBElement() {}
00033 
00034   friend std::ostream& operator<<(std::ostream &os, const PDBElement &val);
00035 
00037   const char *GetName() const { return NameField.c_str(); }
00038   void SetName(const char *name) { NameField = name; }
00039 
00041   const char *GetValue() const { return ValueField.c_str(); }
00042   void SetValue(const char *value) { ValueField = value; }
00043 
00044   bool operator==(const PDBElement &de) const
00045     {
00046     return ValueField == de.ValueField
00047       && NameField == de.NameField;
00048     }
00049 
00050 protected:
00051   std::string NameField;
00052   std::string ValueField;
00053 };
00054 //-----------------------------------------------------------------------------
00055 inline std::ostream& operator<<(std::ostream &os, const PDBElement &val)
00056 {
00057   os << val.NameField;
00058   os << " \"";
00059   os << val.ValueField;
00060   os << "\"";
00061 
00062   return os;
00063 }
00064 
00065 } // end namespace gdcm
00066 
00067 #endif //GDCMPDBELEMENT_H

Generated on Tue Mar 27 2012 18:19:33 for GDCM by doxygen 1.8.0
SourceForge.net Logo