X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmUtil.cxx;h=44b894d409f3cdaee5064374a857d5efe0fc69f4;hb=edfc14dd195f9759cf02da0959d96d1499d572be;hp=b551067fad83ba2b2d15d34b399955c074554e6b;hpb=a0091d68a2eaa1a0c128f962030bb6c45cc0c366;p=gdcm.git diff --git a/src/gdcmUtil.cxx b/src/gdcmUtil.cxx index b551067f..44b894d4 100644 --- a/src/gdcmUtil.cxx +++ b/src/gdcmUtil.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmUtil.cxx,v $ Language: C++ - Date: $Date: 2004/11/16 02:54:35 $ - Version: $Revision: 1.64 $ + Date: $Date: 2004/11/16 16:49:01 $ + Version: $Revision: 1.67 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -27,12 +27,16 @@ #include //only included in implementation file #include //only included in implementation file -#include // for gethostname -#include // for gethostbyname +#if defined _MSC_VER || defined(__BORLANDC__) + #include // for gethostname & gethostbyname + #undef GetCurrentTime +#else + #include // for gethostname + #include // for gethostbyname +#endif namespace gdcm { - /** * \ingroup Globals * \brief Provide a better 'c++' approach for sprintf @@ -114,21 +118,21 @@ std::string Util::CreateCleanString(std::string const & s) { std::string str = s; - for(unsigned int i=0;i0) + if(str.size() > 0) { - if(!isprint(s[str.size()-1])) + if(!isprint((unsigned char)s[str.size()-1])) { - if(s[str.size()-1]==0) + if(s[str.size()-1] == 0) { - str[str.size()-1]=' '; + str[str.size()-1] = ' '; } } } @@ -139,7 +143,7 @@ std::string Util::CreateCleanString(std::string const & s) /** * \ingroup Globals * \brief Add a SEPARATOR to the end of the name is necessary - * @param name file/directory name to normalize + * @param pathname file/directory name to normalize */ std::string Util::NormalizePath(std::string const & pathname) { @@ -227,10 +231,12 @@ std::string Util::GetCurrentTime() } /** - * \ingroup Util * \brief Create a /DICOM/ string: * It should a of even length (no odd length ever) - * It can contains as many \0 as you want. + * It can contain as many (if you are reading this from your + * editor the following character is is backslash followed by zero + * that needed to be escaped with an extra backslash for doxygen) \\0 + * as you want. */ std::string Util::DicomString(const char* s, size_t l) { @@ -243,7 +249,10 @@ std::string Util::DicomString(const char* s, size_t l) * \ingroup Util * \brief Create a /DICOM/ string: * It should a of even lenght (no odd length ever) - * It can contains as many \0 as you want. + * It can contain as many (if you are reading this from your + * editor the following character is is backslash followed by zero + * that needed to be escaped with an extra backslash for doxygen) \\0 + * as you want. * This function is similar to DicomString(const char*), * except it doesn't take a lenght. * It only pad with a null character if length is odd