X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmElValSet.h;h=0d22c603b68fa15257a072c400353ddd1d805859;hb=f04b9ef9bad66e1847e8139db9cd4126e4340301;hp=e59c9fe3875208497803614dd805fd42cdb9b254;hpb=565a47ec4e037897aaf770aeccc5d67d7ad7b478;p=gdcm.git diff --git a/src/gdcmElValSet.h b/src/gdcmElValSet.h index e59c9fe3..0d22c603 100644 --- a/src/gdcmElValSet.h +++ b/src/gdcmElValSet.h @@ -1,39 +1,61 @@ -// gdcmElValSet.h +// $Header: /cvs/public/gdcm/src/Attic/gdcmElValSet.h,v 1.18 2003/11/10 09:21:40 jpr Exp $ #ifndef GDCMELVALSET_H #define GDCMELVALSET_H -#include // FIXME For FILE on GCC only -#include #include "gdcmCommon.h" #include "gdcmElValue.h" +#include // FIXME For FILE on GCC only +#include +#include // for linking together *all* the Dicom Elements + //////////////////////////////////////////////////////////////////////////// // Container for a set of successfully parsed ElValues. -typedef map TagElValueHT; -typedef map TagElValueNameHT; -class GDCM_EXPORT ElValSet { - TagElValueHT tagHt; // Both accesses with a TagKey or with a - TagElValueNameHT NameHt; // the DictEntry.Name are required. +typedef std::map TagElValueHT; +typedef std::map TagElValueNameHT; + +typedef std::string GroupKey; +typedef std::map GroupHT; + +typedef std::list ListTag; // for linking together the Elements + +class GDCM_EXPORT gdcmElValSet { + TagElValueHT tagHt; // Both accesses with a TagKey or with a + TagElValueNameHT NameHt; // the DictEntry.Name are required. + ListTag listElem; + public: - void Add(ElValue*); - void Print(ostream &); - void PrintByName(ostream &); - int Write(FILE *fp); - ElValue* GetElementByNumber(guint32 group, guint32 element); - ElValue* GetElementByName (string); - string GetElValueByNumber(guint32 group, guint32 element); - string GetElValueByName (string); + ~gdcmElValSet(); + void Add(gdcmElValue*); + + void Print(std::ostream &); + void PrintByName(std::ostream &); + int Write(FILE *fp, FileType type); + + gdcmElValue* GetElementByNumber(guint16 group, guint16 element); + gdcmElValue* GetElementByName (std::string); + std::string GetElValueByNumber(guint16 group, guint16 element); + std::string GetElValueByName (std::string); - TagElValueHT & GetTagHt(void); + TagElValueHT & GetTagHt(void); + ListTag & GetListElem(void); - int SetElValueByNumber(string content, guint32 group, guint32 element); - int SetElValueByName (string content, string TagName); + int SetElValueByNumber(std::string content, guint16 group, guint16 element); + int SetElValueByName (std::string content, std::string TagName); - int SetElValueLengthByNumber(guint32 l, guint32 group, guint32 element); - int SetElValueLengthByName (guint32 l, string TagName); + int SetElValueLengthByNumber(guint32 l, guint16 group, guint16 element); + int SetElValueLengthByName (guint32 l, std::string TagName); + + int SetVoidAreaByNumber(void *a, guint16 Group, guint16 Elem ); + guint32 GenerateFreeTagKeyInGroup(guint16 group); + int CheckIfExistByNumber(guint16 Group, guint16 Elem ); + +private: + void UpdateGroupLength(bool SkipSequence = false, FileType type = ImplicitVR); + void WriteElements(FileType type, FILE *); }; #endif