]> Creatis software - gdcm.git/blob - src/gdcmValEntry.h
* Test/PrintAllDocument.cxx: looping on files is now effective. It used to
[gdcm.git] / src / gdcmValEntry.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmValEntry.h,v $
5   Language:  C++
6   Date:      $Date: 2004/06/24 18:03:14 $
7   Version:   $Revision: 1.17 $
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
37    gdcmValEntry(gdcmDictEntry* e);
38
39    gdcmValEntry(gdcmDocEntry* d); 
40    virtual ~gdcmValEntry();
41
42    /// \brief Returns the 'Value' (e.g. "Dupond Marcel") converted into a
43    /// 'string', if it's stored as an integer in the header of the
44    /// current Dicom Document Entry
45    inline std::string  GetValue()     { return value; };
46     
47    /// Sets the value (string) of the current Dicom Document Entry
48    inline void SetValue(std::string val)  { value = val;  };
49         
50    /// Sets the value (void *) of the current Dicom Document Entry
51    inline void SetVoidArea(void * val)  { voidArea = val;  };
52            
53    virtual void Print(std::ostream &os = std::cout); 
54    virtual void Write(FILE *fp, FileType filetype);
55 protected:
56
57    /// \brief for 'non string' values. Will be move to gdcmBinEntry, later
58    void* voidArea;  // clean it out later
59    
60 private:
61
62 // Members :
63   
64    /// \brief Document Entry value, internaly represented as a std::string
65    ///        The Value Representation (\ref gdcmVR) is independently used
66    ///        in order to interpret (decode) this field.
67    std::string  value;
68 };
69
70 //-----------------------------------------------------------------------------
71 #endif
72