X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmUtil.cxx;h=01808c8189c8a4a680da44edc54d0969fdeec552;hb=692c278613503559a7e64e475374f3e06f6da257;hp=bf200b0d212847dceaf3fdba5c7851194af7e85e;hpb=f2956b2e24eb931cbd41e1c8e536259c93d325fa;p=gdcm.git diff --git a/src/gdcmUtil.cxx b/src/gdcmUtil.cxx index bf200b0d..01808c81 100644 --- a/src/gdcmUtil.cxx +++ b/src/gdcmUtil.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmUtil.cxx,v $ Language: C++ - Date: $Date: 2005/08/22 16:17:54 $ - Version: $Revision: 1.159 $ + Date: $Date: 2005/10/20 07:25:10 $ + Version: $Revision: 1.166 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -179,10 +179,46 @@ int Util::CountSubstring (const std::string &str, return count; } +/** + * \brief Checks whether a 'string' is printable or not (in order + * to avoid corrupting the terminal of invocation when printing) + * @param s string to check + */ +bool Util::IsCleanString(std::string const &s) +{ + std::cout<< std::endl << s << std::endl; + for(unsigned int i=0; i> 8 ) & 0x00ff ) ); - //save CPU time - swap = ( val << 8 | val >> 8 ); + swap = ( val << 8 | val >> 8 ); return os.write(reinterpret_cast(&swap), 2); #else @@ -898,9 +956,6 @@ std::ostream &binary_write(std::ostream &os, const uint32_t &val) { #if defined(GDCM_WORDS_BIGENDIAN) || defined(GDCM_FORCE_BIGENDIAN_EMULATION) uint32_t swap; -// swap = ( ((val<<24) & 0xff000000) | ((val<<8) & 0x00ff0000) | -// ((val>>8) & 0x0000ff00) | ((val>>24) & 0x000000ff) ); -// save CPU time swap = ( (val<<24) | ((val<<8) & 0x00ff0000) | ((val>>8) & 0x0000ff00) | (val>>24) ); return os.write(reinterpret_cast(&swap), 4);