]> Creatis software - gdcm.git/blob - src/gdcmValEntry.h
f2811f75135772db71d9446a16f5c3402b9bee2e
[gdcm.git] / src / gdcmValEntry.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmValEntry.h,v $
5   Language:  C++
6   Date:      $Date: 2004/09/03 20:27:44 $
7   Version:   $Revision: 1.21 $
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.htm 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 <iostream>
23 #include <stdio.h>
24
25 #include "gdcmDocEntry.h"
26
27 //-----------------------------------------------------------------------------
28 /**
29  * \ingroup gdcmValEntry
30  * \brief   The dicom header of a Dicom file contains a set of such entries
31  *          (when successfuly parsed against a given Dicom dictionary)
32  */
33 class GDCM_EXPORT gdcmValEntry  : public gdcmDocEntry
34 {
35 public:
36    gdcmValEntry(gdcmDictEntry* e);
37    gdcmValEntry(gdcmDocEntry* d); 
38    virtual ~gdcmValEntry();
39
40    /// \brief Returns the 'Value' (e.g. "Dupond Marcel") converted into a
41    /// 'string', if it's stored as an integer in the header of the
42    /// current Dicom Document Entry
43    std::string GetValue() { return Value; };
44     
45    /// Sets the value (string) of the current Dicom Document Entry
46    void SetValue(std::string const & val) { Value = val; };
47
48    /// Sets the value (void *) of the current Dicom Document Entry
49    void SetVoidArea(void * val) { VoidArea = val; };
50
51    virtual void Print(std::ostream &os = std::cout); 
52    virtual void Write(FILE *fp, FileType filetype);
53
54 protected:
55    /// \brief for 'non string' values. Will be move to gdcmBinEntry, later
56    void* VoidArea;  // clean it out later
57    
58 private:
59 // Members :
60   
61    /// \brief Document Entry value, internaly represented as a std::string
62    ///        The Value Representation (\ref gdcmVR) is independently used
63    ///        in order to interpret (decode) this field.
64    std::string  Value;
65 };
66
67 //-----------------------------------------------------------------------------
68 #endif
69