X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmUtil.cxx;h=19895c1f4e960b4b09ff98135f55a897a9d7d5a3;hb=6eb024e510fd273aea3e31e85630d6b36ff18c0c;hp=936e0dde2985bf64a8f3a43c250290de15514f26;hpb=cfc4bc0156d2846054d5e79cc6a9b5770a2a729f;p=gdcm.git diff --git a/src/gdcmUtil.cxx b/src/gdcmUtil.cxx index 936e0dde..19895c1f 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/11/29 13:02:46 $ - Version: $Revision: 1.179 $ + Date: $Date: 2006/01/10 15:54:03 $ + Version: $Revision: 1.182 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -194,7 +194,6 @@ int Util::CountSubstring (const std::string &str, */ bool Util::IsCleanString(std::string const &s) { - //std::cout<< std::endl << s << std::endl; for(unsigned int i=0; i pos2 ) @@ -313,7 +321,9 @@ std::string Util::GetPath(std::string const &fullName) { res.resize(pos2); } - +*/ + int pos = res.rfind(GDCM_FILESEPARATOR); + res.resize(pos); return res; } @@ -324,10 +334,14 @@ std::string Util::GetPath(std::string const &fullName) std::string Util::GetName(std::string const &fullName) { std::string filename = fullName; - +/* std::string::size_type slash_pos = filename.rfind("/"); std::string::size_type backslash_pos = filename.rfind("\\"); - slash_pos = slash_pos > backslash_pos ? slash_pos : backslash_pos; + // At least with my gcc4.0.1, unfound char results in pos =4294967295 ... + //slash_pos = slash_pos > backslash_pos ? slash_pos : backslash_pos; + slash_pos = slash_pos < backslash_pos ? slash_pos : backslash_pos; +*/ + std::string::size_type slash_pos = filename.rfind(GDCM_FILESEPARATOR); if (slash_pos != std::string::npos ) { return filename.substr(slash_pos + 1); @@ -483,8 +497,8 @@ std::string Util::DicomString(const char *s) /** * \brief Safely check the equality of two Dicom String: * - Both strings should be of even length - * - We allow padding of even length string by either a null - * character of a space + * - We allow padding of even length string by either + * a null character of a space */ bool Util::DicomStringEqual(const std::string &s1, const char *s2) { @@ -501,8 +515,8 @@ bool Util::DicomStringEqual(const std::string &s1, const char *s2) /** * \brief Safely compare two Dicom String: * - Both strings should be of even length - * - We allow padding of even length string by either a null - * character of a space + * - We allow padding of even length string by either + * a null character of a space */ bool Util::CompareDicomString(const std::string &s1, const char *s2, int op) {