Skip to content

Commit

Permalink
[145] Use namespace alias for filesystem library function.
Browse files Browse the repository at this point in the history
  • Loading branch information
korydraughn committed Apr 30, 2024
1 parent 7fda885 commit d086db6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ target_link_libraries(
nlohmann_json::nlohmann_json
fmt::fmt
${IRODS_EXTERNALS_FULLPATH_QPID_PROTON}/lib/libqpid-proton-cpp.so
${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_filesystem.so
${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_system.so
${CMAKE_DL_LIBS}
)
Expand Down
8 changes: 6 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,14 @@
// clang-format off
#ifdef __cpp_lib_filesystem
#include <filesystem>
#include <system_error>
namespace fs = std::filesystem;
using error_code_type = std::error_code;
#else
#include <boost/filesystem.hpp>
#include <boost/system/error_code.hpp>
namespace fs = boost::filesystem;
using error_code_type = boost::system::error_code;
#endif
// clang-format on

Expand Down Expand Up @@ -222,8 +226,8 @@ namespace irods::plugin::rule_engine::audit_amqp
}

if (!log_file_ofstream.is_open()) {
boost::system::error_code ec;
boost::filesystem::create_directories(log_file_path.parent_path(), ec);
error_code_type ec;
fs::create_directories(log_file_path.parent_path(), ec);

log_re::trace("{}: opening log_file_ofstream [{}].", __func__, log_file_path.c_str());
log_file_ofstream.open(log_file_path);
Expand Down

0 comments on commit d086db6

Please sign in to comment.