/*========================================================================= Program: gdcm Module: $RCSfile: TestUtil.cxx,v $ Language: C++ Date: $Date: 2005/02/14 16:46:15 $ Version: $Revision: 1.12 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ // This test should test everything in Util, since I didn't know any other // way to test this class. #include "gdcmUtil.h" #include "gdcmDebug.h" #include int TestUtil(int , char *[]) { // CreateCleanString std::string x = "a#@-bc\tdef"; std::string y = gdcm::Util::CreateCleanString(x); std::cout << "[" << x <<"] --> [" << y <<"]" << std::endl; // CountSubstring : substring id "#@-" x = "abcd#@-wyz*@-lmn#@-uvw-#@ijk"; std::cout << "count '#@-' in [" << x << "] : " << gdcm::Util::CountSubstring(x, "#@-") << std::endl; // Tokenize : tokens are '#', '@', '-' std::vector tokens; gdcm::Util::Tokenize (x, tokens, "#@-"); for (unsigned int ui=0; ui