2 //-----------------------------------------------------------------------------
3 #include "gdcmObject.h"
6 //-----------------------------------------------------------------------------
7 // Constructor / Destructor
11 * @param begin iterator of begin for the object
12 * @param end iterator of end for the object
14 gdcmObject::gdcmObject(ListTag::iterator begin,ListTag::iterator end)
20 dbg.Verbose(0, "gdcmObject::gdcmObject empty list");
25 * \brief Canonical destructor.
27 gdcmObject::~gdcmObject(void)
31 //-----------------------------------------------------------------------------
35 * \brief Prints the Object
38 void gdcmObject::Print(std::ostream &os)
42 for(ListTag::iterator i=beginObj;i!=endObj;++i)
44 (*i)->SetPrintLevel(printLevel);
50 //-----------------------------------------------------------------------------
54 * \brief Get an entry by number
57 std::string gdcmObject::GetEntryByNumber(guint16 group, guint16 element)
59 for(ListTag::iterator i=beginObj;i!=endObj;++i)
61 if ( (*i)->GetGroup()==group && (*i)->GetElement()==element)
62 return (*i)->GetValue();
70 * \brief Get an entry by name
71 * @param name name of the searched element.
74 std::string gdcmObject::GetEntryByName(TagName name)
76 gdcmDict *PubDict=gdcmGlobal::GetDicts()->GetDefaultPubDict();
77 gdcmDictEntry *dictEntry = (*PubDict).GetDictEntryByName(name);
79 if( dictEntry == NULL)
81 return GetEntryByNumber(dictEntry->GetGroup(),dictEntry->GetElement());
86 * \brief Get all entries in a hash table
89 TagHeaderEntryHT gdcmObject::GetEntry(void)
93 for(ListTag::iterator it=beginObj;it!=endObj;++it)
95 HT.insert( PairHT( (*it)->GetKey(),(*it)) );
102 * \ingroup gdcmObject
103 * \brief Get all entries in a list
106 ListTag gdcmObject::GetListEntry(void)
110 for(ListTag::iterator it=beginObj;it!=endObj;++it)
118 //-----------------------------------------------------------------------------
121 //-----------------------------------------------------------------------------
124 //-----------------------------------------------------------------------------