//--------------------------------------------------------------------------------------//
-#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;
# else
BOOST_FILESYSTEM_DECL bool native(const std::string & name)
{
- return name.size() != 0
+ return !name.empty()
&& name[0] != ' '
&& name.find('/') == std::string::npos;
}
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)
&& name != ".."
&& ((pos = name.find('.')) == std::string::npos
|| (name.find('.', pos+1) == std::string::npos
- && (pos + 5) > name.length()))
- ;
+ && (pos + 5) > name.size()));
}
} // namespace filesystem