]> Creatis software - gdcm.git/blob - Testing/TestHash.cxx
* ENH add self defined param 'new' to PrintHeader to 'show' the SeQuence
[gdcm.git] / Testing / TestHash.cxx
1 #include <map>
2 #include <string>
3 #include <iostream>
4 #include <stdio.h>
5
6 int hashtest( int, char * [] ) {
7
8   typedef std::map<std::string, char*> dict;
9   
10    dict tb1;
11    dict::iterator im = tb1.find("00380010");
12    tb1["00100010"] = "Patient Name";
13    tb1["7fe00010"] = "Pixel Data";
14    tb1["50000010"] = "Number of points";
15    tb1["00380010"] = "Admission ID";
16
17    std::cout << "Traversal of dictionary (note the proper ordering on key)." << std::endl;
18    for ( im = tb1.begin(); im != tb1.end(); ++im )
19       std::cout << "   \"" << im->first << "\" = " << im->second << std::endl;
20    std::cout << "End of dictionary." << std::endl;
21
22    std::cout << "Find request on key 00380010" << std::endl;
23    im = tb1.find("00380010");
24    std::cout << "   \"" << im->first << "\" = " << im->second << std::endl;
25         
26    int i = 0x0010;
27    std::cout.setf(std::ios::hex);
28    std::cout << i << std::endl;
29    std::cout.setf(std::ios::dec);
30    std::cout << i << std::endl; 
31         
32         // Voir :
33         //http://www.developer.com/net/cplus/article.php/10919_2119781_3
34         //
35         // dommage que ca ne marche pas ...
36
37   return 0;
38 }