]> Creatis software - gdcm.git/blob - src/gdcmContentEntry.h
8cb66a0a56d0586995df25e2584762269e20b908
[gdcm.git] / src / gdcmContentEntry.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmContentEntry.h,v $
5   Language:  C++
6   Date:      $Date: 2005/01/30 17:30:57 $
7   Version:   $Revision: 1.4 $
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 GDCMCONTENTENTRY_H
20 #define GDCMCONTENTENTRY_H
21
22 #include "gdcmDocEntry.h"
23
24 #include <iostream>
25
26 namespace gdcm 
27 {
28 //-----------------------------------------------------------------------------
29 /**
30  * \brief   Any Dicom Document (File or DicomDir) contains 
31  *           a set of DocEntry  - Dicom entries -
32  *           (when successfuly parsed against a given Dicom dictionary)
33  *          ContentEntry is an elementary DocEntry (as opposed to SeqEntry).
34  *          Depending on the type of its content,
35  *          ContentEntry is specialized as a ValEntry or a BinEntry
36  */
37 class GDCM_EXPORT ContentEntry  : public DocEntry
38 {
39 public:
40    virtual void WriteContent(std::ofstream *fp, FileType filetype) = 0;
41
42    // Accessors are protected, not to be invoked by end user
43
44    /// Sets the value (string) of the current Dicom entry
45    virtual void SetValue(std::string const &val) { Value = val; };
46  
47    /// \brief Returns the 'Value' (e.g. "Dupond Marcel") converted 
48    /// into a 'string', event if it's physically stored on disk as an integer
49    std::string const &GetValue() const { return Value; };
50
51    void Copy(DocEntry *doc);
52
53 protected:
54    // Contructors are protected, not to be invoked by end user.
55    ContentEntry(DictEntry *e);
56    ContentEntry(DocEntry *d); 
57    // Destructor is protected, not to be invoked by end user.
58    ~ContentEntry();
59
60 private:
61 // Members :
62    /// \brief Dicom entry value, internaly represented as a std::string.
63    ///        The Value Representation (\ref VR) is independently used
64    ///        in order to interpret (decode) this field.
65    std::string Value;
66 };
67
68 } // end namespace gdcm
69
70 //-----------------------------------------------------------------------------
71 #endif
72