1 /*=========================================================================
4 Module: $RCSfile: TestDict.cxx,v $
6 Date: $Date: 2005/01/17 14:18:48 $
7 Version: $Revision: 1.3 $
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<<"DictSet hasn't be found... Failed\n";
37 std::cout<<"DictSet content :\n";
39 dicts->InitTraversal();
40 gdcm::Dict *d = dicts->GetNextEntry();
43 std::cout << "Dictset is empty" << std::endl;
48 std::cout << "------------- a Dict is found : ----------" << std::endl;
50 d = dicts->GetNextEntry();
53 // Print the Dict (public)
54 std::cout<<"#######################################################\n";
55 gdcm::Dict *pubDict=dicts->GetDefaultPubDict();
58 std::cout<<"The public Dict hasn't be found... Failed\n";
61 std::cout<<"Public Dict content :\n";
64 // Print the DictEntry (0x10,0x20)
65 std::cout<<"#######################################################\n";
66 const int ENTRY_GR = 0x10;
67 const int ENTRY_EL = 0x20;
68 std::string key=gdcm::DictEntry::TranslateToKey(ENTRY_GR,ENTRY_EL);
69 gdcm::DictEntry *entry=pubDict->GetDictEntry(ENTRY_GR,ENTRY_EL);
72 std::cout<<"The DictEntry hasn't be found... Failed\n";
75 std::cout<<"Entry "<<key<<" content :\n";
78 // Print all the DictEntry
79 std::cout<<"#######################################################\n";
80 pubDict->InitTraversal();
81 entry=pubDict->GetNextEntry();
85 entry=pubDict->GetNextEntry();