]> Creatis software - gdcm.git/blob - src/gdcmBinEntry.h
cff1942ba83eaa04fa6e06e484e6932905bbd29b
[gdcm.git] / src / gdcmBinEntry.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmBinEntry.h,v $
5   Language:  C++
6   Date:      $Date: 2005/09/02 07:10:03 $
7   Version:   $Revision: 1.38 $
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 "gdcmContentEntry.h"
23 #include <iostream>
24
25 namespace gdcm 
26 {
27
28 //-----------------------------------------------------------------------------
29 /**
30  * \brief   Any Dicom Document (File or DicomDir) contains 
31  *           a set of DocEntry - Dicom entries - 
32  *          BinEntry is an elementary DocEntry (i.e. a ContentEntry, 
33  *           as opposed to SeqEntry) whose content is non std::string
34  *          representable
35  *          BinEntry is a specialisation of ContentEntry
36  */
37  
38 class GDCM_EXPORT BinEntry  : public ContentEntry
39 {
40 public:
41    BinEntry( DictEntry *e );
42    BinEntry( DocEntry *d ); 
43
44    ~BinEntry();
45    
46    void Print( std::ostream &os = std::cout, std::string const &indent = "" );
47
48    void WriteContent( std::ofstream *fp, FileType ft);
49
50    /// \brief Returns the area value of the current Dicom Entry
51    ///  when it's not string-translatable (e.g : LUT table, overlay, icon)         
52    uint8_t *GetBinArea()  { return BinArea; }
53    void  SetBinArea( uint8_t *area, bool self = true );
54
55    /// \brief Sets SelfArea
56    void SetSelfArea(bool area) { SelfArea = area; }
57    /// \brief Returns SelfArea
58    bool IsSelfArea() { return SelfArea; }
59
60 private:
61    /// \brief memory area to hold 'non std::string' representable values 
62    ///       (ie : Lookup Tables, overlays, icons)   
63    uint8_t *BinArea;
64    /// \brief Whether BinEntry has its own BinArea or not
65    bool SelfArea;
66 };
67
68 } // end namespace gdcm
69 //-----------------------------------------------------------------------------
70 #endif
71