Commit Graph

1414 Commits

Author SHA1 Message Date
Andrey Semashev
b626fb2bd7 Disabled all but one OS X jobs because they are slow on Travis CI. 2019-10-22 15:12:29 +03:00
Andrey Semashev
37250ea7a6 Removed unnecessary package installs in CI. 2019-10-22 00:37:51 +03:00
Andrey Semashev
50f5bd3e9b Updated CI configs, added new compilers. 2019-10-21 23:56:15 +03:00
Andrey Semashev
dfd4387c7e Don't define static constants when C++17 inline variables are enabled.
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.
2019-10-05 23:31:38 +03:00
Andrey Semashev
e4de1c4138 Removed "new" content markup, HTML fixes, added lexically_proximate docs. 2019-10-05 23:18:30 +03:00
Andrey Semashev
06d8d660a1 Fixed path::lexically_relative to handle empty, dot and dot-dot elements.
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.
2019-10-05 19:14:21 +03:00
Andrey Semashev
adbcd1474c
Merge pull request #122 from ecatmur/patch-1
Add src/exception.cpp to CMakeLists.txt
2019-10-03 14:34:42 +03:00
Ed Catmur
7a16eab170
Add src/exception.cpp to CMakeLists.txt
After 68ec5b1fb6
2019-10-03 12:12:30 +01:00
Andrey Semashev
f795041800 Added CXXFLAGS propagation to b2 command line. 2019-08-21 18:59:14 +03:00
Andrey Semashev
9d3bd13c5a Changed C++03 to C++98 for gcc 4.4 as it doesn't recognize the former. 2019-08-21 18:52:19 +03:00
Andrey Semashev
e297c89bdc Updated Travis CI config to fix test runs. Added gcc 9 jobs. 2019-08-20 23:38:05 +03:00
Andrey Semashev
43e41d1e8a Removed unused end_of_string constant. 2019-08-20 23:14:01 +03:00
Andrey Semashev
03c797998f Added directory_options::skip_dangling_symlinks.
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.
2019-08-20 19:02:56 +03:00
Andrey Semashev
fd01febb5e Updated code indentation, changed temp buffers to use scoped_array. 2019-08-20 16:45:21 +03:00
Andrey Semashev
e8fc091f73 Moved some common Windows utilities to a separate header.
This is to fix compilation on Windows as directory iterators implementation
also need to construct permissions mask.
2019-08-02 22:07:21 +03:00
Andrey Semashev
33806dc726 Removed use of deprecated API. 2019-08-02 21:33:23 +03:00
Andrey Semashev
9a14c37d6f Added directory_options. Set recursive_dir_iterator to end or pop on errors.
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
2019-08-02 19:43:46 +03:00
Andrey Semashev
c758552338 Moved directory tools to separate files. Reworked readdir_r support.
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.
2019-08-01 20:34:39 +03:00
Andrey Semashev
400f02590c Fixed linking on MinGW and Cygwin.
GCC on Windows doesn't export vtable for filesystem_error if its destructor
is exported.
2019-08-01 14:52:07 +03:00
Andrey Semashev
f4769bd4c7 Extracted file_status and error handling helpers to separate headers.
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.
2019-07-31 23:12:56 +03:00
Andrey Semashev
68ec5b1fb6 Extracted filesystem_error to a separate header and translation unit.
This simplifies maintenance of the operations.hpp header and should also
reduce size of the generated users' code.
2019-07-31 22:58:40 +03:00
Andrey Semashev
2376d16e24 Nonessential corrections in asserts and code formatting. 2019-07-31 20:26:21 +03:00
Andrey Semashev
b66356fed0 Leave dir iterator in the end state on memory allocation errors. 2019-07-31 20:24:54 +03:00
Andrey Semashev
83b989ecee Added support for utimensat for better POSIX.1-2008 compliance.
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.
2019-07-31 16:34:18 +03:00
Andrey Semashev
812cb9bad3 Marked hash_value for path noexcept. 2019-06-19 15:09:39 +03:00
Andrey Semashev
701ae40549 Fixed rvalue-aware operator/ return type, leverage NRVO.
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
2019-06-19 14:57:23 +03:00
Andrey Semashev
b9a6648b93 Fixed a typo in the comment. 2019-04-16 12:17:05 +03:00
Andrey Semashev
192866fb0e
Merge pull request #24 from muggenhor/wince-missing-current-directory
WinCE has no current directory
2019-04-16 12:16:19 +03:00
Andrey Semashev
28ccca4ef8 Fixed incorrect error_code returned from dir_it increment when readdir_r is used
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.
2019-04-16 11:38:54 +03:00
Andrey Semashev
1bcf925afc
Merge pull request #106 from Mike-Devel/min_cmake
[CMake] Add minimal cmake support
2019-04-15 12:10:24 +03:00
Mike-Devel
8ae582a321
[CMake] Add missing private dependency on winapi 2019-04-15 10:49:27 +02:00
Andrey Semashev
cdc79612a1 Changed VS2013 images to VS2015 to work around bootstrap failures in Appveyor CI. 2019-04-15 11:48:40 +03:00
Andrey Semashev
5f74f5c594
Merge pull request #107 from Kojoley/patch-1
operations_test: Enable locale query on MinGW/Cygwin
2019-04-14 20:48:42 +03:00
Nikita Kniazev
a5c4b21988
operations_test: Enable locale query on MinGW/Cygwin
The `GetUserDefaultUILanguage` is available for a quite long time already (about 19 years for Cygwin, and 7-12 years for MinGW).
2019-04-02 15:29:13 +03:00
Mike Dev
0f8e3acd06 [CMake] Add minimal cmake support
- 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.
2019-03-08 16:08:42 +01:00
Andrey Semashev
e49775e8bb
Merge pull request #105 from MarcelRaad/extra_semi
Fix -Wextra-semi clang warnings
2019-02-25 12:32:14 +03:00
Marcel Raad
1cf17855b2
Fix -Wextra-semi clang warnings
Remove superfluous semicola.
2019-02-25 10:26:56 +01:00
Andrey Semashev
b0a0fde650 Enabled multiple git fetch jobs while executing depinst in CI. Increased the number of jobs to 8. 2019-01-15 13:48:10 +03:00
Andrey Semashev
27256f9d55 Removed asynch-exceptions=on for MSVC. 2019-01-14 20:46:59 +03:00
Andrey Semashev
c0c93a0c58 Removed linking with Boost.System from docs and examples. 2019-01-14 20:40:06 +03:00
Andrey Semashev
2c1fa1a4a0 Removed linking with Boost.System.
Since Boost.System is now header-only, no need to depend on its library.

Fixes https://github.com/boostorg/filesystem/issues/98.
2019-01-14 20:08:41 +03:00
Andrey Semashev
bbe9d1771e Fixed possible use of uninitialized dirent::d_type in dir_iterator increment.
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.
2019-01-09 16:58:51 +03:00
Andrey Semashev
31812f82c6 Use the actual number of logical CPUs for the number of CI build/test jobs. 2019-01-03 23:08:36 +03:00
Andrey Semashev
ccbdab82a1 Re-added manual checkout of libs/config in CI as Boost.Build depends on it. 2018-12-20 20:45:02 +03:00
Andrey Semashev
f0f77cfe73 Revert "Added an experimental partial CMakeLists.txt for dependency tracking in CMake projects."
This reverts commit 3c18ac362e.

Apparently, just adding include paths to user's CMake projects is not enough
for the original requester.

https://github.com/boostorg/atomic/pull/20#issuecomment-448345886
2018-12-18 23:02:52 +03:00
Andrey Semashev
4ee7e0f773 Use a separate submodule update step with parallel checkouts to speedup CI job startup. 2018-12-18 22:32:37 +03:00
Andrey Semashev
5889d32391 Added tools/boost_install and libs/headers manual checkout to CI jobs. 2018-12-18 21:56:14 +03:00
Andrey Semashev
3c18ac362e Added an experimental partial CMakeLists.txt for dependency tracking in CMake projects. 2018-12-18 19:41:59 +03:00
Andrey Semashev
015d414fca Fixed use of std::move in a constexpr condtructor. Formatting changes.
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.
2018-12-11 18:03:19 +03:00
Andrey Semashev
f6306bae0f Silence MSVC warning C4250 about overriding virtual functions from iostream base classes. 2018-12-09 18:43:40 +03:00