1 /*=========================================================================
4 Module: $RCSfile: TestDict.cxx,v $
6 Date: $Date: 2005/01/14 17:31:57 $
7 Version: $Revision: 1.2 $
9 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10 l'Image). All rights reserved. See Doc/License.txt or
11 http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notices for more information.
17 =========================================================================*/
18 #include "gdcmGlobal.h"
19 #include "gdcmDictSet.h"
21 #include "gdcmDictEntry.h"
26 int TestDict(int , char* [])
29 std::cout<<"#######################################################\n";
30 gdcm::DictSet *dicts=gdcm::Global::GetDicts();
33 std::cout<<"The DictSet hasn't be found... Failed\n";
36 std::cout<<"DictSet content :\n";
37 // dicts->Print(std::cout);
39 // Print the Dict (public)
40 std::cout<<"#######################################################\n";
41 gdcm::Dict *pubDict=dicts->GetDefaultPubDict();
44 std::cout<<"The public Dict hasn't be found... Failed\n";
47 std::cout<<"Public Dict content :\n";
48 // pubDict->Print(std::cout);
50 // Print the DictEntry (0x10,0x20)
51 std::cout<<"#######################################################\n";
52 const int ENTRY_GR = 0x10;
53 const int ENTRY_EL = 0x20;
54 std::string key=gdcm::DictEntry::TranslateToKey(ENTRY_GR,ENTRY_EL);
55 gdcm::DictEntry *entry=pubDict->GetDictEntry(ENTRY_GR,ENTRY_EL);
58 std::cout<<"The DictEntry hasn't be found... Failed\n";
61 std::cout<<"Entry "<<key<<" content :\n";
62 entry->Print(std::cout);
64 // Print all the DictEntry
65 std::cout<<"#######################################################\n";
66 pubDict->InitTraversal();
67 entry=pubDict->GetNextEntry();
70 entry->Print(std::cout);
71 entry=pubDict->GetNextEntry();