X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Testing%2FTestHash.cxx;h=463352494bcdea2309c84076aaa579c3d9b4d89c;hb=6b91390e1086959c40c0ae9a37912877a6f14c36;hp=56cbdfcdfe16d6281bc92e157db99d6cc2188406;hpb=9d439450a43135ddd30761ed598dd2bbfcfe26b8;p=gdcm.git diff --git a/Testing/TestHash.cxx b/Testing/TestHash.cxx index 56cbdfcd..46335249 100644 --- a/Testing/TestHash.cxx +++ b/Testing/TestHash.cxx @@ -1,24 +1,38 @@ #include #include #include +#include -int main() -{ - typedef map dict; +int TestHash( int, char * [] ) { + + typedef std::map dict; - dict tb1; - dict::iterator im = tb1.find("00380010"); - tb1["00100010"] = "Patient Name"; - tb1["7fe00010"] = "Pixel Data"; - tb1["50000010"] = "Number of points"; - tb1["00380010"] = "Admission ID"; + dict tb1; + dict::iterator im = tb1.find("00380010"); + tb1["00100010"] = "Patient Name"; + tb1["7fe00010"] = "Pixel Data"; + tb1["50000010"] = "Number of points"; + tb1["00380010"] = "Admission ID"; + + std::cout << "Traversal of dictionary (note the proper ordering on key)." << std::endl; + for ( im = tb1.begin(); im != tb1.end(); ++im ) + std::cout << " \"" << im->first << "\" = " << im->second << std::endl; + std::cout << "End of dictionary." << std::endl; - cout << "Traversal of dictionary (note the proper ordering on key)." << endl; - for ( dict::iterator im = tb1.begin(); im != tb1.end(); ++im ) - cout << " \"" << im->first << "\" = " << im->second << endl; - cout << "End of dictionary." << endl; + std::cout << "Find request on key 00380010" << std::endl; + im = tb1.find("00380010"); + std::cout << " \"" << im->first << "\" = " << im->second << std::endl; + + int i = 0x0010; + std::cout.setf(std::ios::hex); + std::cout << i << std::endl; + std::cout.setf(std::ios::dec); + std::cout << i << std::endl; + + // Voir : + //http://www.developer.com/net/cplus/article.php/10919_2119781_3 + // + // dommage que ca ne marche pas ... - cout << "Find request on key 00380010" << endl; - im = tb1.find("00380010"); - cout << " \"" << im->first << "\" = " << im->second << endl; + return 0; }