]> Creatis software - gdcm.git/blob - src/gdcmValEntry.h
* Prepare the modifications for a new DocEntry structuration
[gdcm.git] / src / gdcmValEntry.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmValEntry.h,v $
5   Language:  C++
6   Date:      $Date: 2005/09/02 07:10:03 $
7   Version:   $Revision: 1.42 $
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 "gdcmContentEntry.h"
24
25 #include <iostream>
26
27 namespace gdcm 
28 {
29 //-----------------------------------------------------------------------------
30 /**
31  * \brief   Any Dicom Document (File or DicomDir) contains 
32  *           a set of DocEntry  - Dicom entries -
33  *          ValEntry is an elementary DocEntry (i.e. a ContentEntry, 
34  *           as opposed to SeqEntry)
35  *          whose content is 'std::string representable' : characters,
36  *          or integers (loaded in memory as a std::string)
37  *          ValEntry is a specialisation of ContentEntry
38  */
39 class GDCM_EXPORT ValEntry  : public ContentEntry
40 {
41 public:
42
43    // Contructors and Destructor are public.
44    ValEntry(DictEntry *e);
45    ValEntry(DocEntry *d); 
46
47    ~ValEntry();
48
49    // Other accessors are inherited from gdcm::ContentEntry
50
51    void Print(std::ostream &os = std::cout, std::string const &indent = ""); 
52
53    void WriteContent(std::ofstream *fp, FileType filetype); 
54    
55    /// Sets the value (string) of the current Dicom entry.
56    /// The size is updated
57    void SetValue(std::string const &val);
58
59
60    /// \brief returns the size threshold above which an element value 
61    ///        will NOT be *printed* in order no to polute the screen output
62    static long GetMaxSizePrintEntry() { return ValEntry::MaxSizePrintEntry; }
63
64    static void SetMaxSizePrintEntry(long);
65
66 protected:
67    
68 private:
69
70    /// \brief Size threshold above which an element val
71    ///        By default, this upper bound is fixed to 64 bytes.
72
73    static uint32_t MaxSizePrintEntry;   
74
75 };
76
77 } // end namespace gdcm
78
79 //-----------------------------------------------------------------------------
80 #endif
81