X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Testing%2FTestUtil.cxx;h=be81795aea0dd8e77c976c4570fe32ad9a3f0f5d;hb=223e9fe80278019fef96c2b926c4df6fcacd4d3b;hp=9574fece0029b8e6bc44831d0cfb22c29506a0fb;hpb=3e82e8b67eddf5d4b95b6aa2a2e2615aced4c452;p=gdcm.git diff --git a/Testing/TestUtil.cxx b/Testing/TestUtil.cxx index 9574fece..be81795a 100644 --- a/Testing/TestUtil.cxx +++ b/Testing/TestUtil.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestUtil.cxx,v $ Language: C++ - Date: $Date: 2005/02/02 10:05:26 $ - Version: $Revision: 1.10 $ + Date: $Date: 2005/02/17 11:14:56 $ + Version: $Revision: 1.13 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -24,6 +24,88 @@ int TestUtil(int , char *[]) { + unsigned int i; + + // Seeing at a glance HOW int16, int32, float, double, + // are implanted in memory + uint16_t u16 = 0x0102; + uint32_t u32 = 0x01020304; + float flt= 1.0; + double dbl=1.0; + + std::cout << "---------- uint16 : " << std::dec < [" << y <<"]" << std::endl; + + + // CountSubstring : substring id "#@-" + x = "abcd#@-wyz*@-lmn#@-uvw-#@ijk"; + std::cout << "in [" << x << "] " << std::endl; + std::cout << " - count '#@-' : " + << gdcm::Util::CountSubstring(x, "#@-") << std::endl; + + // Tokenize : tokens are '#', '@', '-' + std::vector tokens; + std::cout << " - use tokens '#@-' :" << std::endl; + gdcm::Util::Tokenize (x, tokens, "#@-"); + for (unsigned int ui=0; ui