Commit Graph

1414 Commits

Author SHA1 Message Date
Andrey Semashev
4e639c353e Fixed compilation in C++03 mode caused by incorrect casts of scoped enums. 2018-12-09 17:10:22 +03:00
Andrey Semashev
3a90694383 Export dir_entry members instead of the class. Move rdit impl to the library.
This should silence MSVC warnings about path not being exported when used in
directory_entry. This should also remove unnecessary references to the library
for the inline members of directory_entry.

Removed library exports markup for file_status as there were nothing to export.
Also marked its methods constexpr.

Moved recursive_directory_iterator implementation to the library. MSVC should
not issue warnings since we're only exporting member functions.

Updated BOOST_SCOPED_ENUM emulation use to the more recent macros. Made sure
recursive_directory_iterator implementation uses binary compatible
representation for scoped enums between the library and user's code regardless
of C++ versions used.
2018-12-09 15:51:35 +03:00
Andrey Semashev
ed5f5aa080 Refactored current_path() and read_symlink(), corrected errno handling.
The current_path() and read_symlink() algorithms had the potential to cause
memory exhaustion as they were looping trying to allocate exponentially larger
buffers without limit. Now the common limit is defined to 16MiB, the library
will not accept larger paths from the system calls. This is mostly a precaution
against broken or maliciously tampered with filesystems. Also, the functions
will start with a larger stack-based buffer to avoid dynamic memory allocation
at all in the best case scenario.

Also, increased the size of the buffer used by copy_file().

Corrected errno uses in a few places and made sure errno is read before it could
be modified by any system calls made by the error handling machinery.
2018-12-09 14:22:54 +03:00
Andrey Semashev
a5dce21b60 Removed test log. 2018-12-09 01:30:50 +03:00
Andrey Semashev
1428b4f55c Changed the way path exports are declared. Some code cleanup.
Instead of exporting the whole path class, export only the functions that
are actually implemented in the shared library and leave the rest inline.
Also, move the definition of the static constants of the path class to
the header to avoid problems with exporting them from the shared library,
as observed with various MSVC versions and also gcc 7.3 from MinGW-w64.

Also, reduced code duplication and added a more efficient operator/
implementation when rvalue references are available.
2018-12-09 01:26:24 +03:00
Andrey Semashev
0405bf95e7 Added MinGW-w64 gcc 7.3 job. 2018-12-08 19:27:27 +03:00
Andrey Semashev
ab4806b7f6 Added a workaround for MSVC <= 12 linking bug because of multiple definitions of path static constants. 2018-11-25 01:16:14 +03:00
Andrey Semashev
0703e62a31 Fixed Boost.WinAPI namespace qualification. 2018-11-24 23:48:38 +03:00
Andrey Semashev
28d0a6b763 Improve compatibility with GetProcAddress on Windows CE.
Use Boost.WinAPI to work around Windows SDK differences with Windows CE.

Closes https://github.com/boostorg/filesystem/pull/23.
2018-11-24 21:34:10 +03:00
Andrey Semashev
6ffe7f09cc Updated status functions for directory_entry. 2018-11-24 21:33:56 +03:00
Andrey Semashev
1cfaf4839d Converted tabs to spaces in the Jamfile. 2018-11-24 21:26:14 +03:00
Andrey Semashev
f8a3d096f7
Merge pull request #78 from datadiode/develop
path.hpp: Unify coding style of path_traits::convert() calls
2018-11-24 21:06:09 +03:00
emmett-b
4731ce79de Added directory_entry overloads for status query functions 2018-11-24 20:52:12 +03:00
Andrey Semashev
8de281773f Added definitions for path static constants.
This fixes compilation if user's code attempts to ODR-use the constants.

Fixes https://svn.boost.org/trac10/ticket/12759.
Closes https://github.com/boostorg/filesystem/pull/40.
2018-11-24 20:34:44 +03:00
Andrey Semashev
613df5a93d
Merge pull request #38 from jwilk-forks/spelling
Fix typos in documentation
2018-11-24 20:17:54 +03:00
Andrey Semashev
8c9bba511c More robust error handling in directory_iterator_increment. 2018-11-24 20:15:40 +03:00
Andrey Semashev
fe0e264cf6
Merge pull request #46 from programmerjake/develop
fix ISO9660 Joliet name and remove extraneous character
2018-11-24 19:57:14 +03:00
Andrey Semashev
5a70ced692 Reverted the previous change regarding warnings aboit slicing exceptions.
Apparently, slicing was intentional, and the test verified that it worked.
This commit restores the previous behavior and disables the gcc warning
instead.
2018-11-24 18:59:08 +03:00
Andrey Semashev
8e4a631231 Fixed termination on OOM in directory iterators. Added non-throwing rdit::pop().
When an out-of-memory condition is detected (either by catching std::bad_alloc
or by receiving null on memory allocation), do not propagate the exception and
set an appropriate error code instead. This fix only concerns directory_iterator
and recursive_directory_iterator for now; it is possible that other operations
remain not ready for memory allocation failures.

Also, added recursive_directory_iterator::pop() that returns error code instead
of throwing an exception. This overload is present in C++17.

Fixes https://github.com/boostorg/filesystem/issues/58.
Closes https://github.com/boostorg/filesystem/pull/63.
2018-11-24 18:36:54 +03:00
Andrey Semashev
e268f557df Trim trailing spaces in the tests. 2018-11-24 15:23:43 +03:00
Andrey Semashev
d710f5d9d9 Fixed warnings about slicing exceptions and ignoring std::system result. 2018-11-24 15:21:19 +03:00
Andrey Semashev
498a090b53 Added support for movability to directory iterators, code cleanup.
Switched directory_iterator and recursive_directory_iterator to use
intrusive_ptr internally to reduce the iterator size and avoid virtual
function calls. The iterators now support move semantics. Fixed a warning
about deprecated in C++20 implicit generation of copy constructor and
assignment operator if there is a user-defined destructor.

Also updated a few includes to refer to non-deprecated headers. Trimmed
trailing spaces in headers and sources.
2018-11-24 15:06:01 +03:00
Andrey Semashev
7dc1712f2d Fix compilation on QNX up to and including version 7.
Reportedly, QNX does not support fchmodat, although it may support it
in the future.

Fixes https://github.com/boostorg/filesystem/issues/89.
2018-11-12 17:52:18 +03:00
Andrey Semashev
6f89f73d7e Added clang 7 CI job. 2018-11-01 20:26:11 +03:00
Andrey Semashev
0872f63031 Adde more directions to the readme file. 2018-11-01 16:46:17 +03:00
Andrey Semashev
26bf8bef94 Added a readme file. 2018-11-01 16:31:28 +03:00
Andrey Semashev
60ac413f74 Fixed JSON metadata. 2018-10-30 11:48:16 +03:00
Andrey Semashev
30f56bdb99 Added myself as a maintainer. 2018-10-24 17:57:49 +03:00
Peter Dimov
3ae9ac8e27 Add global visibility to libboost_filesystem as well 2018-09-26 08:29:28 +03:00
Peter Dimov
7ba4bfb949 Simplify test/Jamfile 2018-09-26 06:05:17 +03:00
Peter Dimov
68909064bd Disable hidden visibility under UBSan for the codecvt-using tests 2018-09-26 05:58:36 +03:00
Peter Dimov
0837d92982 poison_category() was undefined behavior, use a normal one 2018-09-26 01:34:19 +03:00
Peter Dimov
e9d434eff3 Add address-model=32,64 to Appveyor 2018-09-25 21:31:35 +03:00
Peter Dimov
587afb23ff Update appveyor.yml 2018-09-25 21:29:55 +03:00
Peter Dimov
21494b5f98 Do not convert to wstring on POSIX in unique_path 2018-09-17 23:16:42 +03:00
Peter Dimov
16821f7903 Add libstdc++-4.9-dev to clang-3.6 2018-09-07 07:01:15 +03:00
Peter Dimov
53701650d6 Remove the llvm-precise APT sources from Travis 2018-09-07 04:46:14 +03:00
Peter Dimov
e6df54ce81 Return correct count from remove_all_aux on error 2018-09-07 01:34:07 +03:00
Peter Dimov
350109a991 Fix issue identified in PR #53 2018-09-06 23:46:25 +03:00
Peter Dimov
5e411be147 Merge branch 'feature/readdir_r' into develop 2018-09-06 16:45:14 +03:00
Peter Dimov
9ed5b9e31d Fix test to better tolerate parallel execution 2018-09-06 07:00:41 +03:00
Peter Dimov
cdbf5a0be1
Merge pull request #44 from DanielaE/fix/narrowing
fix compiler warnings about narrowing conversions
2018-09-06 05:57:57 +03:00
Peter Dimov
e560896924
Merge pull request #49 from dkolsen-pgi/pgi-compiler-support
Update PGI C++ compiler support
2018-09-06 05:15:43 +03:00
Peter Dimov
0f6e3f0686 Merge branch 'remove_readdir_r' of https://github.com/Lastique/filesystem into feature/readdir_r 2018-09-06 04:28:31 +03:00
Peter Dimov
8dc8861b2a Merge branch 'feature/ubsan-enum-range-2' into feature/70-71-copy 2018-09-06 03:33:12 +03:00
Peter Dimov
c0528ab880 Extend bitmask enum types to 32 bits to placate ubsan 2018-09-06 02:22:58 +03:00
Peter Dimov
62217174c6 Merge branch 'patch-2' of https://github.com/rcombs/filesystem into feature/70-71-copy 2018-09-05 23:26:21 +03:00
Peter Dimov
a183553454 Add a test for the fs::copy issue in PR #70/#71 2018-09-05 22:24:09 +03:00
Peter Dimov
ad406ba3c8 Merge branch 'mac/bug30973' of https://github.com/mikecrowe/filesystem into feature/ubsan 2018-09-05 20:39:35 +03:00
Peter Dimov
88250119ab Use -fuse-ld=gold for g++-8/ubsan 2018-09-05 20:03:53 +03:00