35 Commits

Author SHA1 Message Date
Andrey Semashev
7339882ccf Added BOOST_FILESYSTEM_VERSION 4 and moved breaking path changes to v4.
Boost.Filesystem v4 will contain breaking changes from v3 that are required
for better compatibility with C++17 std::filesystem. It will also remove
the deprecated features of v3.

Updated docs to reflect the differences between v3 and v4. Updated tests
to verify both v3 and v4 where the differences are present.
2021-06-13 03:20:30 +03:00
Andrey Semashev
60e908dfcf Don't return root directory from path::filename().
This is a breaking change.

path::filename accessor now only returns the actual filename or the implied
trailing dot element of the path, if it ends with a separator other than
root directory. This makes boost::filesystem::path behavior closer to that
of std::filesystem::path.

Updated tests and docs accordingly.

Closes https://github.com/boostorg/filesystem/issues/194.
2021-06-10 03:49:30 +03:00
Andrey Semashev
4b84226783 Refactored path implementation for better support Windows path prefixes.
- Unified root name and root directory parsing that was scattered and
  duplicated across different algorithms. The new implementation is
  consolidated in a single function for parsing root name and root
  directory, which is used from various algorithms.

- The new root name parsing now supports Windows local device ("\\.\")
  and NT path ("\??\") prefixes. It also adds support for filesystem
  ("\\?\") prefix to some of the higher level algorithms that were
  using custom parsing previously. Tests updated to verify these prefixes.

- Some of the path decomposition methods were unified with presence checking
  methods (e.g. root_name with has_root_name). This makes these methods
  work consistently and also makes the has_* methods less expensive as
  they no longer have to construct a path only to check if it is empty.

- The filename accessor no longer returns root name if the whole path
  only consists of a root name. This also affects stem and extension as
  those accessors are based on filename. This is a breaking change.

- Cleaned up code:
  - Removed redundant checks for std::wstring support.
  - Added header/footer headers to globally disable compiler warnings.
  - Removed commented out super-deprecated code.
  - Added missing includes and removed includes that are not needed.
  - Nonessential code formatting.
2021-06-05 19:52:33 +03:00
Andrey Semashev
1b27455cb2 Removed unused variables in path_unit_test. 2021-04-24 23:59:24 +03:00
Andrey Semashev
c03249c375 Reformatted code for more consistent look and better readability. 2021-04-24 22:37:57 +03:00
Andrey Semashev
cc57d28995 Fixed an exception being thrown by path::remove_filename if the path is "////".
Also added tests verifying the case.

Fixes https://github.com/boostorg/filesystem/issues/176.
2021-02-26 14:51:04 +03:00
Andrey Semashev
e268f557df Trim trailing spaces in the tests. 2018-11-24 15:23:43 +03:00
Beman
170f483655 Add test/config_info.cpp to increase macro state reporting in hopes of easing debugging on remote machines. 2017-01-08 15:23:42 -05:00
Beman
4ccb6c38f2 Start release history for 1.64 2016-12-30 14:52:52 -05:00
Felix Bruns
fcb98ee37e Rename generic() to generic_path(), since generic is a keyword in C++/CX.
When using Boost.Filesystem from a project compiled as C++/CX code,
compilation fails with a syntax error, because generic is a keyword.

    error C2059: syntax error: 'generic'

See section "Generic interfaces" in C++/CX here:

    https://msdn.microsoft.com/en-us/library/hh755792.aspx
2016-04-27 14:11:08 +02:00
Beman
2f6391b931 Add class path constexpr constants separator and dot of the type appropriate for the platform, and add class path member query functions filename_is_dot() and filename_is_dot_dot(). These add convenience and the implementations may be more efficient that user coded equivalent functions. Also add detail functions is_directory_separator() and is_element_separator(), and replace all uses of local is_separator() in path.cpp with detail::is_directory_separator(). 2015-12-01 10:17:45 -05:00
Beman
320423af98 Added size() function to class path. Resolves #6874, Path should have a size() member function. 2015-09-08 16:46:05 -04:00
Beman
40526c67f2 Clean up some minor cygwin test problems. 2015-09-08 15:40:25 -04:00
Beman
9d5415d579 Add move constructor, move assignment, where called for in Filesystem TS. 2015-09-06 21:18:01 -04:00
Beman
5610f974be Merge branch 'feature/relative2' into develop 2015-09-04 15:24:22 -04:00
Beman
a6900bf517 Update release history and add tests. 2015-09-04 13:41:20 -04:00
Beman
732609a2da Change member normal() and relative() to non-member lexically_normal() and lexically_relative(). See doc/relative_proposal.html#Add-lexical-functions-as-non-members for rationale. 2015-08-23 09:33:21 -04:00
Beman
6e92c9a8b2 Add experimental path::generic() function returning generic formatted (i.e. separators are forward slashes). Motivation: may be simpler than having a family of generic_*string functions. 2015-08-08 12:11:35 -04:00
Beman
5b8b9db1c9 Cleanup missed edits. 2015-08-08 06:18:08 -04:00
Beman
dc794ea95b Merge branch 'feature/relative' into feature/relative2 2015-08-06 08:08:46 -04:00
Beman
bb5a0ff09d Clear warnings, including new warnings from VC++ 2015 preview. 2015-01-05 10:34:24 -05:00
Beman
56015c2239 More work on bug reporting infrastructure 2014-12-28 08:59:35 -05:00
Beman
4d64f34c01 Add non-const overloads for the value_type and string_type to avoid calling codecvt(). Fixes ticket #9219. 2014-08-17 09:22:32 -04:00
Beman
bf1339e282 Remove use of <boost/test/prg_exec_monitor.hpp>. It has caused trouble for years, and I'm tired of fighting with it. The last straw was adding a Cygwin gcc toolset, only to have <boost/test/prg_exec_monitor.hpp> fail to link. Change to always use <boost/detail/lightweight_main.hpp>, which is trouble-free. 2014-08-06 12:16:06 -04:00
Beman
750a82e20d Revert "Merge branch 'develop' of github.com:boostorg/filesystem into develop"
This reverts commit 4610afc49e9c94bdc084cb13cceeec5912326dc6, reversing
changes made to 6623bde4fe501258a54746273ac337e3d55a6710.
2014-08-05 09:16:57 -04:00
Beman
044b98373c All char16_t/char32_t dependencies #ifdef'ed out. All test/msvc/filesystem.sln tests pass. 2014-07-10 14:43:22 -04:00
Beman
e59aecbcbe Update the tests. Unstable. 2014-07-09 08:57:45 -04:00
Beman
b1b1cea3c4 Rename relative to lexically_relative. Add semi_canonical() and relative(). 2014-05-29 15:42:11 -04:00
Beman
7cfff1821e initial implementation of relative(). 2014-05-05 11:54:27 -04:00
Beman Dawes
5ee2bb4189 Filesystem: Add path::operator+= and concat functions to tack on things like suffixes or numbers. Suggested by Ed Smith-Rowland and others.
[SVN r78065]
2012-04-18 14:46:15 +00:00
Beman Dawes
21ec949654 filesystem testing change: use <boost/test/prg_exec_monitor.hpp> by default, define BOOST_LIGHTWEIGHT_MAIN to use <boost/detail/lightweight_main.hpp>. This gives us the better exception reporting of <boost/test/prg_exec_monitor.hpp> but provides easy fallback to <boost/detail/lightweight_main.hpp> if desired.
[SVN r78057]
2012-04-18 01:31:53 +00:00
Beman Dawes
9bba5a53fb filesystem: remove unused function to quiet Intel/Windows compiler warning.
[SVN r78008]
2012-04-16 13:44:58 +00:00
Beman Dawes
b8bb495787 filesystem: change imbue test to avoid reliance on L string literal encoding, thus allow test to pass on Intel compiler for Windows
[SVN r78007]
2012-04-16 13:41:17 +00:00
Beman Dawes
7941871477 Filesystem - Delete v3 directories no longer needed. Cleanup links, namespaces, and other residue from dual v2/v3 support.
[SVN r77555]
2012-03-26 12:44:24 +00:00
Beman Dawes
16099b4c7d Filesystem - Move V3 files and directories into place
[SVN r77554]
2012-03-26 12:31:06 +00:00