X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=Testing%2FTestDict.cxx;h=db151958f1c070bd188ea57bbd73d2fa9262e369;hb=4b66b19dfd3c15f96b843923ca587252bf988cde;hp=f138cd71bf80b0e867473720ca5bda8a22772c62;hpb=5fc5d5558df907b8fb7e9c61a574b038fd3f7ebf;p=gdcm.git diff --git a/Testing/TestDict.cxx b/Testing/TestDict.cxx index f138cd71..db151958 100644 --- a/Testing/TestDict.cxx +++ b/Testing/TestDict.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestDict.cxx,v $ Language: C++ - Date: $Date: 2005/01/14 17:31:57 $ - Version: $Revision: 1.2 $ + Date: $Date: 2005/01/24 14:14:09 $ + Version: $Revision: 1.5 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -30,11 +30,24 @@ int TestDict(int , char* []) gdcm::DictSet *dicts=gdcm::Global::GetDicts(); if(!dicts) { - std::cout<<"The DictSet hasn't be found... Failed\n"; + std::cout<<"DictSet hasn't be found... Failed\n"; return(1); } + std::cout<<"DictSet content :\n"; -// dicts->Print(std::cout); + + gdcm::Dict *d = dicts->GetFirstEntry(); + if (!d) + { + std::cout << "Dictset is empty" << std::endl; + return 1; + } + while (d) + { + std::cout << "------------- a Dict is found : ----------" << std::endl; + d->Print(); + d = dicts->GetNextEntry(); + } // Print the Dict (public) std::cout<<"#######################################################\n"; @@ -45,29 +58,30 @@ int TestDict(int , char* []) return(1); } std::cout<<"Public Dict content :\n"; -// pubDict->Print(std::cout); +// pubDict->Print(); // Print the DictEntry (0x10,0x20) std::cout<<"#######################################################\n"; const int ENTRY_GR = 0x10; const int ENTRY_EL = 0x20; std::string key=gdcm::DictEntry::TranslateToKey(ENTRY_GR,ENTRY_EL); - gdcm::DictEntry *entry=pubDict->GetDictEntry(ENTRY_GR,ENTRY_EL); + gdcm::DictEntry *entry=pubDict->GetEntry(ENTRY_GR,ENTRY_EL); if(!entry) { std::cout<<"The DictEntry hasn't be found... Failed\n"; return(1); } std::cout<<"Entry "<Print(std::cout); + entry->Print(); // Print all the DictEntry std::cout<<"#######################################################\n"; - pubDict->InitTraversal(); - entry=pubDict->GetNextEntry(); + entry=pubDict->GetFirstEntry(); while(entry) { - entry->Print(std::cout); + std::cout << entry->GetGroup() << "|" << entry->GetElement() + << " [" << entry->GetVR() << "] - M" << entry->GetVM() + << " : " << entry->GetName() << " ( " << entry->GetKey() << ")\n"; entry=pubDict->GetNextEntry(); }