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