00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
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
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
00124 DictEntry *GetDictEntry(uint16_t group, uint16_t elem);
00125
00126
00128 DocEntry *PreviousDocEntry;
00129
00130 private:
00131 };
00132
00133 }
00134
00135 #endif
00136