]> Creatis software - gdcm.git/blob - src/gdcmBinEntry.h
* Test/TestUtil.cxx : reformat the source code
[gdcm.git] / src / gdcmBinEntry.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmBinEntry.h,v $
5   Language:  C++
6   Date:      $Date: 2004/12/07 13:39:32 $
7   Version:   $Revision: 1.28 $
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  * \ingroup BinEntry
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  *          This one contains a 'string value'.
34  */
35 class GDCM_EXPORT BinEntry  : public ValEntry
36 {
37 public:
38    BinEntry( DictEntry* e );
39    BinEntry( DocEntry* d ); 
40
41    ~BinEntry();
42    
43    void Print( std::ostream &os = std::cout );
44    void WriteContent( std::ofstream*, FileType );
45
46    /// \brief Returns the area value of the current Dicom Header Entry
47    ///  when it's not string-translatable (e.g : a LUT table)         
48    uint8_t* GetBinArea()  { return BinArea; }
49    void  SetBinArea( uint8_t* area, bool self = true );
50
51    /// Sets the value (string) of the current Dicom Document Entry
52    virtual void SetValue(std::string const & val) {SetValueOnly(val);};
53 private:
54    /// \brief unsecure memory area to hold 'non string' values 
55    ///       (ie : Lookup Tables, overlays, icons)   
56    uint8_t* BinArea;
57    bool SelfArea;
58 };
59 } // end namespace gdcm
60 //-----------------------------------------------------------------------------
61 #endif
62