# gdcmPDBElement.h

Go to the documentation of this file.

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