[PATCH] D16948: [libcxx] Filesystem TS Part 1 -- path

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Sat Feb 6 15:40:21 PST 2016


On Sat, Feb 6, 2016 at 4:02 PM, Duncan P. N. Exon Smith <
dexonsmith at apple.com> wrote:

> Light review below, looks like great work.
>
> I noticed the tests seem somewhat inconsistent about whether to
> glue `&` to the type or use two spaces (i.e., ` & `).  Which one is
> preferred in this codebase?  Or is it laissez-faire?
>
> The rest of my comments are inline.
>
> > On 2016-Feb-06, at 12:48, Eric Fiselier via cfe-commits <
> cfe-commits at lists.llvm.org> wrote:
> >
> > EricWF updated this revision to Diff 47095.
> > EricWF added a comment.
> >
> > Remove unintentional change in CMake.
> >
> >
> > http://reviews.llvm.org/D16948
> >
> > Files:
> >  CMakeLists.txt
> >  include/experimental/__config
> >  include/experimental/filesystem
> >  include/iomanip
> >  lib/filesystem/CMakeLists.txt
> >  src/filesystem/path.cpp
> >  test/CMakeLists.txt
> >
> test/libcxx/experimental/filesystem/class.path/path.req/is_pathable.pass.cpp
> >  test/libcxx/test/config.py
> >
> test/std/experimental/filesystem/class.directory_entry/directory_entry.cons.pass.cpp
> >
> test/std/experimental/filesystem/class.directory_entry/directory_entry.mods.pass.cpp
> >
> test/std/experimental/filesystem/class.directory_entry/directory_entry.obs/comparisons.pass.cpp
> >
> test/std/experimental/filesystem/class.directory_entry/directory_entry.obs/path.pass.cpp
> >
> test/std/experimental/filesystem/class.directory_entry/directory_entry.obs/status.pass.cpp
> >
> test/std/experimental/filesystem/class.file_status/file_status.cons.pass.cpp
> >
> test/std/experimental/filesystem/class.file_status/file_status.mods.pass.cpp
> >
> test/std/experimental/filesystem/class.file_status/file_status.obs.pass.cpp
> >
> test/std/experimental/filesystem/class.filesystem_error/filesystem_error.members.pass.cpp
> >  test/std/experimental/filesystem/class.path/path.itr/iterator.pass.cpp
> >
> test/std/experimental/filesystem/class.path/path.member/path.append.pass.cpp
> >
> test/std/experimental/filesystem/class.path/path.member/path.assign/copy.pass.cpp
> >
> test/std/experimental/filesystem/class.path/path.member/path.assign/move.pass.cpp
> >
> test/std/experimental/filesystem/class.path/path.member/path.assign/source.pass.cpp
> >
> test/std/experimental/filesystem/class.path/path.member/path.compare.pass.cpp
> >
> test/std/experimental/filesystem/class.path/path.member/path.concat.pass.cpp
> >
> test/std/experimental/filesystem/class.path/path.member/path.construct/copy.pass.cpp
> >
> test/std/experimental/filesystem/class.path/path.member/path.construct/default.pass.cpp
> >
> test/std/experimental/filesystem/class.path/path.member/path.construct/move.pass.cpp
> >
> test/std/experimental/filesystem/class.path/path.member/path.construct/source.pass.cpp
> >
> test/std/experimental/filesystem/class.path/path.member/path.decompose/path.decompose.pass.cpp
> >
> test/std/experimental/filesystem/class.path/path.member/path.generic.obs/generic_string_alloc.pass.cpp
> >
> test/std/experimental/filesystem/class.path/path.member/path.generic.obs/named_overloads.pass.cpp
> >
> test/std/experimental/filesystem/class.path/path.member/path.modifiers/clear.pass.cpp
> >
> test/std/experimental/filesystem/class.path/path.member/path.modifiers/make_preferred.pass.cpp
> >
> test/std/experimental/filesystem/class.path/path.member/path.modifiers/remove_filename.pass.cpp
> >
> test/std/experimental/filesystem/class.path/path.member/path.modifiers/replace_extension.pass.cpp
> >
> test/std/experimental/filesystem/class.path/path.member/path.modifiers/replace_filename.pass.cpp
> >
> test/std/experimental/filesystem/class.path/path.member/path.modifiers/swap.pass.cpp
> >
> test/std/experimental/filesystem/class.path/path.member/path.native.obs/c_str.pass.cpp
> >
> test/std/experimental/filesystem/class.path/path.member/path.native.obs/named_overloads.pass.cpp
> >
> test/std/experimental/filesystem/class.path/path.member/path.native.obs/native.pass.cpp
> >
> test/std/experimental/filesystem/class.path/path.member/path.native.obs/operator_string.pass.cpp
> >
> test/std/experimental/filesystem/class.path/path.member/path.native.obs/string_alloc.pass.cpp
> >
> test/std/experimental/filesystem/class.path/path.member/path.query/tested_in_path_decompose.pass.cpp
> >
> test/std/experimental/filesystem/class.path/path.nonmember/append_op.pass.cpp
> >
> test/std/experimental/filesystem/class.path/path.nonmember/comparison_ops_tested_elsewhere.pass.cpp
> >
> test/std/experimental/filesystem/class.path/path.nonmember/hash_value_tested_elswhere.pass.cpp
> >
> test/std/experimental/filesystem/class.path/path.nonmember/path.factory.pass.cpp
> >
> test/std/experimental/filesystem/class.path/path.nonmember/path.io.pass.cpp
> >
> test/std/experimental/filesystem/class.path/path.nonmember/path.io.unicode_bug.pass.cpp
> >  test/std/experimental/filesystem/class.path/path.nonmember/swap.pass.cpp
> >  test/std/experimental/filesystem/class.path/synop.pass.cpp
> >  test/std/experimental/filesystem/fs.enum/check_bitmask_types.hpp
> >  test/std/experimental/filesystem/fs.enum/enum.copy_options.pass.cpp
> >  test/std/experimental/filesystem/fs.enum/enum.directory_options.pass.cpp
> >  test/std/experimental/filesystem/fs.enum/enum.file_type.pass.cpp
> >  test/std/experimental/filesystem/fs.enum/enum.perms.pass.cpp
> >
> test/std/experimental/filesystem/fs.error.report/tested_elsewhere.pass.cpp
> >
> test/std/experimental/filesystem/fs.filesystem.synopsis/file_time_type.pass.cpp
> >  test/std/experimental/filesystem/fs.req.macros/feature_macro.pass.cpp
> >  test/std/experimental/filesystem/fs.req.namespace/namespace.pass.cpp
> >  test/std/experimental/filesystem/static_test_env/bad_symlink
> >  test/std/experimental/filesystem/static_test_env/dir1/dir2/dir3/.gitkeep
> >  test/std/experimental/filesystem/static_test_env/dir1/file1
> >  test/std/experimental/filesystem/static_test_env/dir1/file2
> >  test/std/experimental/filesystem/static_test_env/empty_file
> >  test/std/experimental/filesystem/static_test_env/non_empty_file
> >  test/std/experimental/filesystem/static_test_env/symlink_to_empty_file
> >  test/std/experimental/filesystem/test.pass.cpp
> >  test/support/count_new.hpp
> >  test/support/filesystem_dynamic_test_helper.py
> >  test/support/filesystem_test_helper.hpp
> >  test/support/min_allocator.h
> >  test/support/test_iterators.h
> >  test/support/test_macros.h
> >
> > <D16948.47095.patch>_______________________________________________
> > cfe-commits mailing list
> > cfe-commits at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
> > Index: test/support/test_macros.h
> > ===================================================================
> > --- test/support/test_macros.h
> > +++ test/support/test_macros.h
> > @@ -91,8 +91,23 @@
> >  template <> struct static_assert_incomplete_test<true> {};
> >  template <unsigned> struct static_assert_check {};
> >
> > +template <class T, class U> struct test_is_same { enum { value =
> false}; };
> > +template <class T> struct test_is_same<T, T> { enum { value = true}; };
> > +
> > +
> >  } // end namespace test_detail
> >
> > +#define ASSERT_SAME_TYPE(...) \
> > +  static_assert(test_detail::test_is_same<__VA_ARGS__>::value, \
> > +    "Return type differs from expected type")
> > +
> > +#define ASSERT_NOEXCEPT(...)  \
> > +  static_assert(noexcept(__VA_ARGS__), "Expression expected to be
> noexcept")
> > +
> > +
> > +#define ASSERT_NOT_NOEXCEPT(...)  \
> > +  static_assert(noexcept(__VA_ARGS__) == false, "Expression expected
> NOT to be noexcept")
>
> Why not `!noexcept(__VA_ARGS__)`?
>

No particular reason. Just trying to clearly differentiate the two.


>
> > +
> >
> >  #if !TEST_HAS_FEATURE(cxx_rtti) && !defined(__cxx_rtti)
> >  #define TEST_HAS_NO_RTTI
> > @@ -107,4 +122,6 @@
> >  #define TEST_HAS_SANITIZERS
> >  #endif
> >
> > +
> > +
> >  #endif // SUPPORT_TEST_MACROS_HPP
> > Index: test/support/min_allocator.h
> > ===================================================================
> > --- test/support/min_allocator.h
> > +++ test/support/min_allocator.h
> > @@ -11,6 +11,7 @@
> >  #define MIN_ALLOCATOR_H
> >
> >  #include <cstddef>
> > +#include <cstdlib>
> >
> >  #include "test_macros.h"
> >
> > @@ -39,6 +40,55 @@
> >      friend bool operator!=(bare_allocator x, bare_allocator y) {return
> !(x == y);}
> >  };
> >
> > +struct malloc_allocator_base {
> > +    static size_t alloc_count;
> > +    static size_t dealloc_count;
> > +    static size_t outstanding_alloc;
>
> Why have this?  I would have expected.
> ```
> static size_t outstanding_alloc() { return alloc_count - dealloc_count; }
> ```
>
> Good point. Fixed.


> > +    static bool disable_default_constructor;
> > +
> > +    static void reset() {
> > +        assert(outstanding_alloc == 0);
>
> And here:
> ```
> assert(alloc_count == dealloc_count);
> ```
>
> > +        disable_default_constructor = false;
> > +        alloc_count = 0;
> > +        dealloc_count = 0;
> > +        outstanding_alloc = 0;
> > +    }
> > +};
> > +
> > +
> > +size_t malloc_allocator_base::alloc_count = 0;
> > +size_t malloc_allocator_base::dealloc_count = 0;
> > +size_t malloc_allocator_base::outstanding_alloc = 0;
> > +bool malloc_allocator_base::disable_default_constructor = false;
> > +
> > +
> > +template <class T>
> > +class malloc_allocator : public malloc_allocator_base
> > +{
> > +public:
> > +    typedef T value_type;
> > +
> > +    malloc_allocator() TEST_NOEXCEPT {
> assert(!disable_default_constructor); }
> > +
> > +    template <class U>
> > +    malloc_allocator(malloc_allocator<U>) TEST_NOEXCEPT {}
> > +
> > +    T* allocate(std::size_t n)
> > +    {;
>
> Nit: stray semi-colon.
>

Ack.

>
> > +        ++alloc_count; ++outstanding_alloc;
> > +        return static_cast<T*>(std::malloc(n*sizeof(T)));
> > +    }
> > +
> > +    void deallocate(T* p, std::size_t)
> > +    {
> > +        ++dealloc_count; --outstanding_alloc;
> > +        std::free(static_cast<void*>(p));
> > +    }
> > +
> > +    friend bool operator==(malloc_allocator, malloc_allocator) {return
> true;}
> > +    friend bool operator!=(malloc_allocator x, malloc_allocator y)
> {return !(x == y);}
> > +};
> > +
> >
> >  #if __cplusplus >= 201103L
> >
> > Index: test/support/filesystem_test_helper.hpp
> > ===================================================================
> > --- /dev/null
> > +++ test/support/filesystem_test_helper.hpp
> > @@ -0,0 +1,308 @@
> > +#ifndef FILESYSTEM_TEST_HELPER_HPP
> > +#define FILESYSTEM_TEST_HELPER_HPP
> > +
> > +#include <experimental/filesystem>
> > +#include <cassert>
> > +#include <cstdio> // for tempnam
> > +#include <string>
> > +
> > +namespace fs = std::experimental::filesystem;
> > +
> > +// static test helpers
> > +
> > +#ifndef LIBCXX_FILESYSTEM_STATIC_TEST_ROOT
> > +#warning "STATIC TESTS DISABLED"
> > +#else // LIBCXX_FILESYSTEM_STATIC_TEST_ROOT
> > +
> > +inline fs::path static_test_env_path()
> > +{
> > +    static const fs::path env_path = LIBCXX_FILESYSTEM_STATIC_TEST_ROOT;
> > +    return env_path;
> > +}
> > +
> > +inline fs::path make_static_env_path(fs::path const& p)
> > +{
> > +    return static_test_env_path() / p;
> > +}
> > +
> > +namespace StaticEnv {
> > +
> > +inline fs::path makePath(fs::path const& p) {
> > +    return static_test_env_path() / p;
> > +}
> > +
> > +static const fs::path EnvRoot = LIBCXX_FILESYSTEM_STATIC_TEST_ROOT;
> > +
> > +static const fs::path TestFileList[] = {
> > +        makePath("empty_file"),
> > +        makePath("non_empty_file"),
> > +        makePath("dir1/file1"),
> > +        makePath("dir1/file2")
> > +};
> > +const std::size_t TestFileListSize = sizeof(TestFileList) /
> sizeof(fs::path);
> > +
> > +static const fs::path TestDirList[] = {
> > +        makePath("dir1"),
> > +        makePath("dir1/dir2"),
> > +        makePath("dir1/dir2/dir3")
> > +};
> > +const std::size_t TestDirListSize = sizeof(TestDirList) /
> sizeof(fs::path);
> > +
> > +static const fs::path File          = TestFileList[0];
> > +static const fs::path Dir           = TestDirList[0];
> > +static const fs::path SymlinkToFile = makePath("symlink_to_empty_file");
> > +static const fs::path DNE           = makePath("DNE");
> > +
> > +} // namespace StaticEnv
> > +
> > +#endif // LIBCXX_FILESYSTEM_STATIC_TEST_ROOT
> > +
> > +
> > +#ifndef LIBCXX_FILESYSTEM_DYNAMIC_TEST_ROOT
> > +#warning LIBCXX_FILESYSTEM_DYNAMIC_TEST_ROOT must be defined
> > +#else // LIBCXX_FILESYSTEM_DYNAMIC_TEST_ROOT
> > +
> > +#ifndef LIBCXX_FILESYSTEM_DYNAMIC_TEST_HELPER
> > +#error LIBCXX_FILESYSTEM_DYNAMIC_TEST_HELPER must be defined
> > +#endif
> > +// dynamic test helpers
> > +
> > +inline fs::path test_env_path()
> > +{
> > +    static const fs::path env_path =
> LIBCXX_FILESYSTEM_DYNAMIC_TEST_ROOT;
> > +    return env_path;
> > +}
> > +
> > +inline fs::path random_env_path()
> > +{
> > +    // assert that tmpdir is not set.
> > +    char* tmpdir = std::getenv("TMPDIR");
> > +    assert(!tmpdir);
> > +    char* s = ::tempnam(test_env_path().c_str(), "test.");
> > +    fs::path p(s);
> > +    std::free(s);
> > +    return p;
> > +}
> > +
> > +inline std::string
> > +fs_make_cmd(std::string const& cmd_name, std::string const& arg)
> > +{
> > +    std::string cmd = cmd_name + "('" + arg + "')";
> > +    return cmd;
> > +}
> > +
> > +inline std::string
> > +fs_make_cmd(std::string const& cmd_name,std::string const& arg1,
> std::string const& arg2)
> > +{
> > +    std::string cmd = cmd_name + "('";
> > +    cmd += arg1 + "', '";
> > +    cmd += arg2 + "')";
> > +    return cmd;
> > +}
> > +
> > +inline std::string
> > +fs_make_cmd(std::string const& cmd_name, std::string const& arg1,
> std::size_t const& arg2)
> > +{
> > +    std::string cmd = cmd_name + "('";
> > +    cmd += arg1 + "', ";
> > +    cmd += std::to_string(arg2) + ")";
> > +    return cmd;
> > +}
> > +
> > +inline void fs_helper_run(std::string const& raw_cmd) {
> > +    // check that the fs test root in the enviroment matches what we
> were
> > +    // compiled with.
> > +    char* fs_root = std::getenv("LIBCXX_FILESYSTEM_DYNAMIC_TEST_ROOT");
> > +    assert(fs_root);
> > +    assert(std::string(fs_root) == LIBCXX_FILESYSTEM_DYNAMIC_TEST_ROOT);
> > +
> > +    std::string cmd = LIBCXX_FILESYSTEM_DYNAMIC_TEST_HELPER;
> > +    cmd += "\"";
> > +    cmd += raw_cmd;
> > +    cmd += "\"";
> > +    int ret = std::system(cmd.c_str());
> > +    assert(ret == 0);
> > +}
> > +
> > +struct scoped_test_env
> > +{
> > +    scoped_test_env()
> > +      : test_root(random_env_path())
> > +    {
> > +        fs_helper_run(fs_make_cmd("init", test_root));
> > +    }
> > +
> > +    scoped_test_env(scoped_test_env const &) = delete;
> > +    scoped_test_env & operator=(scoped_test_env const &) = delete;
> > +
> > +    ~scoped_test_env()
> > +    {
> > +        fs_helper_run(fs_make_cmd("clean", test_root));
> > +    }
> > +
> > +    fs::path make_env_path(fs::path const & p)
> > +    {
> > +        return test_root / p;
> > +    }
> > +
> > +    std::string sanitize_path(std::string const & raw)
> > +    {
> > +        if (raw.substr(0, test_root.native().size()) == test_root) {
> > +            return raw;
> > +        } else {
> > +            return test_root / fs::path(raw);
> > +        }
> > +    }
> > +
> > +    void create_file(std::string filename, std::size_t size = 0)
> > +    {
> > +        filename = sanitize_path(filename);
> > +        fs_helper_run(fs_make_cmd("create_file", filename, size));
> > +    }
> > +
> > +    void create_dir(std::string filename)
> > +    {
> > +        filename = sanitize_path(filename);
> > +        fs_helper_run(fs_make_cmd("create_dir", filename));
> > +    }
> > +
> > +    void create_symlink(std::string source, std::string to)
> > +    {
> > +        source = sanitize_path(source);
> > +        to = sanitize_path(to);
> > +        fs_helper_run(fs_make_cmd("create_symlink", source, to));
> > +    }
> > +
> > +    void create_hardlink(std::string source, std::string to)
> > +    {
> > +        source = sanitize_path(source);
> > +        to = sanitize_path(to);
> > +        fs_helper_run(fs_make_cmd("create_hardlink", source, to));
> > +    }
> > +
> > +    void create_fifo(std::string file)
> > +    {
> > +        file = sanitize_path(file);
> > +        fs_helper_run(fs_make_cmd("create_fifo", file));
> > +    }
> > +
> > +    void create_socket(std::string file)
> > +    {
> > +        file = sanitize_path(file);
> > +        fs_helper_run(fs_make_cmd("create_socket", file));
> > +    }
> > +
> > +    fs::path const test_root;
> > +};
> > +
> > +#endif // LIBCXX_FILESYSTEM_DYNAMIC_TEST_ROOT
> > +
> > +// Misc test types
> > +
> > +
> > +#define CONCAT2(LHS, RHS) LHS##RHS
> > +#define CONCAT(LHS, RHS) CONCAT2(LHS, RHS)
> > +#define MKSTR(Str) {Str, CONCAT(L, Str), CONCAT(u, Str), CONCAT(U, Str)}
> > +
> > +struct MultiStringType {
> > +  const char* s;
> > +  const wchar_t* w;
> > +  const char16_t* u16;
> > +  const char32_t* u32;
> > +
> > +  operator const char* () const { return s; }
> > +  operator const wchar_t* () const { return w; }
> > +  operator const char16_t* () const { return u16; }
> > +  operator const char32_t* () const { return u32; }
> > +};
> > +
> > +
> > +const MultiStringType PathList[] = {
> > +        MKSTR(""),
> > +        MKSTR(" "),
> > +        MKSTR("//"),
> > +        MKSTR("."),
> > +        MKSTR(".."),
> > +        MKSTR("foo"),
> > +        MKSTR("/"),
> > +        MKSTR("/foo"),
> > +        MKSTR("foo/"),
> > +        MKSTR("/foo/"),
> > +        MKSTR("foo/bar"),
> > +        MKSTR("/foo/bar"),
> > +        MKSTR("//net"),
> > +        MKSTR("//net/foo"),
> > +        MKSTR("///foo///"),
> > +        MKSTR("///foo///bar"),
> > +        MKSTR("/."),
> > +        MKSTR("./"),
> > +        MKSTR("/.."),
> > +        MKSTR("../"),
> > +        MKSTR("foo/."),
> > +        MKSTR("foo/.."),
> > +        MKSTR("foo/./"),
> > +        MKSTR("foo/./bar"),
> > +        MKSTR("foo/../"),
> > +        MKSTR("foo/../bar"),
> > +        MKSTR("c:"),
> > +        MKSTR("c:/"),
> > +        MKSTR("c:foo"),
> > +        MKSTR("c:/foo"),
> > +        MKSTR("c:foo/"),
> > +        MKSTR("c:/foo/"),
> > +        MKSTR("c:/foo/bar"),
> > +        MKSTR("prn:"),
> > +        MKSTR("c:\\"),
> > +        MKSTR("c:\\foo"),
> > +        MKSTR("c:foo\\"),
> > +        MKSTR("c:\\foo\\"),
> > +        MKSTR("c:\\foo/"),
> > +        MKSTR("c:/foo\\bar"),
> > +        MKSTR("//"),
> > +
> MKSTR("/finally/we/need/one/really/really/really/really/really/really/really/long/string")
> > +};
> > +const unsigned PathListSize = sizeof(PathList) /
> sizeof(MultiStringType);
> > +
> > +template <class Iter>
> > +Iter IterEnd(Iter B) {
> > +  using VT = typename std::iterator_traits<Iter>::value_type;
> > +  for (; *B != VT{}; ++B)
> > +    ;
> > +  return B;
> > +}
> > +
> > +template <class CharT>
> > +const CharT* StrEnd(CharT const* P) {
> > +    return IterEnd(P);
> > +}
> > +
> > +template <class CharT>
> > +std::size_t StrLen(CharT const* P) {
> > +    return StrEnd(P) - P;
> > +}
> > +
> > +// Testing the allocation behavior of the code_cvt functions requires
> > +// *knowning* that the allocation was not done by "path::__str_".
>
> s/knowning/knowing/
>
> Ack.


> > +// This hack forces path to allocate enough memory.
> > +inline void PathReserve(fs::path& p, std::size_t N) {
> > +  auto const& native_ref = p.native();
> > +  const_cast<std::string&>(native_ref).reserve(N);
> > +}
> > +
> > +
> > +template <class Iter1, class Iter2>
> > +bool checkCollectionsEqual(
> > +    Iter1 start1, Iter1 const end1
> > +  , Iter2 start2, Iter2 const end2
> > +  )
> > +{
>
> Isn't this `std::equal(start1, end1, start2, end2)`?  Can you assume
> this available from C++14?
>

I'm trying to keep this building in C++11. It's simple enough to
reimplement this for testing.



>
> > +    while (start1 != end1 && start2 != end2) {
> > +        if (*start1 != *start2) {
> > +            return false;
> > +        }
> > +        ++start1; ++start2;
> > +    }
> > +    return (start1 == end1 && start2 == end2);
> > +}
> > +
> > +#endif /* FILESYSTEM_TEST_HELPER_HPP */
> > \ No newline at end of file
>
> ^ Missing newline.
>
> The diff has this warning in a lot of places, actually.  IIRC that makes
> the code ill-formed in -pedantic mode (besides making `cat` behave
> badly).
>
> Yeah I need to clean these up. -pedantic isn't a worry for this in C++11
though.


> > Index: test/std/experimental/filesystem/test.pass.cpp
> > ===================================================================
> > --- /dev/null
> > +++ test/std/experimental/filesystem/test.pass.cpp
> > @@ -0,0 +1,5 @@
> > +#include "filesystem_test_helper.hpp"
> > +
> > +int main() {
> > +
> > +}
> > \ No newline at end of file
> > Index:
> test/std/experimental/filesystem/static_test_env/symlink_to_empty_file
>
> In LLVM we usually put test inputs inside a directory called `Inputs/`,
> which makes it clear it's not a subdirectory with more tests, just test
> data.  What do you think of putting this parent directory at
> test/std/experimental/filesystem/Inputs/static_test_env instead of
> test/std/experimental/filesystem/static_test_env?
>

Sounds like a great idea!


>
> > ===================================================================
> > --- /dev/null
> > +++
> test/std/experimental/filesystem/static_test_env/symlink_to_empty_file
> > @@ -0,0 +1 @@
> > +empty_file
> > \ No newline at end of file
> > Index:
> test/std/experimental/filesystem/fs.error.report/tested_elsewhere.pass.cpp
> > ===================================================================
> > --- /dev/null
> > +++
> test/std/experimental/filesystem/fs.error.report/tested_elsewhere.pass.cpp
> > @@ -0,0 +1,12 @@
> >
> +//===----------------------------------------------------------------------===//
> > +//
> > +//                     The LLVM Compiler Infrastructure
> > +//
> > +// This file is dual licensed under the MIT and the University of
> Illinois Open
> > +// Source Licenses. See LICENSE.TXT for details.
> > +//
> >
> +//===----------------------------------------------------------------------===//
> > +
> > +int main()
> > +{
> > +}
>
> What's this for?
>

The test suite is laid out according to the stable section names in the
standard. When the requirements
of one section are tested as part of another we do something like this. It
keeps the directory in SVN/Git and it shows it hasn't been forgotten.



> > Index: test/std/experimental/filesystem/fs.enum/enum.perms.pass.cpp
> > ===================================================================
> > --- /dev/null
> > +++ test/std/experimental/filesystem/fs.enum/enum.perms.pass.cpp
> > @@ -0,0 +1,69 @@
> >
> +//===----------------------------------------------------------------------===//
> > +//
> > +//                     The LLVM Compiler Infrastructure
> > +//
> > +// This file is dual licensed under the MIT and the University of
> Illinois Open
> > +// Source Licenses. See LICENSE.TXT for details.
> > +//
> >
> +//===----------------------------------------------------------------------===//
> > +
> > +// UNSUPPORTED: c++98, c++03
> > +
> > +// <experimental/filesystem>
> > +
> > +// enum class perms;
> > +
> > +#include <experimental/filesystem>
> > +#include <type_traits>
> > +#include <cassert>
> > +#include <sys/stat.h>
> > +
> > +#include "test_macros.h"
> > +#include "check_bitmask_types.hpp"
> > +
> > +namespace fs = std::experimental::filesystem;
> > +
> > +constexpr fs::perms ME(int val) { return static_cast<fs::perms>(val); }
> > +
> > +int main() {
> > +  typedef fs::perms E;
> > +  static_assert(std::is_enum<E>::value, "");
> > +
> > +  // Check that E is a scoped enum by checking for conversions.
> > +  typedef std::underlying_type<E>::type UT;
> > +  static_assert(!std::is_convertible<E, UT>::value, "");
> > +
> > +  static_assert(std::is_same<UT, unsigned >::value, ""); //
> Implementation detail
> > +
> > +  typedef check_bitmask_type<E, E::group_all, E::owner_all>
> BitmaskTester;
> > +  assert(BitmaskTester::check());
> > +
> > +  static_assert(
> > +        E::none         == ME(0) &&
>
> A rare case where `0` isn't the only octal value in a file ;).
>
> > +        E::owner_read   == ME(0400) &&
> > +        E::owner_write  == ME(0200) &&
> > +        E::owner_exec   == ME(0100) &&
> > +        E::owner_all    == ME(0700) &&
> > +
> > +        E::group_read   == ME(040) &&
> > +        E::group_write  == ME(020) &&
> > +        E::group_exec   == ME(010) &&
> > +        E::group_all    == ME(070) &&
> > +
> > +        E::others_read  == ME(04) &&
> > +        E::others_write == ME(02) &&
> > +        E::others_exec  == ME(01) &&
> > +        E::others_all   == ME(07) &&
> > +        E::all          == ME(0777) &&
> > +        E::set_uid      == ME(04000) &&
> > +        E::set_gid      == ME(02000) &&
> > +        E::sticky_bit   == ME(01000) &&
> > +        E::mask         == ME(07777) &&
> > +        E::unknown      == ME(0xFFFF) &&
> > +        E::add_perms        == ME(0x10000) &&
> > +        E::remove_perms     == ME(0x20000) &&
> > +        E::resolve_symlinks == ME(0x40000),
> > +        "Expected enumeration values do not match");
> > +
> > +}
> > Index:
> test/std/experimental/filesystem/class.path/path.nonmember/hash_value_tested_elswhere.pass.cpp
> > ===================================================================
> > --- /dev/null
> > +++
> test/std/experimental/filesystem/class.path/path.nonmember/hash_value_tested_elswhere.pass.cpp
> > @@ -0,0 +1,14 @@
> >
> +//===----------------------------------------------------------------------===//
> > +//
> > +//                     The LLVM Compiler Infrastructure
> > +//
> > +// This file is dual licensed under the MIT and the University of
> Illinois Open
> > +// Source Licenses. See LICENSE.TXT for details.
> > +//
> >
> +//===----------------------------------------------------------------------===//
> > +
> > +// UNSUPPORTED: c++98, c++03
> > +
> > +// The "hash_value" function is tested as part of [path.compare]
> > +// in class.path/path.members/path.compare.pass.cpp
> > +int main() {}
>
> Okay, I get the idea of the one above.  I'm guessing this is just how
> we mark that something has been properly tested.
>
> However, it uses up bot time to have these extra tests to compile, link,
> and potentially shoot down to devices and pass output/exit status back.
> Is there any way of marking these things as "tested elsewhere" without
> adding load to the bots?
>


Maybe? I'm not sure this review is a good place for that discussion.
FWIW I don't think these actually slow down the bots a noticeable amount.


>
> > Index:
> test/std/experimental/filesystem/class.path/path.member/path.decompose/path.decompose.pass.cpp
> > ===================================================================
> > --- /dev/null
> > +++
> test/std/experimental/filesystem/class.path/path.member/path.decompose/path.decompose.pass.cpp
> > @@ -0,0 +1,198 @@
> >
> +//===----------------------------------------------------------------------===//
> > +//
> > +//                     The LLVM Compiler Infrastructure
> > +//
> > +// This file is dual licensed under the MIT and the University of
> Illinois Open
> > +// Source Licenses. See LICENSE.TXT for details.
> > +//
> >
> +//===----------------------------------------------------------------------===//
> > +
> > +// UNSUPPORTED: c++98, c++03
> > +
> > +// <experimental/filesystem>
> > +
> > +// class path
> > +
> > +// 8.4.9 path decomposition [path.decompose]
> > +//------------------------------------------
> > +// path root_name() const;
> > +// path root_directory() const;
> > +// path root_path() const;
> > +// path relative_path() const;
> > +// path parent_path() const;
> > +// path filename() const;
> > +// path stem() const;
> > +// path extension() const;
> > +//-------------------------------
> > +// 8.4.10 path query [path.query]
> > +//-------------------------------
> > +// bool empty() const noexcept;
> > +// bool has_root_path() const;
> > +// bool has_root_name() const;
> > +// bool has_root_directory() const;
> > +// bool has_relative_path() const;
> > +// bool has_parent_path() const;
> > +// bool has_filename() const;
> > +// bool has_stem() const;
> > +// bool has_extension() const;
> > +// bool is_absolute() const;
> > +// bool is_relative() const;
> > +//-------------------------------
> > +// 8.5 path iterators [path.itr]
> > +//-------------------------------
> > +// iterator begin() const;
> > +// iterator end() const;
> > +
> > +
> > +#include <experimental/filesystem>
> > +#include <type_traits>
> > +#include <vector>
> > +#include <cassert>
> > +
> > +#include "test_macros.h"
> > +#include "test_iterators.h"
> > +#include "count_new.hpp"
> > +#include "filesystem_test_helper.hpp"
> > +
> > +template <class It>
> > +std::reverse_iterator<It> mkRev(It it) {
> > +  return std::reverse_iterator<It>(it);
> > +}
> > +
> > +
> > +namespace fs = std::experimental::filesystem;
> > +struct PathDecomposeTestcase
> > +{
> > +    std::string raw;
> > +    std::vector<std::string> elements;
> > +    std::string root_path;
> > +    std::string root_name;
> > +    std::string root_directory;
> > +    std::string relative_path;
> > +    std::string parent_path;
> > +    std::string filename;
> > +};
> > +
> > +const PathDecomposeTestcase PathTestCases[] =
> > +  {
> > +      {"", {}, "", "", "", "", "", ""}
> > +    , {".", {"."}, "", "", "", ".", "", "."}
> > +    , {"..", {".."}, "", "", "", "..", "", ".."}
> > +    , {"foo", {"foo"}, "", "", "", "foo", "", "foo"}
> > +    , {"/", {"/"}, "/", "", "/", "", "", "/"}
> > +    , {"/foo", {"/", "foo"}, "/", "", "/", "foo", "/", "foo"}
> > +    , {"foo/", {"foo", "."}, "", "", "", "foo/", "foo", "."}
> > +    , {"/foo/", {"/", "foo", "."}, "/", "", "/", "foo/", "/foo", "."}
> > +    , {"foo/bar", {"foo","bar"}, "",  "", "",  "foo/bar", "foo", "bar"}
> > +    , {"/foo//bar", {"/","foo","bar"}, "/", "", "/", "foo/bar", "/foo",
> "bar"}
> > +    , {"//net", {"//net"}, "//net", "//net", "", "", "", "//net"}
> > +    , {"//net/foo", {"//net", "/", "foo"}, "//net/", "//net", "/",
> "foo", "//net/", "foo"}
> > +    , {"///foo///", {"/", "foo", "."}, "/", "", "/", "foo///",
> "///foo", "."}
> > +    , {"///foo///bar", {"/", "foo", "bar"}, "/", "", "/", "foo///bar",
> "///foo", "bar"}
> > +    , {"/.", {"/", "."}, "/", "", "/", ".", "/", "."}
> > +    , {"./", {".", "."}, "", "", "", "./", ".", "."}
> > +    , {"/..", {"/", ".."}, "/", "", "/", "..", "/", ".."}
> > +    , {"../", {"..", "."}, "", "", "", "../", "..", "."}
> > +    , {"foo/.", {"foo", "."}, "", "", "", "foo/.", "foo", "."}
> > +    , {"foo/..", {"foo", ".."}, "", "", "", "foo/..", "foo", ".."}
> > +    , {"foo/./", {"foo", ".", "."}, "", "", "", "foo/./", "foo/.", "."}
> > +    , {"foo/./bar", {"foo", ".", "bar"}, "", "", "", "foo/./bar",
> "foo/.", "bar"}
> > +    , {"foo/../", {"foo", "..", "."}, "", "", "", "foo/../", "foo/..",
> "."}
> > +    , {"foo/../bar", {"foo", "..", "bar"}, "", "", "", "foo/../bar",
> "foo/..", "bar"}
> > +    , {"c:", {"c:"}, "", "", "", "c:", "", "c:"}
> > +    , {"c:/", {"c:", "."}, "", "", "", "c:/", "c:", "."}
> > +    , {"c:foo", {"c:foo"}, "", "", "", "c:foo", "", "c:foo"}
> > +    , {"c:/foo", {"c:", "foo"}, "", "", "", "c:/foo", "c:", "foo"}
> > +    , {"c:foo/", {"c:foo", "."}, "", "", "", "c:foo/", "c:foo", "."}
> > +    , {"c:/foo/", {"c:", "foo", "."}, "", "", "", "c:/foo/",  "c:/foo",
> "."}
> > +    , {"c:/foo/bar", {"c:", "foo", "bar"}, "", "", "", "c:/foo/bar",
> "c:/foo", "bar"}
> > +    , {"prn:", {"prn:"}, "", "", "", "prn:", "", "prn:"}
> > +    , {"c:\\", {"c:\\"}, "", "", "", "c:\\", "", "c:\\"}
> > +    , {"c:\\foo", {"c:\\foo"}, "", "", "", "c:\\foo", "", "c:\\foo"}
> > +    , {"c:foo\\", {"c:foo\\"}, "", "", "", "c:foo\\", "", "c:foo\\"}
> > +    , {"c:\\foo\\", {"c:\\foo\\"}, "", "", "", "c:\\foo\\", "",
> "c:\\foo\\"}
> > +    , {"c:\\foo/",  {"c:\\foo", "."}, "", "", "", "c:\\foo/",
> "c:\\foo", "."}
> > +    , {"c:/foo\\bar", {"c:", "foo\\bar"}, "", "", "", "c:/foo\\bar",
> "c:", "foo\\bar"}
> > +    , {"//", {"//"}, "//", "//", "", "", "", "//"}
> > +  };
> > +
> > +void decompPathTest()
> > +{
> > +  using namespace fs;
> > +  for (auto const & TC : PathTestCases) {
> > +    path p(TC.raw);
> > +    assert(p == TC.raw);
> > +
> > +    assert(p.root_path() == TC.root_path);
> > +    assert(p.has_root_path() == not TC.root_path.empty());
>
> Huh, I've never actually seen `not` (or any of the other alternative
> operator representations) used before.  It looks pretty strange,
> partly because you're using a mix of primary operators and alternative
> operators, and maybe partly just due to my own unfamiliarity.
>
> Why are you using them?  (Maybe it's already common in the libc++
> codebase, I guess I'm not sure.)
>

I originally wrote this code 2-3 years ago and I liked that style then.
I've been trying to cleanup the "nots" as I go.
I don't think we should start using them in the libc++ code base.


> (Actually, I'm not sure why you don't just use `!=`; even `== !` seems
> strange when you're dealing with Boolean values.)
>

Changed it to do exactly that. Thank you.

>
> > +
> > +    assert(p.root_name() == TC.root_name);
> > +    assert(p.has_root_name() == not TC.root_name.empty());
> > +
> > +    assert(p.root_directory() == TC.root_directory);
> > +    assert(p.has_root_directory() == not TC.root_directory.empty());
> > +
> > +    assert(p.relative_path() == TC.relative_path);
> > +    assert(p.has_relative_path() == not TC.relative_path.empty());
> > +
> > +    assert(p.parent_path() == TC.parent_path);
> > +    assert(p.has_parent_path() == not TC.parent_path.empty());
> > +
> > +    assert(p.filename() == TC.filename);
> > +    assert(p.has_filename() == not TC.filename.empty());
> > +
> > +    assert(p.is_absolute() == p.has_root_directory());
> > +    assert(p.is_relative() == not p.is_absolute());
> > +
> > +    assert(checkCollectionsEqual(p.begin(), p.end(),
> > +                                 TC.elements.begin(),
> TC.elements.end()));
> > +    // check backwards
> > +    assert(checkCollectionsEqual(mkRev(p.end()), mkRev(p.begin()),
> > +                                 TC.elements.rbegin(),
> TC.elements.rend()));
> > +  }
> > +}
> > +
> > +
> > +struct FilenameDecompTestcase
> > +{
> > +  std::string raw;
> > +  std::string filename;
> > +  std::string stem;
> > +  std::string extension;
> > +};
> > +
> > +const FilenameDecompTestcase FilenameTestCases[] =
> > +{
> > +    {"", "", "", ""}
> > +  , {".", ".", ".", ""}
> > +  , {"..", "..", "..", ""}
> > +  , {"/", "/", "/", ""}
> > +  , {"foo", "foo", "foo", ""}
> > +  , {"/foo/bar.txt", "bar.txt", "bar", ".txt"}
> > +  , {"foo..txt", "foo..txt", "foo.", ".txt"}
> > +};
> > +
> > +
> > +void decompFilenameTest()
> > +{
> > +  using namespace fs;
> > +  for (auto const & TC : FilenameTestCases) {
> > +    path p(TC.raw);
> > +    assert(p == TC.raw);
> > +
> > +    assert(p.filename() == TC.filename);
> > +    assert(p.has_filename() == not TC.filename.empty());
> > +
> > +    assert(p.stem() == TC.stem);
> > +    assert(p.has_stem() == not TC.stem.empty());
> > +
> > +    assert(p.extension() == TC.extension);
> > +    assert(p.has_extension() == not TC.extension.empty());
> > +  }
> > +}
> > +
> > +int main()
> > +{
> > +  decompPathTest();
> > +  decompFilenameTest();
> > +}
> > \ No newline at end of file
> > Index:
> test/std/experimental/filesystem/class.path/path.member/path.construct/move.pass.cpp
> > ===================================================================
> > --- /dev/null
> > +++
> test/std/experimental/filesystem/class.path/path.member/path.construct/move.pass.cpp
> > @@ -0,0 +1,41 @@
> >
> +//===----------------------------------------------------------------------===//
> > +//
> > +//                     The LLVM Compiler Infrastructure
> > +//
> > +// This file is dual licensed under the MIT and the University of
> Illinois Open
> > +// Source Licenses. See LICENSE.TXT for details.
> > +//
> >
> +//===----------------------------------------------------------------------===//
> > +
> > +// UNSUPPORTED: c++98, c++03
> > +
> > +// <experimental/filesystem>
> > +
> > +// class path
> > +
> > +// path(path&&) noexcept
> > +
> > +#include <experimental/filesystem>
> > +#include <type_traits>
> > +#include <cassert>
> > +
> > +#include "test_macros.h"
> > +#include "count_new.hpp"
> > +
> > +namespace fs = std::experimental::filesystem;
> > +
> > +int main() {
> > +  using namespace fs;
> > +  static_assert(std::is_nothrow_move_constructible<path>::value, "");
> > +  assert(globalMemCounter.checkOutstandingNewEq(0));
> > +  const std::string s("we really really really really really really
> really "
> > +                      "really really long string so that we allocate");
>
> Kind of an irrelevant nitpick, but your long string is missing "need a"
> or "want a" (or some such).
>
> > +  assert(globalMemCounter.checkOutstandingNewEq(1));
> > +  path p(s);
> > +  {
> > +    DisableAllocationGuard g;
> > +    path p2(std::move(p));
> > +    assert(p2.native() == s);
> > +    assert(p.native() != s); // Testing moved from state
> > +  }
> > +}
> > \ No newline at end of file
> > Index: include/iomanip
> > ===================================================================
> > --- include/iomanip
> > +++ include/iomanip
> > @@ -512,8 +512,6 @@
> >      return __iom_t10<_CharT>(__tm, __fmt);
> >  }
> >
> > -#if _LIBCPP_STD_VER > 11
> > -
> >  template <class _CharT, class _Traits, class _ForwardIterator>
> >  std::basic_ostream<_CharT, _Traits> &
> >  __quoted_output ( basic_ostream<_CharT, _Traits> &__os,
> > @@ -631,22 +629,41 @@
> >      return __quoted_output_proxy<_CharT, const _CharT *> ( __s, __end,
> __delim, __escape );
> >  }
> >
> > +
> >  template <class _CharT, class _Traits, class _Allocator>
> >  _LIBCPP_INLINE_VISIBILITY
> >  __quoted_output_proxy<_CharT, typename basic_string <_CharT, _Traits,
> _Allocator>::const_iterator>
> > -quoted ( const basic_string <_CharT, _Traits, _Allocator> &__s, _CharT
> __delim = _CharT('"'), _CharT __escape=_CharT('\\'))
> > +__quoted ( const basic_string <_CharT, _Traits, _Allocator> &__s,
> _CharT __delim = _CharT('"'), _CharT __escape=_CharT('\\'))
> >  {
> > -    return __quoted_output_proxy<_CharT,
> > -            typename basic_string <_CharT, _Traits,
> _Allocator>::const_iterator>
> > +    return __quoted_output_proxy<_CharT,
> > +            typename basic_string <_CharT, _Traits,
> _Allocator>::const_iterator>
>
> These changes seem unrelated to me (and the rest of the file).  Can they
> be split out?
>

They will be, eventually.


>
> >                      ( __s.cbegin(), __s.cend (), __delim, __escape );
> >  }
> >
> >  template <class _CharT, class _Traits, class _Allocator>
> >  __quoted_proxy<_CharT, _Traits, _Allocator>
> > -quoted ( basic_string <_CharT, _Traits, _Allocator> &__s, _CharT
> __delim = _CharT('"'), _CharT __escape=_CharT('\\'))
> > +__quoted ( basic_string <_CharT, _Traits, _Allocator> &__s, _CharT
> __delim = _CharT('"'), _CharT __escape=_CharT('\\'))
>
> With this change, should we use _LIBCPP_INLNE_VISIBILITY here?
>
> >  {
> >      return __quoted_proxy<_CharT, _Traits, _Allocator>( __s, __delim,
> __escape );
> >  }
> > +
> > +
> > +#if _LIBCPP_STD_VER > 11
> > +
> > +template <class _CharT, class _Traits, class _Allocator>
> > +_LIBCPP_INLINE_VISIBILITY
> > +__quoted_output_proxy<_CharT, typename basic_string <_CharT, _Traits,
> _Allocator>::const_iterator>
> > +quoted ( const basic_string <_CharT, _Traits, _Allocator> &__s, _CharT
> __delim = _CharT('"'), _CharT __escape=_CharT('\\'))
> > +{
> > +    return __quoted(__s, __delim, __escape);
> > +}
> > +
> > +template <class _CharT, class _Traits, class _Allocator>
> > +__quoted_proxy<_CharT, _Traits, _Allocator>
>
> Do you happen to know why _LIBCPP_INLNE_VISIBILITY wasn't used above for
> `quoted()`?  Should it be added now?
>

Not sure, I added it now.


>
> > +quoted ( basic_string <_CharT, _Traits, _Allocator> &__s, _CharT
> __delim = _CharT('"'), _CharT __escape=_CharT('\\'))
> > +{
> > +    return__quoted(__s, __delim, __escape);
>
> It looks like there is a space missing between `return` and `__quoted`.
>
> Ack.


> > +}
> >  #endif
> >
> >  _LIBCPP_END_NAMESPACE_STD
> > Index: include/experimental/filesystem
> > ===================================================================
> > --- /dev/null
> > +++ include/experimental/filesystem
> > @@ -0,0 +1,1243 @@
> > +// -*- C++ -*-
> > +//===--------------------------- filesystem
> -------------------------------===//
> > +//
> > +//                     The LLVM Compiler Infrastructure
> > +//
> > +// This file is dual licensed under the MIT and the University of
> Illinois Open
> > +// Source Licenses. See LICENSE.TXT for details.
> > +//
> >
> +//===----------------------------------------------------------------------===//
> > +#ifndef _LIBCPP_EXPERIMENTAL_FILESYSTEM
> > +#define _LIBCPP_EXPERIMENTAL_FILESYSTEM
> > +/*
> > +    filesystem synopsis
> > +
> > +    namespace std { namespace experimental { namespace filesystem {
> inline namespace v1 {
> > +
> > +    class path;
> > +
> > +    void swap(path& lhs, path& rhs) _NOEXCEPT;
> > +    size_t hash_value(const path& p) _NOEXCEPT;
> > +
> > +    bool operator==(const path& lhs, const path& rhs) _NOEXCEPT;
> > +    bool operator!=(const path& lhs, const path& rhs) _NOEXCEPT;
> > +    bool operator< (const path& lhs, const path& rhs) _NOEXCEPT;
> > +    bool operator<=(const path& lhs, const path& rhs) _NOEXCEPT;
> > +    bool operator> (const path& lhs, const path& rhs) _NOEXCEPT;
> > +    bool operator>=(const path& lhs, const path& rhs) _NOEXCEPT;
> > +
> > +    path operator/ (const path& lhs, const path& rhs);
> > +
> > +    template <class charT, class traits>
> > +    basic_ostream<charT, traits>&
> > +    operator<<(basic_ostream<charT, traits>& os, const path& p);
> > +
> > +    template <class charT, class traits>
> > +    basic_istream<charT, traits>&
> > +    operator>>(basic_istream<charT, traits>& is, path& p);
> > +
> > +    template <class Source>
> > +      path u8path(const Source& source);
> > +    template <class InputIterator>
> > +      path u8path(InputIterator first, InputIterator last);
> > +
> > +    class filesystem_error;
> > +    class directory_entry;
> > +
> > +    class directory_iterator;
> > +
> > +    // enable directory_iterator range-based for statements
> > +    directory_iterator begin(directory_iterator iter) noexcept;
> > +    directory_iterator end(const directory_iterator&) noexcept;
> > +
> > +    class recursive_directory_iterator;
> > +
> > +    // enable recursive_directory_iterator range-based for statements
> > +    recursive_directory_iterator begin(recursive_directory_iterator
> iter) noexcept;
> > +    recursive_directory_iterator end(const
> recursive_directory_iterator&) noexcept;
> > +
> > +    class file_status;
> > +
> > +    struct space_info
> > +    {
> > +      uintmax_t capacity;
> > +      uintmax_t free;
> > +      uintmax_t available;
> > +    };
> > +
> > +    enum class file_type;
> > +    enum class perms;
> > +    enum class copy_options;
> > +    enum class directory_options;
> > +
> > +    typedef chrono::time_point<trivial-clock>  file_time_type;
> > +
> > +    // operational functions
> > +
> > +    path absolute(const path& p, const path& base=current_path());
> > +
> > +    path canonical(const path& p, const path& base = current_path());
> > +    path canonical(const path& p, error_code& ec);
> > +    path canonical(const path& p, const path& base, error_code& ec);
> > +
> > +    void copy(const path& from, const path& to);
> > +    void copy(const path& from, const path& to, error_code& ec)
> _NOEXCEPT;
> > +    void copy(const path& from, const path& to, copy_options options);
> > +    void copy(const path& from, const path& to, copy_options options,
> > +                   error_code& ec) _NOEXCEPT;
> > +
> > +    bool copy_file(const path& from, const path& to);
> > +    bool copy_file(const path& from, const path& to, error_code& ec)
> _NOEXCEPT;
> > +    bool copy_file(const path& from, const path& to, copy_options
> option);
> > +    bool copy_file(const path& from, const path& to, copy_options
> option,
> > +                           error_code& ec) _NOEXCEPT;
> > +
> > +    void copy_symlink(const path& existing_symlink, const path&
> new_symlink);
> > +    void copy_symlink(const path& existing_symlink, const path&
> new_symlink,
> > +                              error_code& ec) _NOEXCEPT;
> > +
> > +    bool create_directories(const path& p);
> > +    bool create_directories(const path& p, error_code& ec) _NOEXCEPT;
> > +
> > +    bool create_directory(const path& p);
> > +    bool create_directory(const path& p, error_code& ec) _NOEXCEPT;
> > +
> > +    bool create_directory(const path& p, const path& attributes);
> > +    bool create_directory(const path& p, const path& attributes,
> > +                                  error_code& ec) _NOEXCEPT;
> > +
> > +    void create_directory_symlink(const path& to, const path&
> new_symlink);
> > +    void create_directory_symlink(const path& to, const path&
> new_symlink,
> > +                                          error_code& ec) _NOEXCEPT;
> > +
> > +    void create_hard_link(const path& to, const path& new_hard_link);
> > +    void create_hard_link(const path& to, const path& new_hard_link,
> > +                                  error_code& ec) _NOEXCEPT;
> > +
> > +    void create_symlink(const path& to, const path& new_symlink);
> > +    void create_symlink(const path& to, const path& new_symlink,
> > +                                error_code& ec) _NOEXCEPT;
> > +
> > +    path current_path();
> > +    path current_path(error_code& ec);
> > +    void current_path(const path& p);
> > +    void current_path(const path& p, error_code& ec) _NOEXCEPT;
> > +
> > +    bool exists(file_status s) _NOEXCEPT;
> > +    bool exists(const path& p);
> > +    bool exists(const path& p, error_code& ec) _NOEXCEPT;
> > +
> > +    bool equivalent(const path& p1, const path& p2);
> > +    bool equivalent(const path& p1, const path& p2, error_code& ec)
> _NOEXCEPT;
> > +
> > +    uintmax_t    file_size(const path& p);
> > +    uintmax_t    file_size(const path& p, error_code& ec) _NOEXCEPT;
> > +
> > +    uintmax_t    hard_link_count(const path& p);
> > +    uintmax_t    hard_link_count(const path& p, error_code& ec)
> _NOEXCEPT;
> > +
> > +    bool is_block_file(file_status s) _NOEXCEPT;
> > +    bool is_block_file(const path& p);
> > +    bool is_block_file(const path& p, error_code& ec) _NOEXCEPT;
> > +
> > +    bool is_character_file(file_status s) _NOEXCEPT;
> > +    bool is_character_file(const path& p);
> > +    bool is_character_file(const path& p, error_code& ec) _NOEXCEPT;
> > +
> > +    bool is_directory(file_status s) _NOEXCEPT;
> > +    bool is_directory(const path& p);
> > +    bool is_directory(const path& p, error_code& ec) _NOEXCEPT;
> > +
> > +    bool is_empty(const path& p);
> > +    bool is_empty(const path& p, error_code& ec) _NOEXCEPT;
> > +
> > +    bool is_fifo(file_status s) _NOEXCEPT;
> > +    bool is_fifo(const path& p);
> > +    bool is_fifo(const path& p, error_code& ec) _NOEXCEPT;
> > +
> > +    bool is_other(file_status s) _NOEXCEPT;
> > +    bool is_other(const path& p);
> > +    bool is_other(const path& p, error_code& ec) _NOEXCEPT;
> > +
> > +    bool is_regular_file(file_status s) _NOEXCEPT;
> > +    bool is_regular_file(const path& p);
> > +    bool is_regular_file(const path& p, error_code& ec) _NOEXCEPT;
> > +
> > +    bool is_socket(file_status s) _NOEXCEPT;
> > +    bool is_socket(const path& p);
> > +    bool is_socket(const path& p, error_code& ec) _NOEXCEPT;
> > +
> > +    bool is_symlink(file_status s) _NOEXCEPT;
> > +    bool is_symlink(const path& p);
> > +    bool is_symlink(const path& p, error_code& ec) _NOEXCEPT;
> > +
> > +    file_time_type  last_write_time(const path& p);
> > +    file_time_type  last_write_time(const path& p, error_code& ec)
> _NOEXCEPT;
> > +    void last_write_time(const path& p, file_time_type new_time);
> > +    void last_write_time(const path& p, file_time_type new_time,
> > +                                 error_code& ec) _NOEXCEPT;
> > +
> > +    void permissions(const path& p, perms prms);
> > +    void permissions(const path& p, perms prms, error_code& ec)
> _NOEXCEPT;
> > +
> > +    path read_symlink(const path& p);
> > +    path read_symlink(const path& p, error_code& ec);
> > +
> > +    bool remove(const path& p);
> > +    bool remove(const path& p, error_code& ec) _NOEXCEPT;
> > +
> > +    uintmax_t    remove_all(const path& p);
> > +    uintmax_t    remove_all(const path& p, error_code& ec) _NOEXCEPT;
> > +
> > +    void rename(const path& from, const path& to);
> > +    void rename(const path& from, const path& to, error_code& ec)
> _NOEXCEPT;
> > +
> > +    void resize_file(const path& p, uintmax_t size);
> > +    void resize_file(const path& p, uintmax_t size, error_code& ec)
> _NOEXCEPT;
> > +
> > +    space_info   space(const path& p);
> > +    space_info   space(const path& p, error_code& ec) _NOEXCEPT;
> > +
> > +    file_status  status(const path& p);
> > +    file_status  status(const path& p, error_code& ec) _NOEXCEPT;
> > +
> > +    bool status_known(file_status s) _NOEXCEPT;
> > +
> > +    file_status  symlink_status(const path& p);
> > +    file_status  symlink_status(const path& p, error_code& ec)
> _NOEXCEPT;
> > +
> > +    path system_complete(const path& p);
> > +    path system_complete(const path& p, error_code& ec);
> > +
> > +    path temp_directory_path();
> > +    path temp_directory_path(error_code& ec);
> > +
> > +} } } }  // namespaces std::experimental::filesystem::v1
> > +
> > +*/
> > +
> > +#include <experimental/__config>
> > +#include <cstddef>
> > +#include <chrono>
> > +#include <iterator>
> > +#include <iosfwd>
> > +#include <locale>
> > +#include <memory>
> > +#include <stack>
> > +#include <string>
> > +#include <system_error>
> > +#include <utility>
> > +#include <iomanip> // for quoted
> > +#include <experimental/string_view>
> > +
> > +#include <__debug>
> > +
> > +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
> > +#pragma GCC system_header
> > +#endif
> > +
> > +_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_FILESYSTEM
> > +
> > +typedef chrono::time_point<std::chrono::system_clock>  file_time_type;
> > +
> > +struct _LIBCPP_TYPE_VIS space_info
> > +{
> > +  uintmax_t capacity;
> > +  uintmax_t free;
> > +  uintmax_t available;
> > +};
> > +
> > +enum class _LIBCPP_TYPE_VIS file_type : signed char
> > +{
> > +    none       = 0,
> > +    not_found  = -1,
> > +    regular    = 1,
> > +    directory  = 2,
> > +    symlink    = 3,
> > +    block      = 4,
> > +    character  = 5,
> > +    fifo       = 6,
> > +    socket     = 7,
> > +    unknown    = 8
> > +};
> > +
> > +enum class _LIBCPP_TYPE_VIS perms : unsigned
> > +{
> > +    none         = 0,
> > +
> > +    owner_read   = 0400,
> > +    owner_write  = 0200,
> > +    owner_exec   = 0100,
> > +    owner_all    = 0700,
> > +
> > +    group_read   = 040,
> > +    group_write  = 020,
> > +    group_exec   = 010,
> > +    group_all    = 070,
> > +
> > +    others_read  = 04,
> > +    others_write = 02,
> > +    others_exec  = 01,
> > +    others_all   = 07,
> > +
> > +    all          = 0777,
> > +
> > +    set_uid      = 04000,
> > +    set_gid      = 02000,
> > +    sticky_bit   = 01000,
> > +    mask         = 07777,
> > +    unknown      = 0xFFFF,
> > +
> > +    add_perms        = 0x10000,
> > +    remove_perms     = 0x20000,
> > +    resolve_symlinks = 0x40000
> > +};
> > +
> > +_LIBCPP_INLINE_VISIBILITY
> > +inline _LIBCPP_CONSTEXPR perms operator&(perms _LHS, perms _RHS)
> > +{ return static_cast<perms>(static_cast<unsigned>(_LHS) &
> static_cast<unsigned>(_RHS)); }
> > +
> > +_LIBCPP_INLINE_VISIBILITY
> > +inline _LIBCPP_CONSTEXPR perms operator|(perms _LHS, perms _RHS)
> > +{ return static_cast<perms>(static_cast<unsigned>(_LHS) |
> static_cast<unsigned>(_RHS)); }
> > +
> > +_LIBCPP_INLINE_VISIBILITY
> > +inline _LIBCPP_CONSTEXPR perms operator^(perms _LHS, perms _RHS)
> > +{ return static_cast<perms>(static_cast<unsigned>(_LHS) ^
> static_cast<unsigned>(_RHS)); }
> > +
> > +_LIBCPP_INLINE_VISIBILITY
> > +inline _LIBCPP_CONSTEXPR perms operator~(perms _LHS)
> > +{ return static_cast<perms>(~static_cast<unsigned>(_LHS)); }
> > +
> > +_LIBCPP_INLINE_VISIBILITY
> > +inline perms& operator&=(perms& _LHS, perms _RHS)
> > +{ return _LHS = _LHS & _RHS; }
> > +
> > +_LIBCPP_INLINE_VISIBILITY
> > +inline perms& operator|=(perms& _LHS, perms _RHS)
> > +{ return _LHS = _LHS | _RHS; }
> > +
> > +_LIBCPP_INLINE_VISIBILITY
> > +inline perms& operator^=(perms& _LHS, perms _RHS)
> > +{ return _LHS = _LHS ^ _RHS; }
> > +
> > +enum class _LIBCPP_TYPE_VIS copy_options : unsigned short
> > +{
> > +    none               = 0,
> > +    skip_existing      = 1,
> > +    overwrite_existing = 2,
> > +    update_existing    = 4,
> > +    recursive          = 8,
> > +    copy_symlinks      = 16,
> > +    skip_symlinks      = 32,
> > +    directories_only   = 64,
> > +    create_symlinks    = 128,
> > +    create_hard_links  = 256,
> > +    __in_recursive_copy = 512,
> > +};
> > +
> > +_LIBCPP_INLINE_VISIBILITY
> > +inline _LIBCPP_CONSTEXPR copy_options operator&(copy_options _LHS,
> copy_options _RHS)
> > +{ return static_cast<copy_options>(static_cast<unsigned short>(_LHS) &
> static_cast<unsigned short>(_RHS)); }
> > +
> > +_LIBCPP_INLINE_VISIBILITY
> > +inline _LIBCPP_CONSTEXPR copy_options operator|(copy_options _LHS,
> copy_options _RHS)
> > +{ return static_cast<copy_options>(static_cast<unsigned short>(_LHS) |
> static_cast<unsigned short>(_RHS)); }
> > +
> > +_LIBCPP_INLINE_VISIBILITY
> > +inline _LIBCPP_CONSTEXPR copy_options operator^(copy_options _LHS,
> copy_options _RHS)
> > +{ return static_cast<copy_options>(static_cast<unsigned short>(_LHS) ^
> static_cast<unsigned short>(_RHS)); }
> > +
> > +_LIBCPP_INLINE_VISIBILITY
> > +inline _LIBCPP_CONSTEXPR copy_options operator~(copy_options _LHS)
> > +{ return static_cast<copy_options>(~static_cast<unsigned short>(_LHS));
> }
> > +
> > +_LIBCPP_INLINE_VISIBILITY
> > +inline copy_options& operator&=(copy_options& _LHS, copy_options _RHS)
> > +{ return _LHS = _LHS & _RHS; }
> > +
> > +_LIBCPP_INLINE_VISIBILITY
> > +inline copy_options& operator|=(copy_options& _LHS, copy_options _RHS)
> > +{ return _LHS = _LHS | _RHS; }
> > +
> > +_LIBCPP_INLINE_VISIBILITY
> > +inline copy_options& operator^=(copy_options& _LHS, copy_options _RHS)
> > +{ return _LHS = _LHS ^ _RHS; }
> > +
> > +
> > +enum class directory_options : unsigned char
> > +{
> > +    none                     = 0,
> > +    follow_directory_symlink = 1,
> > +    skip_permission_denied   = 2
> > +};
> > +
> > +_LIBCPP_INLINE_VISIBILITY
> > +inline _LIBCPP_CONSTEXPR directory_options operator&(directory_options
> _LHS, directory_options _RHS)
> > +{ return static_cast<directory_options>(static_cast<unsigned
> char>(_LHS) & static_cast<unsigned char>(_RHS)); }
> > +
> > +_LIBCPP_INLINE_VISIBILITY
> > +inline _LIBCPP_CONSTEXPR directory_options operator|(directory_options
> _LHS, directory_options _RHS)
> > +{ return static_cast<directory_options>(static_cast<unsigned
> char>(_LHS) | static_cast<unsigned char>(_RHS)); }
> > +
> > +_LIBCPP_INLINE_VISIBILITY
> > +inline _LIBCPP_CONSTEXPR directory_options operator^(directory_options
> _LHS, directory_options _RHS)
> > +{ return static_cast<directory_options>(static_cast<unsigned
> char>(_LHS) ^ static_cast<unsigned char>(_RHS)); }
> > +
> > +_LIBCPP_INLINE_VISIBILITY
> > +inline _LIBCPP_CONSTEXPR directory_options operator~(directory_options
> _LHS)
> > +{ return static_cast<directory_options>(~static_cast<unsigned
> char>(_LHS)); }
> > +
> > +_LIBCPP_INLINE_VISIBILITY
> > +inline directory_options& operator&=(directory_options& _LHS,
> directory_options _RHS)
> > +{ return _LHS = _LHS & _RHS; }
> > +
> > +_LIBCPP_INLINE_VISIBILITY
> > +inline directory_options& operator|=(directory_options& _LHS,
> directory_options _RHS)
> > +{ return _LHS = _LHS | _RHS; }
> > +
> > +_LIBCPP_INLINE_VISIBILITY
> > +inline directory_options& operator^=(directory_options& _LHS,
> directory_options _RHS)
> > +{ return _LHS = _LHS ^ _RHS; }
> > +
> > +
> > +class _LIBCPP_TYPE_VIS file_status
> > +{
> > +public:
> > +    // constructors
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    explicit file_status(file_type __ft = file_type::none,
> > +                         perms __prms   = perms::unknown) _NOEXCEPT
> > +      : __ft_(__ft), __prms_(__prms)
> > +    {}
> > +
> > +    file_status(const file_status&) _NOEXCEPT = default;
> > +    file_status(file_status&&) _NOEXCEPT = default;
> > +
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    ~file_status() {}
> > +
> > +    file_status& operator=(const file_status&) _NOEXCEPT = default;
> > +    file_status& operator=(file_status&&) _NOEXCEPT = default;
> > +
> > +    // observers
> > +    _LIBCPP_ALWAYS_INLINE
> > +    file_type type() const _NOEXCEPT {
> > +        return __ft_;
> > +    }
> > +
> > +    _LIBCPP_ALWAYS_INLINE
> > +    perms permissions() const _NOEXCEPT {
> > +        return __prms_;
> > +    }
> > +
> > +    // modifiers
> > +    _LIBCPP_ALWAYS_INLINE
> > +    void type(file_type __ft) _NOEXCEPT {
> > +        __ft_ = __ft;
> > +    }
> > +
> > +    _LIBCPP_ALWAYS_INLINE
> > +    void permissions(perms __p) _NOEXCEPT {
> > +        __prms_ = __p;
> > +    }
> > +private:
> > +    file_type __ft_;
> > +    perms __prms_;
> > +};
> > +
> > +class _LIBCPP_TYPE_VIS directory_entry;
> > +
> > +template <class _Tp> struct __can_convert_char {
> > +  static const bool value = false;
> > +};
> > +template <> struct __can_convert_char<char> {
> > +    static const bool value = true;
> > +    using __char_type = char;
> > +};
> > +template <> struct __can_convert_char<wchar_t>  {
> > +    static const bool value = true;
> > +    using __char_type = wchar_t;
> > +};
> > +template <> struct __can_convert_char<char16_t> {
> > +    static const bool value = true;
> > +    using __char_type = char16_t;
> > +};
> > +template <> struct __can_convert_char<char32_t> {
> > +    static const bool value = true;
> > +    using __char_type = char32_t;
> > +};
> > +
> > +template <class _ECharT>
> > +typename enable_if<__can_convert_char<_ECharT>::value, bool>::type
> > +__is_separator(_ECharT __e) {
> > +    return __e == _ECharT('/');
> > +};
> > +
> > +struct _NullSentinal {};
> > +
> > +template <class _Tp>
> > +using _Void = void;
> > +
> > +template <class _Tp, class = void>
> > +struct __is_pathable_string : public false_type {};
> > +
> > +template <class _ECharT, class _Traits, class _Alloc>
> > +struct __is_pathable_string<basic_string<_ECharT, _Traits, _Alloc>,
> > +                            _Void<typename
> __can_convert_char<_ECharT>::__char_type>>
> > +: public __can_convert_char<_ECharT>
> > +{
> > +    using _Str = basic_string<_ECharT, _Traits, _Alloc>;
> > +    using _Base = __can_convert_char<_ECharT>;
> > +    static _ECharT const* __range_begin(_Str const& __s) { return
> __s.data(); }
> > +    static _ECharT const* __range_end(_Str const& __s) { return
> __s.data() + __s.length(); }
> > +    static _ECharT __first_or_null(_Str const& __s) {
> > +        return __s.empty() ? _ECharT{} : __s[0];
> > +    }
> > +};
> > +
> > +template <class _Source,
> > +          class _DS = typename decay<_Source>::type,
> > +          class _UnqualPtrType = typename remove_const<
> > +              typename remove_pointer<_DS>::type>::type,
> > +          bool _IsCharPtr = is_pointer<_DS>::value &&
> > +                            __can_convert_char<_UnqualPtrType>::value
> > +        >
> > +struct __is_pathable_char_array : false_type {};
> > +
> > +template <class _Source, class _ECharT, class _UPtr>
> > +struct __is_pathable_char_array<_Source, _ECharT*, _UPtr, true>
> > +        : __can_convert_char<typename remove_const<_ECharT>::type>
> > +{
> > +  using _Base = __can_convert_char<typename
> remove_const<_ECharT>::type>;
> > +
> > +  static _ECharT const* __range_begin(const _ECharT* __b) { return __b;
> }
> > +  static _ECharT const* __range_end(const _ECharT* __b)
> > +  {
> > +      using _Iter = const _ECharT*;
> > +      const _ECharT __sentinal = _ECharT{};
> > +      _Iter __e = __b;
> > +      for (; *__e != __sentinal; ++__e)
> > +          ;
> > +      return __e;
> > +  }
> > +
> > +  static _ECharT __first_or_null(const _ECharT* __b) { return *__b; }
> > +};
> > +
> > +template <class _Iter, bool _IsIt = __is_input_iterator<_Iter>::value,
> class = void>
> > +struct __is_pathable_iter : false_type {};
> > +
> > +template <class _Iter>
> > +struct __is_pathable_iter<_Iter, true,
> > +        _Void<typename __can_convert_char<typename
> iterator_traits<_Iter>::value_type>::__char_type>>
> > +        : __can_convert_char<typename
> iterator_traits<_Iter>::value_type>
> > +{
> > +  using _ECharT = typename iterator_traits<_Iter>::value_type;
> > +  using _Base = __can_convert_char<_ECharT>;
> > +
> > +  static _Iter         __range_begin(_Iter __b) { return __b; }
> > +  static _NullSentinal __range_end(_Iter)       { return
> _NullSentinal{}; }
> > +
> > +  static _ECharT __first_or_null(_Iter __b) { return *__b; }
> > +};
> > +
> > +template <class _Tp, bool _IsStringT =
> __is_pathable_string<_Tp>::value,
> > +                     bool _IsCharIterT =
> __is_pathable_char_array<_Tp>::value,
> > +                     bool _IsIterT = !_IsCharIterT &&
> __is_pathable_iter<_Tp>::value
> > +         >
> > +struct __is_pathable : false_type {
> > +  static_assert(!_IsStringT && !_IsCharIterT && !_IsIterT, "Must all be
> false");
> > +};
> > +
> > +template <class _Tp>
> > +struct __is_pathable<_Tp, true, false, false> :
> __is_pathable_string<_Tp> {};
> > +
> > +
> > +template <class _Tp>
> > +struct __is_pathable<_Tp, false, true, false> :
> __is_pathable_char_array<_Tp> {};
> > +
> > +
> > +template <class _Tp>
> > +struct __is_pathable<_Tp, false, false, true> : __is_pathable_iter<_Tp>
> {};
> > +
> > +
> > +template <class _ECharT>
> > +struct _PathCVT {
> > +    static_assert(__can_convert_char<_ECharT>::value, "Char type not
> convertible");
> > +
> > +    typedef __narrow_to_utf8<sizeof(_ECharT)*__CHAR_BIT__> _Narrower;
> > +
> > +    static void __append_range(string& __dest, _ECharT const* __b,
> _ECharT const* __e)  {
> > +        _Narrower()(back_inserter(__dest), __b, __e);
> > +    }
> > +
> > +    template <class _Iter>
> > +    static void __append_range(string& __dest, _Iter __b, _Iter __e) {
> > +        static_assert(!is_same<_Iter, _ECharT*>::value, "Call const
> overload");
> > +        if (__b == __e) return;
> > +        basic_string<_ECharT> __tmp(__b, __e);
> > +        _Narrower()(back_inserter(__dest), __tmp.data(),
> > +                    __tmp.data() + __tmp.length());
> > +    }
> > +
> > +    template <class _Iter>
> > +    static void __append_range(string& __dest, _Iter __b,
> _NullSentinal) {
> > +        static_assert(!is_same<_Iter, _ECharT*>::value, "Call const
> overload");
> > +        const _ECharT __sentinal = _ECharT{};
> > +        if (*__b == __sentinal) return;
> > +        basic_string<_ECharT> __tmp;
> > +        for (; *__b != __sentinal; ++__b)
> > +            __tmp.push_back(*__b);
> > +        _Narrower()(back_inserter(__dest), __tmp.data(),
> > +                    __tmp.data() + __tmp.length());
> > +    }
> > +
> > +    template <class _Source>
> > +    static void __append_source(string& __dest, _Source const& __s)
> > +    {
> > +        using _Traits = __is_pathable<_Source>;
> > +        __append_range(__dest, _Traits::__range_begin(__s),
> _Traits::__range_end(__s));
> > +    }
> > +};
> > +
> > +template <>
> > +struct _PathCVT<char> {
> > +    template <class _Iter>
> > +    static void __append_range(string& __dest, _Iter __b, _Iter __e) {
> > +        // TODO(EricWF) We get better allocation behavior here if we
> don't
> > +        // provide the same exception safety guarantees as
> string.append.
> > +        // __dest.append(__b, __e);
> > +        for (; __b != __e; ++__b)
> > +            __dest.push_back(*__b);
> > +    }
> > +
> > +    template <class _Iter>
> > +    static void __append_range(string& __dest, _Iter __b,
> _NullSentinal) {
> > +        const char __sentinal = char{};
> > +        for (; *__b != __sentinal; ++__b)
> > +            __dest.push_back(*__b);
> > +    }
> > +
> > +    template <class _Source>
> > +    static void __append_source(string& __dest, _Source const& __s)
> > +    {
> > +        using _Traits = __is_pathable<_Source>;
> > +        __append_range(__dest, _Traits::__range_begin(__s),
> _Traits::__range_end(__s));
> > +    }
> > +};
> > +
> > +
> > +class _LIBCPP_TYPE_VIS path
> > +{
> > +    template <class _SourceOrIter, class _Tp = path&>
> > +    using _EnableIfPathable = typename
> > +        enable_if<__is_pathable<_SourceOrIter>::value, _Tp>::type;
> > +
> > +    template <class _Tp>
> > +    using _SourceChar = typename __is_pathable<_Tp>::__char_type;
> > +
> > +    template <class _Tp>
> > +    using _SourceCVT = _PathCVT<_SourceChar<_Tp>>;
> > +
> > +public:
> > +    typedef char value_type;
> > +    typedef basic_string<value_type> string_type;
> > +    static _LIBCPP_CONSTEXPR value_type preferred_separator = '/';
> > +
> > +    // constructors and destructor
> > +    _LIBCPP_INLINE_VISIBILITY path() _NOEXCEPT {}
> > +    _LIBCPP_INLINE_VISIBILITY path(const path& __p)      :
> __pn_(__p.__pn_) {}
> > +    _LIBCPP_INLINE_VISIBILITY path(path&& __p) _NOEXCEPT :
> __pn_(_VSTD::move(__p.__pn_)) {}
> > +
> > +    template <
> > +        class _Source,
> > +        class = _EnableIfPathable<_Source, void>
> > +        >
> > +    path(const _Source& __src) {
> > +        _SourceCVT<_Source>::__append_source(__pn_, __src);
> > +    }
> > +
> > +    template <class _InputIt>
> > +    path(_InputIt __first, _InputIt __last) {
> > +        typedef typename iterator_traits<_InputIt>::value_type _ItVal;
> > +        _PathCVT<_ItVal>::__append_range(__pn_, __first, __last);
> > +    }
> > +
> > +    // TODO
> > +    template <class _Source,
> > +              class = _EnableIfPathable<_Source, void>
> > +             >
> > +        path(const _Source& __src, const locale& __loc);
> > +    template <class _InputIt>
> > +        path(_InputIt __first, _InputIt _last, const locale& __loc);
> > +
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    ~path() {}
> > +
> > +    // assignments
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    path& operator=(const path& __p) {
> > +        __pn_ = __p.__pn_;
> > +        return *this;
> > +    }
> > +
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    path& operator=(path&& __p) _NOEXCEPT {
> > +        __pn_ = _VSTD::move(__p.__pn_);
> > +        return *this;
> > +    }
> > +
> > +    template <class _Source>
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    _EnableIfPathable<_Source>
> > +    operator=(const _Source& __src)
> > +    { return this->assign(__src); }
> > +
> > +
> > +    template <class _Source>
> > +    _EnableIfPathable<_Source>
> > +    assign(const _Source& __src) {
> > +        __pn_.clear();
> > +        _SourceCVT<_Source>::__append_source(__pn_, __src);
> > +        return *this;
> > +    }
> > +
> > +    template <class _InputIt>
> > +    path& assign(_InputIt __first, _InputIt __last) {
> > +        typedef typename iterator_traits<_InputIt>::value_type _ItVal;
> > +        __pn_.clear();
> > +        _PathCVT<_ItVal>::__append_range(__pn_, __first, __last);
> > +        return *this;
> > +    }
> > +
> > +private:
> > +    template <class _ECharT>
> > +    void __append_sep_if_needed(_ECharT __first_or_null) {
> > +        const _ECharT __null_val = {};
> > +        bool __append_sep = !empty()                       &&
> > +                            !__is_separator(__pn_.back())  &&
> > +                            __first_or_null != __null_val  && //
> non-empty
> > +                            !__is_separator(__first_or_null);
> > +        if (__append_sep)
> > +            __pn_ += preferred_separator;
> > +    }
> > +
> > +public:
> > +    // appends
> > +    path& operator/=(const path& __p) {
> > +        __append_sep_if_needed(__p.empty() ? char{} : __p.__pn_[0]);
> > +        __pn_ += __p.native();
> > +        return *this;
> > +    }
> > +
> > +    template <class _Source>
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    _EnableIfPathable<_Source>
> > +    operator/=(const _Source& __src) {
> > +        return this->append(__src);
> > +    }
> > +
> > +    template <class _Source>
> > +    _EnableIfPathable<_Source>
> > +    append(const _Source& __src) {
> > +        using _Traits = __is_pathable<_Source>;
> > +        using _CVT = _PathCVT<_SourceChar<_Source>>;
> > +        __append_sep_if_needed(_Traits::__first_or_null(__src));
> > +        _CVT::__append_source(__pn_, __src);
> > +        return *this;
> > +    }
> > +
> > +    template <class _InputIt>
> > +    path& append(_InputIt __first, _InputIt __last) {
> > +        typedef typename iterator_traits<_InputIt>::value_type _ItVal;
> > +        static_assert(__can_convert_char<_ItVal>::value, "Must
> convertible");
> > +        using _CVT = _PathCVT<_ItVal>;
> > +        if (__first != __last) {
> > +            __append_sep_if_needed(*__first);
> > +            _CVT::__append_range(__pn_, __first, __last);
> > +        }
> > +        return *this;
> > +    }
> > +
> > +    // concatenation
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    path& operator+=(const path& __x) {
> > +        __pn_ += __x.__pn_;
> > +        return *this;
> > +    }
> > +
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    path& operator+=(const string_type& __x) {
> > +        __pn_ += __x;
> > +        return *this;
> > +    }
> > +
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    path& operator+=(const value_type* __x) {
> > +        __pn_ += __x;
> > +        return *this;
> > +    }
> > +
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    path& operator+=(value_type __x) {
> > +        __pn_ += __x;
> > +        return *this;
> > +    }
> > +
> > +
> > +    template <class _ECharT>
> > +    typename enable_if<__can_convert_char<_ECharT>::value, path&>::type
> > +    operator+=(_ECharT __x)
> > +    {
> > +        basic_string<_ECharT> __tmp;
> > +        __tmp += __x;
> > +        _PathCVT<_ECharT>::__append_source(__pn_, __tmp);
> > +        return *this;
> > +    }
> > +
> > +    template <class _Source>
> > +    _EnableIfPathable<_Source>
> > +    operator+=(const _Source& __x) {
> > +       return this->concat(__x);
> > +    }
> > +
> > +    template <class _Source>
> > +    _EnableIfPathable<_Source>
> > +    concat(const _Source& __x){
>
> Missing a space before the brace.
>

Ack.


>
> > +         _SourceCVT<_Source>::__append_source(__pn_, __x);
> > +        return *this;
> > +    }
> > +
> > +    template <class _InputIt>
> > +    path& concat(_InputIt __first, _InputIt __last) {
> > +        typedef typename iterator_traits<_InputIt>::value_type _ItVal;
> > +        _PathCVT<_ItVal>::__append_range(__pn_, __first, __last);
> > +        return *this;
> > +    }
> > +
> > +    // modifiers
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    void  clear() _NOEXCEPT {
>
> Seems like a double space here.
>

Ack.


> > +        __pn_.clear();
> > +    }
> > +
> > +    path& make_preferred() { return *this; }
> > +    path& remove_filename() { return *this = parent_path(); }
> > +
> > +    path& replace_filename(const path& __replacement) {
> > +        remove_filename();
> > +        return (*this /= __replacement);
> > +    }
> > +
> > +    path& replace_extension(const path& __replacement = path());
> > +
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    void  swap(path& __rhs) _NOEXCEPT {
> > +        __pn_.swap(__rhs.__pn_);
> > +    }
> > +
> > +    // native format observers
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    const string_type& native() const _NOEXCEPT {
> > +        return __pn_;
> > +    }
> > +
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    const value_type*  c_str() const _NOEXCEPT { return __pn_.c_str(); }
>
> Ack.
>
> > +
> > +    _LIBCPP_INLINE_VISIBILITY operator string_type() const { return
> __pn_;  }
> > +
> > +    template <class _ECharT, class _Traits = char_traits<_ECharT>,
> > +              class _Allocator = allocator<_ECharT> >
>
> Does libc++ support compilers that can't handle `>>` in whatever mode
> filesystem is being made available?
>

No. That's probably habit or my IDE.


>
> > +    basic_string<_ECharT, _Traits, _Allocator>
> > +    string(const _Allocator& __a = _Allocator()) const {
> > +        using _CVT = __widen_from_utf8<sizeof(_ECharT)*__CHAR_BIT__>;
> > +        using _Str = basic_string<_ECharT, _Traits, _Allocator>;
> > +        _Str __s(__a);
> > +        __s.reserve(__pn_.size());
> > +        _CVT()(back_inserter(__s), __pn_.data(), __pn_.data() +
> __pn_.size());
> > +        return __s;
> > +    }
> > +
> > +    _LIBCPP_INLINE_VISIBILITY std::string    string()    const { return
> __pn_; }
> > +    _LIBCPP_INLINE_VISIBILITY std::wstring   wstring()   const { return
> string<wchar_t>(); }
> > +    _LIBCPP_INLINE_VISIBILITY std::string    u8string()  const { return
> __pn_; }
> > +    _LIBCPP_INLINE_VISIBILITY std::u16string u16string() const { return
> string<char16_t>(); }
> > +    _LIBCPP_INLINE_VISIBILITY std::u32string u32string() const { return
> string<char32_t>(); }
> > +
> > +    // generic format observers
> > +    template <class _ECharT, class _Traits = char_traits<_ECharT>,
> > +              class _Allocator = allocator<_ECharT>
> > +    >
> > +    basic_string<_ECharT, _Traits, _Allocator>
> > +    generic_string(const _Allocator& __a = _Allocator()) const {
> > +        return string<_ECharT, _Traits, _Allocator>(__a);
> > +    }
> > +
> > +    std::string    generic_string()    const { return __pn_; }
> > +    std::wstring   generic_wstring()   const { return
> string<wchar_t>(); }
> > +    std::string    generic_u8string()  const { return __pn_; }
> > +    std::u16string generic_u16string() const { return
> string<char16_t>(); }
> > +    std::u32string generic_u32string() const { return
> string<char32_t>(); }
> > +
> > +private:
> > +    _LIBCPP_FUNC_VIS int __compare(const value_type*) const;
> > +    _LIBCPP_FUNC_VIS string_view __root_name() const;
> > +    _LIBCPP_FUNC_VIS string_view __root_directory() const;
> > +    _LIBCPP_FUNC_VIS string_view __relative_path() const;
> > +    _LIBCPP_FUNC_VIS string_view __parent_path() const;
> > +    _LIBCPP_FUNC_VIS string_view __filename() const;
> > +    _LIBCPP_FUNC_VIS string_view __stem() const;
> > +    _LIBCPP_FUNC_VIS string_view __extension() const;
> > +
> > +public:
> > +    // compare
> > +    _LIBCPP_INLINE_VISIBILITY int compare(const path& __p) const
> _NOEXCEPT { return __compare(__p.c_str());}
> > +    _LIBCPP_INLINE_VISIBILITY int compare(const string_type& __s) const
> { return __compare(__s.c_str()); }
> > +    _LIBCPP_INLINE_VISIBILITY int compare(const value_type* __s) const
> { return __compare(__s); }
> > +
> > +    // decomposition
> > +    _LIBCPP_INLINE_VISIBILITY path root_name()      const { return
> __root_name().to_string(); }
> > +    _LIBCPP_INLINE_VISIBILITY path root_directory() const { return
> __root_directory().to_string(); }
> > +    _LIBCPP_INLINE_VISIBILITY path root_path()      const { return
> root_name().append(__root_directory().to_string()); }
> > +    _LIBCPP_INLINE_VISIBILITY path relative_path()  const { return
> __relative_path().to_string(); }
> > +    _LIBCPP_INLINE_VISIBILITY path parent_path()    const { return
> __parent_path().to_string(); }
> > +    _LIBCPP_INLINE_VISIBILITY path filename()       const { return
> __filename().to_string(); }
> > +    _LIBCPP_INLINE_VISIBILITY path stem()           const { return
> __stem().to_string();}
> > +    _LIBCPP_INLINE_VISIBILITY path extension()      const { return
> __extension().to_string(); }
> > +
> > +    // query
> > +    _LIBCPP_INLINE_VISIBILITY bool empty() const _NOEXCEPT { return
> __pn_.empty(); }
> > +
> > +    _LIBCPP_INLINE_VISIBILITY bool has_root_name()      const { return
> !__root_name().empty(); }
> > +    _LIBCPP_INLINE_VISIBILITY bool has_root_directory() const { return
> !__root_directory().empty(); }
> > +    _LIBCPP_INLINE_VISIBILITY bool has_root_path()      const { return
> !(__root_name().empty() && __root_directory().empty()); }
> > +    _LIBCPP_INLINE_VISIBILITY bool has_relative_path()  const { return
> !__relative_path().empty(); }
> > +    _LIBCPP_INLINE_VISIBILITY bool has_parent_path()    const { return
> !__parent_path().empty(); }
> > +    _LIBCPP_INLINE_VISIBILITY bool has_filename()       const { return
> !__filename().empty(); }
> > +    _LIBCPP_INLINE_VISIBILITY bool has_stem()           const { return
> !__stem().empty(); }
> > +    _LIBCPP_INLINE_VISIBILITY bool has_extension()      const { return
> !__extension().empty(); }
> > +
> > +    _LIBCPP_INLINE_VISIBILITY bool is_absolute()        const { return
> has_root_directory(); }
> > +    _LIBCPP_INLINE_VISIBILITY bool is_relative()        const { return
> !is_absolute(); }
> > +
> > +    // iterators
> > +    class _LIBCPP_TYPE_VIS iterator;
> > +    typedef iterator const_iterator;
> > +
> > +    _LIBCPP_FUNC_VIS iterator begin() const;
> > +    _LIBCPP_FUNC_VIS iterator end() const;
> > +
> > +private:
> > +    inline _LIBCPP_INLINE_VISIBILITY
> > +    path& __assign_view(string_view const& __s) noexcept { __pn_ =
> __s.to_string(); return *this; }
> > +    string_type __pn_;
> > +};
> > +
> > +inline _LIBCPP_INLINE_VISIBILITY
> > +bool operator==(const path& __lhs, const path& __rhs) _NOEXCEPT
> > +{ return __lhs.compare(__rhs) == 0; }
> > +
> > +inline _LIBCPP_INLINE_VISIBILITY
> > +bool operator!=(const path& __lhs, const path& __rhs) _NOEXCEPT
> > +{ return __lhs.compare(__rhs) != 0; }
> > +
> > +inline _LIBCPP_INLINE_VISIBILITY
> > +bool operator<(const path& __lhs, const path& __rhs) _NOEXCEPT
> > +{ return __lhs.compare(__rhs) < 0; }
> > +
> > +inline _LIBCPP_INLINE_VISIBILITY
> > +bool operator<=(const path& __lhs, const path& __rhs) _NOEXCEPT
> > +{ return __lhs.compare(__rhs) <= 0; }
> > +
> > +inline _LIBCPP_INLINE_VISIBILITY
> > +bool operator>(const path& __lhs, const path& __rhs) _NOEXCEPT
> > +{ return __lhs.compare(__rhs) > 0; }
> > +
> > +inline _LIBCPP_INLINE_VISIBILITY
> > +bool operator>=(const path& __lhs, const path& __rhs) _NOEXCEPT
> > +{ return __lhs.compare(__rhs) >= 0; }
> > +
> > +inline _LIBCPP_INLINE_VISIBILITY
> > +path operator/(const path& __lhs, const path& __rhs) {
> > +    return path(__lhs) /= __rhs;
> > +}
> > +
> > +inline _LIBCPP_ALWAYS_INLINE
> > +void swap(path& __lhs, path& __rhs) _NOEXCEPT {
> > +    __lhs.swap(__rhs);
> > +}
> > +
> > +_LIBCPP_FUNC_VIS
> > +size_t hash_value(const path& __p) _NOEXCEPT;
> > +
> > +template <class _CharT, class _Traits>
> > +_LIBCPP_INLINE_VISIBILITY
> > +typename enable_if<is_same<_CharT, char>::value &&
> > +                   is_same<_Traits, char_traits<char>>::value,
> > +                   basic_ostream<_CharT, _Traits>&
> > +>::type
> > +operator<<(basic_ostream<_CharT, _Traits>& __os, const path& __p) {
> > +    __os << std::__quoted(__p.native());
> > +    return __os;
> > +}
> > +
> > +template <class _CharT, class _Traits>
> > +_LIBCPP_INLINE_VISIBILITY
> > +typename enable_if<!is_same<_CharT, char>::value ||
> > +                   !is_same<_Traits, char_traits<char>>::value,
> > +                   basic_ostream<_CharT, _Traits>&
> > +>::type
> > +operator<<(basic_ostream<_CharT, _Traits>& __os, const path& __p) {
> > +    __os << std::__quoted(__p.string<_CharT, _Traits>());
> > +    return __os;
> > +}
> > +
> > +template <class _CharT, class _Traits>
> > +_LIBCPP_INLINE_VISIBILITY
> > +basic_istream<_CharT, _Traits>&
> > +operator>>(basic_istream<_CharT, _Traits>& __is, path& __p)
> > +{
> > +    basic_string<_CharT, _Traits> __tmp;
> > +    __is >> __quoted(__tmp);
> > +    __p = __tmp;
> > +    return __is;
> > +}
> > +
> > +template <class _Source>
> > +_LIBCPP_INLINE_VISIBILITY
> > +typename enable_if<__is_pathable<_Source>::value, path>::type
> > +u8path(const _Source& __s){
> > +    static_assert(is_same<typename __is_pathable<_Source>::__char_type,
> char>::value,
> > +        "u8path(Source const&) requires Source have a character type of
> type 'char'");
> > +    return path(__s);
> > +}
> > +
> > +template <class _InputIt>
> > +_LIBCPP_INLINE_VISIBILITY
> > +typename enable_if<__is_pathable<_InputIt>::value, path>::type
> > +u8path(_InputIt __f, _InputIt __l) {
> > +    static_assert(is_same<typename
> __is_pathable<_InputIt>::__char_type, char>::value,
> > +        "u8path(Iter, Iter) requires Iter have a value_type of type
> 'char'");
> > +    return path(__f, __l);
> > +}
> > +
> > +class _LIBCPP_TYPE_VIS path::iterator
> > +{
> > +public:
> > +    typedef bidirectional_iterator_tag iterator_category;
> > +    typedef path                       value_type;
> > +    typedef std::ptrdiff_t             difference_type;
> > +    typedef const path*                pointer;
> > +    typedef const path&                reference;
> > +public:
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    iterator() : __elem_(), __path_ptr_(nullptr), __pos_(0) {}
> > +
> > +    iterator(const iterator&) = default;
> > +    ~iterator() = default;
> > +
> > +    iterator& operator=(const iterator&) = default;
> > +
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    reference operator*() const {
> > +        return __elem_;
> > +    }
> > +
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    pointer operator->() const {
> > +        return &__elem_;
> > +    }
> > +
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    iterator& operator++() {
> > +        return __increment();
> > +    }
> > +
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    iterator operator++(int) {
> > +        iterator __it(*this);
> > +        this->operator++();
> > +        return __it;
> > +    }
> > +
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    iterator& operator--() {
> > +        return __decrement();
> > +    }
> > +
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    iterator operator--(int) {
> > +        iterator __it(*this);
> > +        this->operator--();
> > +        return __it;
> > +    }
> > +
> > +private:
> > +    friend class path;
> > +    friend bool operator==(const iterator&, const iterator&);
> > +
> > +    _LIBCPP_FUNC_VIS iterator& __increment();
> > +    _LIBCPP_FUNC_VIS iterator& __decrement();
> > +
> > +    path __elem_;
> > +    const path* __path_ptr_;
> > +    size_t __pos_;
> > +};
> > +
> > +inline _LIBCPP_INLINE_VISIBILITY
> > +bool operator==(const path::iterator& __lhs, const path::iterator&
> __rhs) {
> > +    return __lhs.__path_ptr_ == __rhs.__path_ptr_ &&
> > +           __lhs.__pos_      == __rhs.__pos_;
> > +}
> > +
> > +inline _LIBCPP_INLINE_VISIBILITY
> > +bool operator!=(const path::iterator& __lhs, const path::iterator&
> __rhs) {
> > +    return !(__lhs == __rhs);
> > +}
> > +
> > +
> > +class _LIBCPP_EXCEPTION_ABI filesystem_error : public system_error
> > +{
> > +public:
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    filesystem_error(const string& __what, error_code __ec)
> > +        : system_error(__ec, __what),
> > +          __paths_(make_shared<_Storage>(path(), path()))
> > +    {}
> > +
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    filesystem_error(const string& __what, const path& __p1, error_code
> __ec)
> > +        : system_error(__ec, __what),
> > +        __paths_(make_shared<_Storage>(__p1, path()))
> > +    {}
> > +
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    filesystem_error(const string& __what, const path& __p1, const
> path& __p2,
> > +                     error_code __ec)
> > +        : system_error(__ec, __what),
> > +          __paths_(make_shared<_Storage>(__p1, __p2))
> > +    {}
> > +
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    const path& path1() const _NOEXCEPT {
> > +        return __paths_->first;
> > +    }
> > +
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    const path& path2() const _NOEXCEPT {
> > +        return __paths_->second;
> > +    }
> > +
> > +    // COMMENTED OUT FOR REVIEW
> > +    //_LIBCPP_FUNC_VIS ~filesystem_error() override; // key function
> > +
> > +    // TODO(ericwf): Create a custom error message.
> > +    //const char* what() const _NOEXCEPT;
> > +
> > +private:
> > +    typedef pair<path, path> _Storage;
> > +    shared_ptr<_Storage> __paths_;
> > +};
> > +
> > +file_status status(path const&);
> > +file_status status(path const&, error_code&) _NOEXCEPT;
> > +file_status symlink_status(path const&);
> > +file_status symlink_status(path const&, error_code&) _NOEXCEPT;
> > +
> > +
> > +class directory_entry
> > +{
> > +    typedef _VSTD_FS::path _Path;
> > +
> > +public:
> > +    // constructors and destructors
> > +    directory_entry() _NOEXCEPT = default;
> > +    directory_entry(directory_entry const&) = default;
> > +    directory_entry(directory_entry&&) _NOEXCEPT = default;
> > +
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    explicit directory_entry(_Path const& __p) : __p_(__p) {}
> > +
> > +    ~directory_entry() {}
> > +
> > +    directory_entry& operator=(directory_entry const&) = default;
> > +    directory_entry& operator=(directory_entry&&) _NOEXCEPT = default;
> > +
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    void assign(_Path const& __p) {
> > +        __p_ = __p;
> > +    }
> > +
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    void replace_filename(_Path const& __p) {
> > +        __p_ = __p_.parent_path() / __p;
> > +    }
> > +
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    _Path const& path() const _NOEXCEPT {
> > +        return __p_;
> > +    }
> > +
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    operator const _Path&() const _NOEXCEPT {
> > +        return __p_;
> > +    }
> > +
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    file_status status() const {
> > +        return _VSTD_FS::status(__p_);
> > +    }
> > +
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    file_status status(error_code& __ec) const _NOEXCEPT {
> > +        return _VSTD_FS::status(__p_, __ec);
> > +    }
> > +
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    file_status symlink_status() const {
> > +        return _VSTD_FS::symlink_status(__p_);
> > +    }
> > +
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    file_status symlink_status(error_code& __ec) const _NOEXCEPT {
> > +        return _VSTD_FS::symlink_status(__p_, __ec);
> > +    }
> > +
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    bool operator< (directory_entry const& __rhs) const _NOEXCEPT {
> > +        return __p_ < __rhs.__p_;
> > +    }
> > +
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    bool operator==(directory_entry const& __rhs) const _NOEXCEPT {
> > +        return __p_ == __rhs.__p_;
> > +    }
> > +
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    bool operator!=(directory_entry const& __rhs) const _NOEXCEPT {
> > +        return __p_ != __rhs.__p_;
> > +    }
> > +
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    bool operator<=(directory_entry const& __rhs) const _NOEXCEPT {
> > +        return __p_ <= __rhs.__p_;
> > +    }
> > +
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    bool operator> (directory_entry const& __rhs) const _NOEXCEPT {
> > +        return __p_ > __rhs.__p_;
> > +    }
> > +
> > +    _LIBCPP_INLINE_VISIBILITY
> > +    bool operator>=(directory_entry const& __rhs) const _NOEXCEPT {
> > +        return __p_ >= __rhs.__p_;
> > +    }
> > +private:
> > +    _Path __p_;
> > +};
> > +
> > +_LIBCPP_END_NAMESPACE_EXPERIMENTAL_FILESYSTEM
> > +
> > +#endif // _LIBCPP_EXPERIMENTAL_FILESYSTEM
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160206/013bbf69/attachment-0001.html>


More information about the cfe-commits mailing list