-// $Header: /cvs/public/gdcm/src/Attic/gdcmElValSet.h,v 1.8 2003/04/08 15:03:35 frog Exp $
+// $Header: /cvs/public/gdcm/src/Attic/gdcmElValSet.h,v 1.15 2003/06/26 13:07:01 jpr Exp $
#ifndef GDCMELVALSET_H
#define GDCMELVALSET_H
////////////////////////////////////////////////////////////////////////////
// Container for a set of successfully parsed ElValues.
-typedef map<TagKey, gdcmElValue*> TagElValueHT;
-typedef map<string, gdcmElValue*> TagElValueNameHT;
+
+typedef std::map<TagKey, gdcmElValue*> TagElValueHT;
+typedef std::map<std::string, gdcmElValue*> TagElValueNameHT;
class GDCM_EXPORT gdcmElValSet {
- TagElValueHT tagHt; // Both accesses with a TagKey or with a
- TagElValueNameHT NameHt; // the DictEntry.Name are required.
-//FIXME This is redundant with gdcmHeader::FileType enum. That sux !
+ TagElValueHT tagHt; // Both accesses with a TagKey or with a
+ TagElValueNameHT NameHt; // the DictEntry.Name are required.
+
+ typedef std::string GroupKey;
+ typedef std::map<GroupKey, int> GroupHT;
public:
- void Add(gdcmElValue*);
- // TODO
- //void ReplaceOrCreate(gdcmElValue*);
- void Print(ostream &);
- void PrintByName(ostream &);
- int Write(FILE *fp, FileType type);
-
- gdcmElValue* GetElementByNumber(guint16 group, guint16 element);
- gdcmElValue* GetElementByName (string);
- string GetElValueByNumber(guint16 group, guint16 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);
- int SetElValueByNumber(string content, guint16 group, guint16 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, guint16 group, guint16 element);
- int SetElValueLengthByName (guint32 l, string TagName);
+ int SetElValueLengthByNumber(guint32 l, guint16 group, guint16 element);
+ int SetElValueLengthByName (guint32 l, std::string TagName);
guint32 GenerateFreeTagKeyInGroup(guint16 group);
+ int CheckIfExistByNumber(guint16 Group, guint16 Elem );
private:
- void UpdateGroupLength(bool SkipSequence = false);
+ void UpdateGroupLength(bool SkipSequence = false, FileType type = ImplicitVR);
void WriteElements(FileType type, FILE *);
-
};
#endif