Implement C++17 Filesystem library
commit3b90ed62fb848046ed7ddef07df7c806e7f3fadb
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 23 Oct 2017 12:11:22 +0000 (23 12:11 +0000)
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 23 Oct 2017 12:11:22 +0000 (23 12:11 +0000)
tree10dddf8d3eafa45b38924701f2a0e58d175aea57
parentf66b5a831380b917cc176ccc241cc3c241392658
Implement C++17 Filesystem library

Based on Filesystem TS implementation, with the changes applied by:

- P0219R1 Relative Paths for Filesystem
- P0317R1 Directory Entry Caching for Filesystem
- P0492R2 Resolution of C++17 National Body Comments

Where appropriate code is shared between the TS and C++17
implementations.

* include/Makefile.am: Add new headers for C++17 filesystem library.
* include/Makefile.in: Regenerate.
* include/bits/fs_dir.h: New header, based on Filesystem TS code in
include/experimental/bits directory.
* include/bits/fs_fwd.h: Likewise.
* include/bits/fs_ops.h: Likewise.
* include/bits/fs_path.h: Likewise.
* include/experimental/bits/fs_dir.h: Rename Doxygen group.
* include/experimental/bits/fs_fwd.h: Likewise.
* include/experimental/bits/fs_ops.h: Likewise.
* include/experimental/bits/fs_path.h: Likewise.
* include/experimental/filesystem (filesystem_error::_M_gen_what):
Remove inline definition.
* include/precompiled/stdc++.h: Add <filesystem> to precompiled
header.
* include/std/filesystem: New header.
* python/libstdcxx/v6/printers.py: Enable printer for std::filesystem
paths.
* src/filesystem/Makefile.am: Add new files. Compile as C++17.
* src/filesystem/Makefile.in: Regenerate.
* src/filesystem/cow-dir.cc: Update comment.
* src/filesystem/cow-ops.cc: Likewise.
* src/filesystem/cow-path.cc: Likewise.
* src/filesystem/cow-std-dir.cc: New file.
* src/filesystem/cow-std-ops.cc: New file.
* src/filesystem/cow-std-path.cc: New file.
* src/filesystem/dir-common.h (_Dir_base, get_file_type): New header
for common code.
* src/filesystem/dir.cc (_Dir): Derive from _Dir_base.
(open_dir): Move to _Dir_base constructor.
(get_file_type): Move to dir-common.h.
(recurse): Move to _Dir_base::should_recurse.
* src/filesystem/ops-common.h: New header for common code.
* src/filesystem/ops.cc (is_set, make_file_type, make_file_status)
(is_not_found_errno, file_time, do_copy_file): Move to ops-common.h.
* src/filesystem/path.cc (filesystem_error::_M_gen_what): Define.
* src/filesystem/std-dir.cc: New file, based on Filesystem TS code.
* src/filesystem/std-ops.cc: Likewise.
* src/filesystem/std-dir.cc: Likewise.
* testsuite/27_io/filesystem/iterators/directory_iterator.cc: New
test.
* testsuite/27_io/filesystem/iterators/pop.cc: New test.
* testsuite/27_io/filesystem/iterators/recursive_directory_iterator.cc:
New test.
* testsuite/27_io/filesystem/operations/absolute.cc: New test.
* testsuite/27_io/filesystem/operations/canonical.cc: New test.
* testsuite/27_io/filesystem/operations/copy.cc: New test.
* testsuite/27_io/filesystem/operations/copy_file.cc: New test.
* testsuite/27_io/filesystem/operations/create_directories.cc: New
test.
* testsuite/27_io/filesystem/operations/create_directory.cc: New test.
* testsuite/27_io/filesystem/operations/create_symlink.cc: New test.
* testsuite/27_io/filesystem/operations/current_path.cc: New test.
* testsuite/27_io/filesystem/operations/equivalent.cc: New test.
* testsuite/27_io/filesystem/operations/exists.cc: New test.
* testsuite/27_io/filesystem/operations/file_size.cc: New test.
* testsuite/27_io/filesystem/operations/is_empty.cc: New test.
* testsuite/27_io/filesystem/operations/last_write_time.cc: New test.
* testsuite/27_io/filesystem/operations/permissions.cc: New test.
* testsuite/27_io/filesystem/operations/proximate.cc: New test.
* testsuite/27_io/filesystem/operations/read_symlink.cc: New test.
* testsuite/27_io/filesystem/operations/relative.cc: New test.
* testsuite/27_io/filesystem/operations/remove_all.cc: New test.
* testsuite/27_io/filesystem/operations/space.cc: New test.
* testsuite/27_io/filesystem/operations/status.cc: New test.
* testsuite/27_io/filesystem/operations/symlink_status.cc: New test.
* testsuite/27_io/filesystem/operations/temp_directory_path.cc: New
test.
* testsuite/27_io/filesystem/operations/weakly_canonical.cc: New test.
* testsuite/27_io/filesystem/path/append/path.cc: New test.
* testsuite/27_io/filesystem/path/assign/assign.cc: New test.
* testsuite/27_io/filesystem/path/assign/copy.cc: New test.
* testsuite/27_io/filesystem/path/compare/compare.cc: New test.
* testsuite/27_io/filesystem/path/compare/path.cc: New test.
* testsuite/27_io/filesystem/path/compare/strings.cc: New test.
* testsuite/27_io/filesystem/path/concat/path.cc: New test.
* testsuite/27_io/filesystem/path/concat/strings.cc: New test.
* testsuite/27_io/filesystem/path/construct/copy.cc: New test.
* testsuite/27_io/filesystem/path/construct/default.cc: New test.
* testsuite/27_io/filesystem/path/construct/locale.cc: New test.
* testsuite/27_io/filesystem/path/construct/range.cc: New test.
* testsuite/27_io/filesystem/path/construct/string_view.cc: New test.
* testsuite/27_io/filesystem/path/decompose/extension.cc: New test.
* testsuite/27_io/filesystem/path/decompose/filename.cc: New test.
* testsuite/27_io/filesystem/path/decompose/parent_path.cc: New test.
* testsuite/27_io/filesystem/path/decompose/relative_path.cc: New
test.
* testsuite/27_io/filesystem/path/decompose/root_directory.cc: New
test.
* testsuite/27_io/filesystem/path/decompose/root_name.cc: New test.
* testsuite/27_io/filesystem/path/decompose/root_path.cc: New test.
* testsuite/27_io/filesystem/path/decompose/stem.cc: New test.
* testsuite/27_io/filesystem/path/generation/normal.cc: New test.
* testsuite/27_io/filesystem/path/generation/proximate.cc: New test.
* testsuite/27_io/filesystem/path/generation/relative.cc: New test.
* testsuite/27_io/filesystem/path/generic/generic_string.cc: New test.
* testsuite/27_io/filesystem/path/itr/traversal.cc: New test.
* testsuite/27_io/filesystem/path/modifiers/clear.cc: New test.
* testsuite/27_io/filesystem/path/modifiers/make_preferred.cc: New
test.
* testsuite/27_io/filesystem/path/modifiers/remove_filename.cc: New
test.
* testsuite/27_io/filesystem/path/modifiers/replace_extension.cc: New
test.
* testsuite/27_io/filesystem/path/modifiers/replace_filename.cc: New
test.
* testsuite/27_io/filesystem/path/modifiers/swap.cc: New test.
* testsuite/27_io/filesystem/path/native/string.cc: New test.
* testsuite/27_io/filesystem/path/nonmember/hash_value.cc: New test.
* testsuite/27_io/filesystem/path/query/empty.cc: New test.
* testsuite/27_io/filesystem/path/query/has_extension.cc: New test.
* testsuite/27_io/filesystem/path/query/has_filename.cc: New test.
* testsuite/27_io/filesystem/path/query/has_parent_path.cc: New test.
* testsuite/27_io/filesystem/path/query/has_relative_path.cc: New
test.
* testsuite/27_io/filesystem/path/query/has_root_directory.cc: New
test.
* testsuite/27_io/filesystem/path/query/has_root_name.cc: New test.
* testsuite/27_io/filesystem/path/query/has_root_path.cc: New test.
* testsuite/27_io/filesystem/path/query/has_stem.cc: New test.
* testsuite/27_io/filesystem/path/query/is_relative.cc: New test.
* testsuite/experimental/filesystem/path/construct/string_view.cc:
Define USE_FILESYSTEM_TS.
* testsuite/util/testsuite_fs.h: Allow use with C++17 paths as well
as Filesystem TS.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@254008 138bc75d-0d04-0410-961f-82ee72b054a4
103 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/include/Makefile.am
libstdc++-v3/include/Makefile.in
libstdc++-v3/include/bits/fs_dir.h [copied from libstdc++-v3/include/experimental/bits/fs_dir.h with 68% similarity]
libstdc++-v3/include/bits/fs_fwd.h [copied from libstdc++-v3/include/experimental/bits/fs_fwd.h with 77% similarity]
libstdc++-v3/include/bits/fs_ops.h [copied from libstdc++-v3/include/experimental/bits/fs_ops.h with 86% similarity]
libstdc++-v3/include/bits/fs_path.h [copied from libstdc++-v3/include/experimental/bits/fs_path.h with 86% similarity]
libstdc++-v3/include/experimental/bits/fs_dir.h
libstdc++-v3/include/experimental/bits/fs_fwd.h
libstdc++-v3/include/experimental/bits/fs_ops.h
libstdc++-v3/include/experimental/bits/fs_path.h
libstdc++-v3/include/experimental/filesystem
libstdc++-v3/include/precompiled/stdc++.h
libstdc++-v3/include/std/filesystem [copied from libstdc++-v3/src/filesystem/cow-dir.cc with 68% similarity]
libstdc++-v3/python/libstdcxx/v6/printers.py
libstdc++-v3/src/filesystem/Makefile.am
libstdc++-v3/src/filesystem/Makefile.in
libstdc++-v3/src/filesystem/cow-dir.cc
libstdc++-v3/src/filesystem/cow-ops.cc
libstdc++-v3/src/filesystem/cow-path.cc
libstdc++-v3/src/filesystem/cow-std-dir.cc [copied from libstdc++-v3/src/filesystem/cow-dir.cc with 98% similarity]
libstdc++-v3/src/filesystem/cow-std-ops.cc [copied from libstdc++-v3/src/filesystem/cow-ops.cc with 98% similarity]
libstdc++-v3/src/filesystem/cow-std-path.cc [copied from libstdc++-v3/src/filesystem/cow-path.cc with 97% similarity]
libstdc++-v3/src/filesystem/dir-common.h [new file with mode: 0644]
libstdc++-v3/src/filesystem/dir.cc
libstdc++-v3/src/filesystem/ops-common.h [new file with mode: 0644]
libstdc++-v3/src/filesystem/ops.cc
libstdc++-v3/src/filesystem/path.cc
libstdc++-v3/src/filesystem/std-dir.cc [copied from libstdc++-v3/src/filesystem/dir.cc with 52% similarity]
libstdc++-v3/src/filesystem/std-ops.cc [copied from libstdc++-v3/src/filesystem/ops.cc with 75% similarity]
libstdc++-v3/src/filesystem/std-path.cc [copied from libstdc++-v3/src/filesystem/path.cc with 60% similarity]
libstdc++-v3/testsuite/27_io/filesystem/iterators/directory_iterator.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/filesystem/iterators/pop.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/filesystem/iterators/recursive_directory_iterator.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/filesystem/operations/absolute.cc [copied from libstdc++-v3/testsuite/experimental/filesystem/path/construct/string_view.cc with 58% similarity]
libstdc++-v3/testsuite/27_io/filesystem/operations/canonical.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/filesystem/operations/copy.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/filesystem/operations/copy_file.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/filesystem/operations/create_directories.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/filesystem/operations/create_directory.cc [copied from libstdc++-v3/testsuite/experimental/filesystem/path/construct/string_view.cc with 55% similarity]
libstdc++-v3/testsuite/27_io/filesystem/operations/create_symlink.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/filesystem/operations/current_path.cc [copied from libstdc++-v3/testsuite/experimental/filesystem/path/construct/string_view.cc with 53% similarity]
libstdc++-v3/testsuite/27_io/filesystem/operations/equivalent.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/filesystem/operations/exists.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/filesystem/operations/file_size.cc [copied from libstdc++-v3/testsuite/experimental/filesystem/path/construct/string_view.cc with 50% similarity]
libstdc++-v3/testsuite/27_io/filesystem/operations/is_empty.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/filesystem/operations/last_write_time.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/filesystem/operations/permissions.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/filesystem/operations/proximate.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/filesystem/operations/read_symlink.cc [copied from libstdc++-v3/testsuite/experimental/filesystem/path/construct/string_view.cc with 62% similarity]
libstdc++-v3/testsuite/27_io/filesystem/operations/relative.cc [copied from libstdc++-v3/testsuite/experimental/filesystem/path/construct/string_view.cc with 53% similarity]
libstdc++-v3/testsuite/27_io/filesystem/operations/remove_all.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/filesystem/operations/space.cc [copied from libstdc++-v3/testsuite/experimental/filesystem/path/construct/string_view.cc with 57% similarity]
libstdc++-v3/testsuite/27_io/filesystem/operations/status.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/filesystem/operations/symlink_status.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/filesystem/operations/temp_directory_path.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/filesystem/operations/weakly_canonical.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/filesystem/path/append/path.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/filesystem/path/assign/assign.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/filesystem/path/assign/copy.cc [copied from libstdc++-v3/testsuite/experimental/filesystem/path/construct/string_view.cc with 60% similarity]
libstdc++-v3/testsuite/27_io/filesystem/path/compare/compare.cc [copied from libstdc++-v3/testsuite/experimental/filesystem/path/construct/string_view.cc with 58% similarity]
libstdc++-v3/testsuite/27_io/filesystem/path/compare/path.cc [copied from libstdc++-v3/testsuite/experimental/filesystem/path/construct/string_view.cc with 58% similarity]
libstdc++-v3/testsuite/27_io/filesystem/path/compare/strings.cc [copied from libstdc++-v3/testsuite/experimental/filesystem/path/construct/string_view.cc with 58% similarity]
libstdc++-v3/testsuite/27_io/filesystem/path/concat/path.cc [copied from libstdc++-v3/testsuite/experimental/filesystem/path/construct/string_view.cc with 50% similarity]
libstdc++-v3/testsuite/27_io/filesystem/path/concat/strings.cc [copied from libstdc++-v3/testsuite/experimental/filesystem/path/construct/string_view.cc with 54% similarity]
libstdc++-v3/testsuite/27_io/filesystem/path/construct/copy.cc [copied from libstdc++-v3/testsuite/experimental/filesystem/path/construct/string_view.cc with 61% similarity]
libstdc++-v3/testsuite/27_io/filesystem/path/construct/default.cc [copied from libstdc++-v3/testsuite/experimental/filesystem/path/construct/string_view.cc with 59% similarity]
libstdc++-v3/testsuite/27_io/filesystem/path/construct/locale.cc [copied from libstdc++-v3/testsuite/experimental/filesystem/path/construct/string_view.cc with 59% similarity]
libstdc++-v3/testsuite/27_io/filesystem/path/construct/range.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/filesystem/path/construct/string_view.cc [copied from libstdc++-v3/testsuite/experimental/filesystem/path/construct/string_view.cc with 94% similarity]
libstdc++-v3/testsuite/27_io/filesystem/path/decompose/extension.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/filesystem/path/decompose/filename.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/filesystem/path/decompose/parent_path.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/filesystem/path/decompose/relative_path.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/filesystem/path/decompose/root_directory.cc [copied from libstdc++-v3/testsuite/experimental/filesystem/path/construct/string_view.cc with 54% similarity]
libstdc++-v3/testsuite/27_io/filesystem/path/decompose/root_name.cc [copied from libstdc++-v3/testsuite/experimental/filesystem/path/construct/string_view.cc with 58% similarity]
libstdc++-v3/testsuite/27_io/filesystem/path/decompose/root_path.cc [copied from libstdc++-v3/testsuite/experimental/filesystem/path/construct/string_view.cc with 50% similarity]
libstdc++-v3/testsuite/27_io/filesystem/path/decompose/stem.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/filesystem/path/generation/normal.cc [copied from libstdc++-v3/testsuite/experimental/filesystem/path/construct/string_view.cc with 52% similarity]
libstdc++-v3/testsuite/27_io/filesystem/path/generation/proximate.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/filesystem/path/generation/relative.cc [copied from libstdc++-v3/testsuite/experimental/filesystem/path/construct/string_view.cc with 50% similarity]
libstdc++-v3/testsuite/27_io/filesystem/path/generic/generic_string.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/filesystem/path/itr/traversal.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/filesystem/path/modifiers/clear.cc [copied from libstdc++-v3/testsuite/experimental/filesystem/path/construct/string_view.cc with 58% similarity]
libstdc++-v3/testsuite/27_io/filesystem/path/modifiers/make_preferred.cc [copied from libstdc++-v3/testsuite/experimental/filesystem/path/construct/string_view.cc with 57% similarity]
libstdc++-v3/testsuite/27_io/filesystem/path/modifiers/remove_filename.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/filesystem/path/modifiers/replace_extension.cc [copied from libstdc++-v3/testsuite/experimental/filesystem/path/construct/string_view.cc with 58% similarity]
libstdc++-v3/testsuite/27_io/filesystem/path/modifiers/replace_filename.cc [copied from libstdc++-v3/testsuite/experimental/filesystem/path/construct/string_view.cc with 52% similarity]
libstdc++-v3/testsuite/27_io/filesystem/path/modifiers/swap.cc [copied from libstdc++-v3/testsuite/experimental/filesystem/path/construct/string_view.cc with 58% similarity]
libstdc++-v3/testsuite/27_io/filesystem/path/native/string.cc [copied from libstdc++-v3/testsuite/experimental/filesystem/path/construct/string_view.cc with 51% similarity]
libstdc++-v3/testsuite/27_io/filesystem/path/nonmember/hash_value.cc [copied from libstdc++-v3/testsuite/experimental/filesystem/path/construct/string_view.cc with 58% similarity]
libstdc++-v3/testsuite/27_io/filesystem/path/query/empty.cc [copied from libstdc++-v3/testsuite/experimental/filesystem/path/construct/string_view.cc with 58% similarity]
libstdc++-v3/testsuite/27_io/filesystem/path/query/has_extension.cc [copied from libstdc++-v3/testsuite/experimental/filesystem/path/construct/string_view.cc with 58% similarity]
libstdc++-v3/testsuite/27_io/filesystem/path/query/has_filename.cc [copied from libstdc++-v3/testsuite/experimental/filesystem/path/construct/string_view.cc with 58% similarity]
libstdc++-v3/testsuite/27_io/filesystem/path/query/has_parent_path.cc [copied from libstdc++-v3/testsuite/experimental/filesystem/path/construct/string_view.cc with 58% similarity]
libstdc++-v3/testsuite/27_io/filesystem/path/query/has_relative_path.cc [copied from libstdc++-v3/testsuite/experimental/filesystem/path/construct/string_view.cc with 58% similarity]
libstdc++-v3/testsuite/27_io/filesystem/path/query/has_root_directory.cc [copied from libstdc++-v3/testsuite/experimental/filesystem/path/construct/string_view.cc with 58% similarity]
libstdc++-v3/testsuite/27_io/filesystem/path/query/has_root_name.cc [copied from libstdc++-v3/testsuite/experimental/filesystem/path/construct/string_view.cc with 58% similarity]
libstdc++-v3/testsuite/27_io/filesystem/path/query/has_root_path.cc [copied from libstdc++-v3/testsuite/experimental/filesystem/path/construct/string_view.cc with 58% similarity]
libstdc++-v3/testsuite/27_io/filesystem/path/query/has_stem.cc [copied from libstdc++-v3/testsuite/experimental/filesystem/path/construct/string_view.cc with 58% similarity]
libstdc++-v3/testsuite/27_io/filesystem/path/query/is_relative.cc [copied from libstdc++-v3/testsuite/experimental/filesystem/path/construct/string_view.cc with 58% similarity]
libstdc++-v3/testsuite/experimental/filesystem/path/construct/string_view.cc
libstdc++-v3/testsuite/util/testsuite_fs.h