Add class path constexpr constants separator and dot of the type appropriate for the platform, and add class path member query functions filename_is_dot() and filename_is_dot_dot(). These add convenience and the implementations may be more efficient that user coded equivalent functions. Also add detail functions is_directory_separator() and is_element_separator(), and replace all uses of local is_separator() in path.cpp with detail::is_directory_separator().

This commit is contained in:
Beman
2015-12-01 10:17:45 -05:00
parent 7b31aa0259
commit 2f6391b931
7 changed files with 219 additions and 76 deletions

View File

@@ -937,12 +937,9 @@ namespace detail
BOOST_FILESYSTEM_DECL
bool create_directories(const path& p, system::error_code* ec)
{
path filename(p.filename());
if ((filename.native().size() == 1 && filename.native()[0] == dot)
|| (filename.native().size() == 2
&& filename.native()[0] == dot && filename.native()[1] == dot))
if (p.filename_is_dot() || p.filename_is_dot_dot())
return create_directories(p.parent_path(), ec);
error_code local_ec;
file_status p_status = status(p, local_ec);