gdcmDocEntrySet.h

Go to the documentation of this file.
00001 /*=========================================================================
00002                                                                                 
00003   Program:   gdcm
00004   Module:    $RCSfile: gdcmDocEntrySet.h,v $
00005   Language:  C++
00006   Date:      $Date: 2007/08/22 16:14:04 $
00007   Version:   $Revision: 1.71 $
00008                                                                                 
00009   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
00010   l'Image). All rights reserved. See Doc/License.txt or
00011   http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
00012                                                                                 
00013      This software is distributed WITHOUT ANY WARRANTY; without even
00014      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00015      PURPOSE.  See the above copyright notices for more information.
00016                                                                                 
00017 =========================================================================*/
00018 
00019 #ifndef _GDCMDOCENTRYSET_H_
00020 #define _GDCMDOCENTRYSET_H_
00021 
00022 #include "gdcmRefCounter.h"
00023 #include "gdcmVRKey.h"
00024 #include "gdcmTagKey.h"
00025 
00026 #include <fstream>
00027 
00028 namespace GDCM_NAME_SPACE 
00029 {
00030 //-----------------------------------------------------------------------------
00031 class DocEntry;
00032 class DataEntry;
00033 class SeqEntry;
00034 class DictEntry;
00035 
00036 //-----------------------------------------------------------------------------
00061 class GDCM_EXPORT DocEntrySet : public RefCounter
00062 {
00063    gdcmTypeMacro(DocEntrySet);
00064 
00065 public:
00067    virtual void WriteContent (std::ofstream *fp, FileType filetype,
00068                                                  bool insideMetaElements) = 0;
00069 
00071    virtual void ClearEntry() = 0;
00073    virtual bool AddEntry(DocEntry *entry) = 0;
00075    virtual bool RemoveEntry(DocEntry *entryToRemove) = 0;
00077    virtual DocEntry *GetFirstEntry()=0;
00079    virtual DocEntry *GetNextEntry()=0;
00080 
00081    virtual std::string GetEntryString(uint16_t group, uint16_t elem);
00082    virtual void *GetEntryBinArea(uint16_t group, uint16_t elem);
00083    virtual int GetEntryLength(uint16_t group, uint16_t elem);
00084 
00086    virtual DocEntry *GetDocEntry(uint16_t group, uint16_t elem) = 0;
00088    DataEntry *GetDataEntry(uint16_t group, uint16_t elem);
00090    SeqEntry *GetSeqEntry(uint16_t group, uint16_t elem);
00091 
00092    bool SetEntryString(std::string const &content,
00093                        uint16_t group, uint16_t elem);
00094    bool SetEntryBinArea(uint8_t *content, int lgth,
00095                         uint16_t group, uint16_t elem);
00096    bool SetEntryString(std::string const &content, DataEntry *entry);
00097    bool SetEntryBinArea(uint8_t *content, int lgth, DataEntry *entry);
00098 
00099    DataEntry *InsertEntryString(std::string const &value,
00100                                    uint16_t group, uint16_t elem,
00101                                    VRKey const &vr = GDCM_VRUNKNOWN);
00102    DataEntry *InsertEntryBinArea(uint8_t *binArea, int lgth,
00103                                     uint16_t group, uint16_t elem,
00104                                     VRKey const &vr = GDCM_VRUNKNOWN);
00105    SeqEntry *InsertSeqEntry(uint16_t group, uint16_t elem);
00107    virtual bool IsEmpty() = 0;
00108    virtual bool CheckIfEntryExist(uint16_t group, uint16_t elem);
00109 
00110 // DocEntry  related utilities 
00111    DataEntry *NewDataEntry(uint16_t group,uint16_t elem,
00112                          VRKey const &vr = GDCM_VRUNKNOWN);
00113    SeqEntry *NewSeqEntry(uint16_t group, uint16_t elem);
00114 
00115    virtual void Copy(DocEntrySet *) {};
00116 
00117 protected:
00119    DocEntrySet();
00121    virtual ~DocEntrySet() {}
00122 
00123 // DictEntry  related utilities
00124    DictEntry *GetDictEntry(uint16_t group, uint16_t elem);
00125  //  DictEntry *GetDictEntry(uint16_t group, uint16_t elem,
00126  //                          VRKey const &vr);
00128    DocEntry *PreviousDocEntry;
00129 
00130 private:
00131 };
00132 
00133 } // end namespace gdcm
00134 //-----------------------------------------------------------------------------
00135 #endif
00136 

Generated on Fri Aug 24 12:59:30 2007 for gdcm by  doxygen 1.4.6