Warning: Long paths on Windows and the
@@ -386,7 +389,7 @@ native pathname format.
The operating system dependent pathname format accepted by the host operating system.
-
+
A path with no redundant current directory (dot) or parent directory (dot-dot)
elements. The normal form for an empty path is an empty path. The normal form
for a path ending in a directory-separator that is not the root directory
@@ -998,6 +1001,8 @@ of a path. The path does not necessarily exist in external storage, and the
pathname is not necessarily valid for the current operating
system or for a particular file system.
+
+
namespace boost
{
namespace filesystem
@@ -1008,6 +1013,8 @@ system or for a particular file system.
typedef see below value_type;
typedef std::basic_string<value_type> string_type;
typedef std::codecvt<wchar_t, char, std::mbstate_t> codecvt_type;
+ constexpr value_type dot;
+ constexpr value_type separator;
constexpr value_type preferred_separator;
// constructors and destructor
@@ -1117,6 +1124,8 @@ system or for a particular file system.
// query
bool empty() const;
+ bool filename_is_dot() const;
+ bool filename_is_dot_dot() const;
bool has_root_name() const;
bool has_root_directory() const;
bool has_root_path() const;
@@ -1150,6 +1159,8 @@ system or for a particular file system.
} // namespace filesystem
} // namespace boost
+
+
value_type is a typedef for the
character type used by the operating system to represent pathnames.
@@ -1516,7 +1527,7 @@ does not affect path equality. —end example]
Returns: pathname.c_str().
-string_type::size_type size() const noexcept;
+string_type::size_type size() const noexcept;
Returns: pathname.size().
@@ -1704,11 +1715,10 @@ for (; !p.extension().empty(); p = p.stem())
—end example]
[Note: The dot is included in the return value so that it is
- possible to distinguish between no extension and an empty extension.
- See
-
- http://permalink.gmane.org/gmane.comp.lib.boost.devel/199744 for more
- extensive rationale. —end note]
+ possible to distinguish between no extension and an empty extension.
+ See
+ Returns: filename() == path(".")
+ [Example:
+
+
+ std::cout << path(".").filename_is_dot(); // outputs 1
+std::cout << path("/.").filename_is_dot(); // outputs 1
+std::cout << path("foo/.").filename_is_dot(); // outputs 1
+std::cout << path("foo/").filename_is_dot(); // outputs 1
+std::cout << path("/").filename_is_dot(); // outputs 0
+std::cout << path("/foo").filename_is_dot(); // outputs 0
+std::cout << path("/foo.").filename_is_dot(); // outputs 0
+std::cout << path("..").filename_is_dot(); // outputs 0
+
+
+ See the last bullet item in the forward traversal order
+ list for why path("foo/").filename() is a dot filename.
+ —end example]
+
+
+