]> Creatis software - gdcm.git/blob - src/gdcmValEntry.h
f9fa8beb9c72a2a45da252aed63cdfe446d5e3cd
[gdcm.git] / src / gdcmValEntry.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmValEntry.h,v $
5   Language:  C++
6   Date:      $Date: 2004/10/10 00:42:55 $
7   Version:   $Revision: 1.25 $
8                                                                                 
9   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10   l'Image). All rights reserved. See Doc/License.txt or
11   http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
12                                                                                 
13      This software is distributed WITHOUT ANY WARRANTY; without even
14      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15      PURPOSE.  See the above copyright notices for more information.
16                                                                                 
17 =========================================================================*/
18
19 #ifndef GDCMVALENTRY_H
20 #define GDCMVALENTRY_H
21
22 #include "gdcmDocEntry.h"
23 #include <iostream>
24
25 //-----------------------------------------------------------------------------
26 /**
27  * \ingroup gdcmValEntry
28  * \brief   The dicom header of a Dicom file contains a set of such entries
29  *          (when successfuly parsed against a given Dicom dictionary)
30  */
31 class GDCM_EXPORT gdcmValEntry  : public gdcmDocEntry
32 {
33 public:
34    gdcmValEntry(gdcmDictEntry* e);
35    gdcmValEntry(gdcmDocEntry* d); 
36    virtual ~gdcmValEntry();
37
38    /// \brief Returns the 'Value' (e.g. "Dupond Marcel") converted into a
39    /// 'string', if it's stored as an integer in the header of the
40    /// current Dicom Document Entry
41    std::string & GetValue() { return Value; };
42     
43    /// Sets the value (string) of the current Dicom Document Entry
44    void SetValue(std::string const & val) { Value = val; };
45
46    virtual void Print(std::ostream &os = std::cout); 
47    virtual void Write(FILE *fp, FileType filetype);
48
49 protected:
50    
51 private:
52 // Members :
53   
54    /// \brief Document Entry value, internaly represented as a std::string
55    ///        The Value Representation (\ref gdcmVR) is independently used
56    ///        in order to interpret (decode) this field.
57    std::string  Value;
58 };
59
60 //-----------------------------------------------------------------------------
61 #endif
62