summaryrefslogtreecommitdiff
path: root/gnuradio-runtime
diff options
context:
space:
mode:
authorZackery Spytz <zspytz@gmail.com>2021-02-24 05:15:36 -0700
committermormj <34754695+mormj@users.noreply.github.com>2021-03-13 13:13:04 -0500
commit72c013a798cd3f4ace6f0fcf09f0c238cbfcabdb (patch)
tree626918947f83e908ebc9f75bd70753b4ec11a8b5 /gnuradio-runtime
parent8793effe5d6013c95b44f52551ba0d660157b263 (diff)
Replace boost::filesystem with std::filesystem
Signed-off-by: Zackery Spytz <zspytz@gmail.com>
Diffstat (limited to 'gnuradio-runtime')
-rw-r--r--gnuradio-runtime/include/gnuradio/logger.h2
-rw-r--r--gnuradio-runtime/include/gnuradio/unittests.h10
-rw-r--r--gnuradio-runtime/lib/CMakeLists.txt1
-rw-r--r--gnuradio-runtime/lib/constants.cc.in20
-rw-r--r--gnuradio-runtime/lib/logger.cc5
-rw-r--r--gnuradio-runtime/lib/prefs.cc8
-rw-r--r--gnuradio-runtime/lib/sys_paths.cc5
-rw-r--r--gnuradio-runtime/lib/vmcircbuf_prefs.cc6
-rw-r--r--gnuradio-runtime/python/gnuradio/gr/bindings/logger_python.cc2
9 files changed, 25 insertions, 34 deletions
diff --git a/gnuradio-runtime/include/gnuradio/logger.h b/gnuradio-runtime/include/gnuradio/logger.h
index 31c763cc93..4c7555f89b 100644
--- a/gnuradio-runtime/include/gnuradio/logger.h
+++ b/gnuradio-runtime/include/gnuradio/logger.h
@@ -31,11 +31,11 @@ typedef int mode_t;
#include <log4cpp/PropertyConfigurator.hh>
#include <log4cpp/RollingFileAppender.hh>
#include <pmt/pmt.h>
-#include <boost/filesystem.hpp>
#include <boost/format.hpp>
#include <boost/thread.hpp>
#include <cassert>
#include <ctime>
+#include <filesystem>
#include <iostream>
#include <memory>
diff --git a/gnuradio-runtime/include/gnuradio/unittests.h b/gnuradio-runtime/include/gnuradio/unittests.h
index 0627ee674b..62e19a091e 100644
--- a/gnuradio-runtime/include/gnuradio/unittests.h
+++ b/gnuradio-runtime/include/gnuradio/unittests.h
@@ -17,15 +17,13 @@
#ifndef _MSC_VER
#include <unistd.h>
#endif
+#include <filesystem>
#include <string>
-#include <boost/filesystem/operations.hpp>
-#include <boost/filesystem/path.hpp>
-
static std::string get_unittest_path(const std::string& filename)
{
- boost::filesystem::path path = boost::filesystem::current_path() / ".unittests";
- if (!boost::filesystem::is_directory(path))
- boost::filesystem::create_directory(path);
+ std::filesystem::path path = std::filesystem::current_path() / ".unittests";
+ if (!std::filesystem::is_directory(path))
+ std::filesystem::create_directory(path);
return (path / filename).string();
}
diff --git a/gnuradio-runtime/lib/CMakeLists.txt b/gnuradio-runtime/lib/CMakeLists.txt
index 5c1c8a1d50..1b908928ec 100644
--- a/gnuradio-runtime/lib/CMakeLists.txt
+++ b/gnuradio-runtime/lib/CMakeLists.txt
@@ -203,7 +203,6 @@ target_link_libraries(gnuradio-runtime PUBLIC
gnuradio-pmt
Volk::volk
Boost::program_options
- Boost::filesystem
Boost::system
Boost::regex
Boost::thread
diff --git a/gnuradio-runtime/lib/constants.cc.in b/gnuradio-runtime/lib/constants.cc.in
index 2c93d36449..33705a78bb 100644
--- a/gnuradio-runtime/lib/constants.cc.in
+++ b/gnuradio-runtime/lib/constants.cc.in
@@ -15,7 +15,7 @@
#include <gnuradio/constants.h>
#include <stdlib.h>
#include <boost/dll/runtime_symbol_info.hpp>
-#include <boost/filesystem/path.hpp>
+#include <filesystem>
namespace gr {
@@ -26,28 +26,28 @@ const std::string prefix()
if (prefix != NULL)
return prefix;
- boost::filesystem::path prefix_rel_lib = "@prefix_relative_to_lib@";
- boost::filesystem::path gr_runtime_lib_path = boost::dll::this_line_location();
+ std::filesystem::path prefix_rel_lib = "@prefix_relative_to_lib@";
+ std::filesystem::path gr_runtime_lib_path = boost::dll::this_line_location().string();
// Normalize before decomposing path so result is reliable
- boost::filesystem::path prefix_path =
+ std::filesystem::path prefix_path =
gr_runtime_lib_path.lexically_normal().parent_path() / prefix_rel_lib;
return prefix_path.lexically_normal().string();
}
const std::string sysconfdir()
{
- boost::filesystem::path sysconfdir_rel_prefix = "@SYSCONFDIR_relative_to_prefix@";
- boost::filesystem::path prefix_path = prefix();
- boost::filesystem::path sysconfdir_path = prefix_path / sysconfdir_rel_prefix;
+ std::filesystem::path sysconfdir_rel_prefix = "@SYSCONFDIR_relative_to_prefix@";
+ std::filesystem::path prefix_path = prefix();
+ std::filesystem::path sysconfdir_path = prefix_path / sysconfdir_rel_prefix;
return sysconfdir_path.lexically_normal().string();
}
const std::string prefsdir()
{
- boost::filesystem::path prefsdir_rel_prefix = "@GR_PREFSDIR_relative_to_prefix@";
- boost::filesystem::path prefix_path = prefix();
- boost::filesystem::path prefsdir_path = prefix_path / prefsdir_rel_prefix;
+ std::filesystem::path prefsdir_rel_prefix = "@GR_PREFSDIR_relative_to_prefix@";
+ std::filesystem::path prefix_path = prefix();
+ std::filesystem::path prefsdir_path = prefix_path / prefsdir_rel_prefix;
return prefsdir_path.lexically_normal().string();
}
diff --git a/gnuradio-runtime/lib/logger.cc b/gnuradio-runtime/lib/logger.cc
index 4dbab39aa0..c344f050be 100644
--- a/gnuradio-runtime/lib/logger.cc
+++ b/gnuradio-runtime/lib/logger.cc
@@ -56,11 +56,10 @@ unsigned int logger_config::get_watch_period()
// Method to watch config file for changes
void logger_config::watch_file(std::string filename, unsigned int watch_period)
{
- std::time_t last_write(boost::filesystem::last_write_time(filename));
- std::time_t current_time(0);
+ auto last_write = std::filesystem::last_write_time(filename);
while (true) {
try {
- current_time = boost::filesystem::last_write_time(filename);
+ auto current_time = std::filesystem::last_write_time(filename);
if (current_time > last_write) {
// std::cout<<"GNURadio Reloading logger
// configuration:"<<filename<<std::endl;
diff --git a/gnuradio-runtime/lib/prefs.cc b/gnuradio-runtime/lib/prefs.cc
index f87bb7a10c..5b5557f9cc 100644
--- a/gnuradio-runtime/lib/prefs.cc
+++ b/gnuradio-runtime/lib/prefs.cc
@@ -17,14 +17,12 @@
#include <gnuradio/sys_paths.h>
#include <algorithm>
+#include <filesystem>
#include <fstream>
#include <iostream>
-#include <boost/filesystem/fstream.hpp>
-#include <boost/filesystem/operations.hpp>
-#include <boost/filesystem/path.hpp>
#include <boost/program_options.hpp>
-namespace fs = boost::filesystem;
+namespace fs = std::filesystem;
namespace po = boost::program_options;
typedef std::ifstream::char_type char_t;
@@ -141,7 +139,7 @@ void prefs::save()
{
std::string conf = to_string();
fs::path userconf = fs::path(gr::userconf_path()) / "config.conf";
- fs::ofstream fout(userconf);
+ std::ofstream fout(userconf);
fout << conf;
fout.close();
}
diff --git a/gnuradio-runtime/lib/sys_paths.cc b/gnuradio-runtime/lib/sys_paths.cc
index 91d2ff12d8..1ec46c9c40 100644
--- a/gnuradio-runtime/lib/sys_paths.cc
+++ b/gnuradio-runtime/lib/sys_paths.cc
@@ -10,8 +10,7 @@
#include <gnuradio/sys_paths.h>
#include <cstdio> //P_tmpdir (maybe)
#include <cstdlib> //getenv
-
-#include <boost/filesystem/path.hpp>
+#include <filesystem>
namespace gr {
@@ -58,7 +57,7 @@ std::string __userconf_path()
// First determine if there is an environment variable specifying the prefs path
path = getenv("GR_PREFS_PATH");
- boost::filesystem::path p;
+ std::filesystem::path p;
if (path) {
p = path;
} else {
diff --git a/gnuradio-runtime/lib/vmcircbuf_prefs.cc b/gnuradio-runtime/lib/vmcircbuf_prefs.cc
index 2ffa74c235..80be2f5939 100644
--- a/gnuradio-runtime/lib/vmcircbuf_prefs.cc
+++ b/gnuradio-runtime/lib/vmcircbuf_prefs.cc
@@ -21,10 +21,8 @@
#include <cstdio>
#include <cstdlib>
#include <cstring>
-
-#include <boost/filesystem/operations.hpp>
-#include <boost/filesystem/path.hpp>
-namespace fs = boost::filesystem;
+#include <filesystem>
+namespace fs = std::filesystem;
namespace gr {
diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/logger_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/logger_python.cc
index 2c59fcde78..1c5263a5bc 100644
--- a/gnuradio-runtime/python/gnuradio/gr/bindings/logger_python.cc
+++ b/gnuradio-runtime/python/gnuradio/gr/bindings/logger_python.cc
@@ -14,7 +14,7 @@
/* BINDTOOL_GEN_AUTOMATIC(0) */
/* BINDTOOL_USE_PYGCCXML(0) */
/* BINDTOOL_HEADER_FILE(logger.h) */
-/* BINDTOOL_HEADER_FILE_HASH(92bf454f642caf2a1de6cdf3cbda722e) */
+/* BINDTOOL_HEADER_FILE_HASH(2a6f012c037ce0d331d09bcf2c3d600a) */
/***********************************************************************************/
#include <pybind11/complex.h>