]> Creatis software - gdcm.git/blob - src/gdcmBinEntry.h
e1f3c045d8671863b78d41ca13165feb4734b7ff
[gdcm.git] / src / gdcmBinEntry.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmBinEntry.h,v $
5   Language:  C++
6   Date:      $Date: 2005/01/16 04:50:41 $
7   Version:   $Revision: 1.31 $
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 GDCMBINENTRY_H
20 #define GDCMBINENTRY_H
21
22 #include "gdcmValEntry.h"
23 #include <iostream>
24
25 namespace gdcm 
26 {
27
28 //-----------------------------------------------------------------------------
29 /**
30  * \brief   Any Dicom Document (File Header or DicomDir) contains 
31  *           a set of DocEntry entries 
32  *          (when successfuly parsed against a given Dicom dictionary)
33  *          BinEntry is a specialisation of ValEntry (for non std::string
34  *          representable values)
35  */
36  
37 class GDCM_EXPORT BinEntry  : public ValEntry
38 {
39 public:
40    BinEntry( DictEntry *e );
41    BinEntry( DocEntry *d ); 
42
43    ~BinEntry();
44    
45    void Print( std::ostream &os = std::cout, std::string const & indent = "" );
46    void WriteContent( std::ofstream *fp, FileType ft);
47
48    /// \brief Returns the area value of the current Dicom Header Entry
49    ///  when it's not string-translatable (e.g : a LUT table)         
50    uint8_t *GetBinArea()  { return BinArea; }
51    void  SetBinArea( uint8_t *area, bool self = true );
52
53    /// Sets the value (string) of the current Dicom Document Entry
54    virtual void SetValue(std::string const &val) { SetValueOnly(val); };
55 private:
56    /// \brief unsecure memory area to hold 'non string' values 
57    ///       (ie : Lookup Tables, overlays, icons)   
58    uint8_t *BinArea;
59    bool SelfArea;
60 };
61 } // end namespace gdcm
62 //-----------------------------------------------------------------------------
63 #endif
64