This silences compiler warnings about using deprecated language features,
which is out-of-class definition of static constant data members.
Closes https://github.com/boostorg/filesystem/pull/121.
The algorithm implementation now ignores empty and dot path elements in the
argument path and accounts dot-dot elements by decreasing the number of
dot-dot elements to generate in the resulting relative path. This is
according to C++17 std::path specification [fs.path.gen]/4.
Fixes https://github.com/boostorg/filesystem/issues/76.
The new option allows to skip dangling directory symlinks when iterating
over a directory using recursive_directory_iterator.
This also updates the operations_test, which failed spuriously because
the test created dangling symlinks for some of its checks. Since the order
of iteration is undefined, the tests sometimes passed, when the dangling
symlinks were encountered late during the iteration.
The directory_options enum reflects the same-named enum from C++20. It is now
supported by both directory_iterator and recursive_directory_iterator. In
particular, both iterators now support skip_permission_denied option.
recursive_directory_iterator is now set to end by default on errors, as
required by C++20. An additional directory_options::pop_on_error policy
is added to allow the iterator recover from an error. When this option is
specified and an error occurs, the iterator repeatedly pops the recursion level
until the pop completes successfully or the end state is reached.
recursive_directory_iterator that have standard counterparts (level,
no_push_pending, no_push_request and no_push) are now deprecated and can be
removed by defining BOOST_FILESYSTEM_NO_DEPRECATED. These members will be
removed in a future release.
Docs and tests updated accordingly. Also, in docs reconstructed release history
for the past releases from Boost release notes.
Fixes https://github.com/boostorg/filesystem/issues/112
Fixes https://github.com/boostorg/filesystem/issues/113
Directory iteration components were moved to separate files to simplify
maintenance of operations.hpp/cpp.
directory_iterator implementation on POSIX platforms has been reworked
to only allocate internal buffer when readdir_r is used. When readdir
is used, the dirent structure returned by readdir is used directly, which
eliminates the potential of buffer overrun in case if some directory name
exceeds the buffer size. This also removes the need to copy dirent members
into the buffer, which improves performance and simplifies maintenance.
For buffer size we now use the max path size as opposed to max filename
size. This is done to minimize the possibility of buffer overruns when
readdir_r is used.
On Windows, use Boost.WinAPI to configure the default target Windows version.
This removes WINVER and _WIN32_WINNT defines in Boost.Filesystem as these
macros should be defined by Boost.WinAPI now.
Additionally, exception.hpp and directory.hpp includes in operations.hpp are
marked as deprecated as operations.hpp do not need those components. Users
are encouraged to include the new headers explicitly in their code, as needed.
This simplifies maintenance of the operations.hpp/cpp files.
Also, moved BOOST_FILESYSTEM_SOURCE definition to the build system files
instead of defining it in every source file.
POSIX.1-2008 marks utime as obsolete and replaces it with utimensat.
uClibc-ng has an option for removing utime, including the corresponding
header.
Closes https://github.com/boostorg/filesystem/pull/115.
The rvalue-aware operator/ needs to return an rvalue, not an rvalue reference
so that binding its result to a const reference in the caller's code doesn't
leave a dangling reference. This hampers operator/ efficiency to some degree,
but it is still better than the non-rvalue-aware version as it still allows
to avoid copying the path body.
The non-rvalue-aware operator/ is now creating an automatic variable which will
be returned to leverage NRVO. The previous implementation used to return
an lvalue reference to a temporary, which did not match NRVO criteria[1].
Fixes https://github.com/boostorg/filesystem/issues/110.
Closes https://github.com/boostorg/filesystem/pull/111.
[1]: https://en.cppreference.com/w/cpp/language/copy_elision
readdir_r doesn't set errno, so the calling function must use the returned error
code to construct error_code. errno is not part of the Boost.Filesystem contract
anyway.
- CMake file only supports add_subdirectory workflow.
- Compiles boost filesystem (without name mangling).
- Provides target Boost::filesystem to link against.
- Does NOT compile/run unit tests (yet) and
doesn't support installation.
The readdir_r wrapper function used to leave d_type member uninitialized, which
it is after the buffer for the dirent structure is allocated on the iterator
construction. The wrapper now copies the d_type value from the dirent structure
obtained from readdir. Additionally, dir_itr_first now clears the allocated
buffer.
std::move is not constexpr in C++11, so we can't use it in a constexpr move
constructor. Also, directory_entry move constructor now uses move constructors
of its data members instead of assignment.
Done some formatting changes to make the code look a bit more unified.