Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef GDCMGROUPDICT_H
00017 #define GDCMGROUPDICT_H
00018
00019 #include "gdcmTypes.h"
00020
00021 #include <assert.h>
00022 #include <vector>
00023 #include <string>
00024 #include <iostream>
00025 #include <iomanip>
00026
00027 namespace gdcm
00028 {
00034 class GDCM_EXPORT GroupDict
00035 {
00036 public:
00037 typedef std::vector<std::string> GroupStringVector;
00038 GroupDict() { FillDefaultGroupName(); }
00039 ~GroupDict() {}
00040
00041 friend std::ostream& operator<<(std::ostream& _os, const GroupDict &_val);
00042
00043 unsigned long Size() const
00044 {
00045 assert( Names.size() == Abbreviations.size() );
00046 return Names.size(); }
00047
00048 std::string const &GetAbbreviation(uint16_t num) const;
00049
00050 std::string const &GetName(uint16_t num) const;
00051
00052 protected:
00053 void Add(std::string const &abbreviation, std::string const &name);
00054 void Insert(uint16_t num, std::string const &abbreviation, std::string const &name);
00055
00056 private:
00057
00058 void FillDefaultGroupName();
00059
00060 GroupDict &operator=(const GroupDict &_val);
00061 GroupDict(const GroupDict &_val);
00062
00063 GroupStringVector Abbreviations;
00064 GroupStringVector Names;
00065 };
00066
00067 inline std::ostream& operator<<(std::ostream& _os, const GroupDict &_val)
00068 {
00069 unsigned int size = _val.Size();
00070 for(unsigned int i=0; i<size; ++i)
00071 {
00072 _os << std::hex << std::setw(4) << std::setfill( '0' ) << i << ","
00073 << _val.GetAbbreviation(i) << "," << _val.GetName(i) << "\n";
00074 }
00075 return _os;
00076 }
00077
00078 }
00079
00080 #endif //GDCMGROUPDICT_H