Skip to content

Commit

Permalink
Switch to std::filesystem
Browse files Browse the repository at this point in the history
Change-Id: I4d5cab541a094e1260bb4b202c9f18830a2a645b
  • Loading branch information
Pesa committed Dec 14, 2024
1 parent c12f915 commit c2f25b7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
1 change: 0 additions & 1 deletion .jenkins.d/00-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ APT_PKGS=(
libboost-chrono-dev
libboost-date-time-dev
libboost-dev
libboost-filesystem-dev
libboost-log-dev
libboost-program-options-dev
libboost-stacktrace-dev
Expand Down
2 changes: 1 addition & 1 deletion .waf-tools/default-compiler-flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def getDebugFlags(self, conf):
return {
'CXXFLAGS': [],
'LINKFLAGS': [],
'DEFINES': ['BOOST_ASIO_NO_DEPRECATED', 'BOOST_FILESYSTEM_NO_DEPRECATED'],
'DEFINES': ['BOOST_ASIO_NO_DEPRECATED'],
}

def getOptimizedFlags(self, conf):
Expand Down
11 changes: 5 additions & 6 deletions src/logger.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2023, Arizona Board of Regents.
* Copyright (c) 2014-2024, Arizona Board of Regents.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -22,14 +22,13 @@
#define NDNTG_LOGGER_HPP

#include <cstdlib>
#include <filesystem>
#include <fstream>
#include <string>
#include <string_view>

#include <boost/container/static_vector.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/path.hpp>

#include <ndn-cxx/util/time.hpp>

Expand Down Expand Up @@ -95,9 +94,9 @@ class Logger
return;
}

boost::filesystem::path logdir(m_logLocation);
if (boost::filesystem::exists(logdir)) {
if (boost::filesystem::is_directory(logdir)) {
std::filesystem::path logdir(m_logLocation);
if (std::filesystem::exists(logdir)) {
if (std::filesystem::is_directory(logdir)) {
auto logfile = logdir / (m_module + '_' + instanceId + ".log");
m_logFile.open(logfile.string(), std::ofstream::out | std::ofstream::trunc);
if (m_logFile.is_open()) {
Expand Down
2 changes: 1 addition & 1 deletion wscript
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def configure(conf):
conf.check_cfg(package='libndn-cxx', args=['libndn-cxx >= 0.8.1', '--cflags', '--libs'],
uselib_store='NDN_CXX', pkg_config_path=pkg_config_path)

conf.check_boost(lib='date_time filesystem program_options', mt=True)
conf.check_boost(lib='date_time program_options', mt=True)

conf.check_compiler_flags()

Expand Down

0 comments on commit c2f25b7

Please sign in to comment.