Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate I/O interface using boost::filesystem::path #222

Open
mloskot opened this issue Jan 21, 2019 · 2 comments
Open

Deprecate I/O interface using boost::filesystem::path #222

mloskot opened this issue Jan 21, 2019 · 2 comments
Assignees
Labels
cat/deprecation Deprecate a feature or functionality ext/io boost/gil/extension/io/ good-first-issue Opportunity for new contributors to help improving GIL

Comments

@mloskot
Copy link
Member

mloskot commented Jan 21, 2019

TL;TR: We are planning to deprecate functions accepting boost::filesystem::path and replace with C++17 std::filesystem

What

Currently, Boost.Filesystem support is optional, guarded with macro BOOST_GIL_IO_ADD_FS_PATH_SUPPORT checked in number of the I/O extension headers.

It is reasonable to replace the boost::filesystem with std::filesystem whenever GIL code is compiled using C++17,
unless user explicitly desires to use Boost.Filesystem via an appropriate #define.

Why

  1. We, @stefanseefeld & @mloskot, don't see any added value in function overloads such as make_dynamic_image_reader that use filesystem::path over just passing std::string or char const* and leaving the conversion from the path to string to the converting constructors or user.

  2. Avoid Boost.Filesystem as direct and mandatory dependency.

Briefly, we considered automatically replacing boost::filesystem with std::filesystem, depending on compiler and target C++ version, but we quickly landed at the point 1. Plus, the <filesystem> detection heuristics would not be as straightforward as one may expect.

When

As soon as possible - along with complete C++11 switch

@mloskot mloskot added the ext/io boost/gil/extension/io/ label Jan 21, 2019
@mloskot mloskot added this to the Boost 1.70 milestone Jan 21, 2019
@mloskot mloskot self-assigned this Jan 21, 2019
@mloskot mloskot added the cat/deprecation Deprecate a feature or functionality label Jan 21, 2019
@mloskot mloskot removed this from the Boost 1.70 milestone Apr 13, 2019
@mloskot mloskot added the good-first-issue Opportunity for new contributors to help improving GIL label Feb 3, 2022
@mloskot
Copy link
Member Author

mloskot commented Feb 3, 2022

I've updated this issue with C++17 std::filesystem:

It is reasonable to replace the boost::filesystem with std::filesystem whenever GIL code is compiled using C++17,
unless user explicitly desires to use Boost.Filesystem via an appropriate #define.

mloskot added a commit to mloskot/gil that referenced this issue Feb 5, 2022
If neither <filesystem> nor <experimental/filesystem> is detected,
then require <boost/filesystem.hpp>.

If user defines BOOST_GIL_IO_USE_BOOST_FILESYSTEM macro,
then <boost/filesystem.hpp> is pre-selected and required,
and search for any of the C++ standard implementation is skipped.

Remove end-user macro BOOST_GIL_IO_ADD_FS_PATH_SUPPORT
Require tests to always build with support of either
detected C++ filesystem or pre-selected Boost.Filesystem.

Closes #boostorg#222
mloskot added a commit that referenced this issue Feb 22, 2022
If neither <filesystem> nor <experimental/filesystem> is detected,
then require <boost/filesystem.hpp>.

If user defines BOOST_GIL_IO_USE_BOOST_FILESYSTEM macro,
then <boost/filesystem.hpp> is pre-selected and required,
and search for any of the C++ standard implementation is skipped.

Remove end-user macro BOOST_GIL_IO_ADD_FS_PATH_SUPPORT
Require tests to always build with support of either
detected C++ filesystem or pre-selected Boost.Filesystem.

Closes ##222
@mloskot
Copy link
Member Author

mloskot commented May 20, 2022

This is included in the planning towards C++14/17 discussion here #676

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat/deprecation Deprecate a feature or functionality ext/io boost/gil/extension/io/ good-first-issue Opportunity for new contributors to help improving GIL
Projects
None yet
Development

No branches or pull requests

1 participant