]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/filesystem/src/portability.cpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / libs / filesystem / src / portability.cpp
index fc7186d74f5dfc1ea054d5c7cd69461303accde1..cda7236c4d1df2e0226b7a21218df6d123b8cf08 100644 (file)
@@ -9,11 +9,8 @@
 
 //--------------------------------------------------------------------------------------//
 
-#ifndef BOOST_SYSTEM_NO_DEPRECATED
-# define BOOST_SYSTEM_NO_DEPRECATED
-#endif
+#include "platform_config.hpp"
 
-#include <boost/filesystem/config.hpp>
 #include <boost/filesystem/path.hpp>
 
 namespace fs = boost::filesystem;
@@ -56,7 +53,7 @@ namespace boost
 #   else
     BOOST_FILESYSTEM_DECL bool native(const std::string & name)
     {
-      return  name.size() != 0
+      return !name.empty()
         && name[0] != ' '
         && name.find('/') == std::string::npos;
     }
@@ -64,24 +61,23 @@ namespace boost
 
     BOOST_FILESYSTEM_DECL bool portable_posix_name(const std::string & name)
     {
-      return name.size() != 0
+      return !name.empty()
         && name.find_first_not_of(valid_posix) == std::string::npos;
     }
 
     BOOST_FILESYSTEM_DECL bool windows_name(const std::string & name)
     {
-      return name.size() != 0
+      return !name.empty()
         && name[0] != ' '
         && name.find_first_of(windows_invalid_chars) == std::string::npos
         && *(name.end()-1) != ' '
         && (*(name.end()-1) != '.'
-          || name.length() == 1 || name == "..");
+          || name.size() == 1 || name == "..");
     }
 
     BOOST_FILESYSTEM_DECL bool portable_name(const std::string & name)
     {
-      return
-        name.size() != 0
+      return !name.empty()
         && (name == "."
           || name == ".."
           || (windows_name(name)
@@ -107,8 +103,7 @@ namespace boost
          && name != ".."
          && ((pos = name.find('.')) == std::string::npos
              || (name.find('.', pos+1) == std::string::npos
-               && (pos + 5) > name.length()))
-        ;
+               && (pos + 5) > name.size()));
     }
 
   } // namespace filesystem