mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-11-12 21:33:02 +00:00
Replace boost::filesystem by std::experimental::filesystem when the later is available
This commit is contained in:
@@ -30,6 +30,9 @@ add_library(pvt_gr_blocks ${PVT_GR_BLOCKS_SOURCES} ${PVT_GR_BLOCKS_HEADERS})
|
||||
|
||||
if(${FILESYSTEM_FOUND})
|
||||
target_compile_definitions(pvt_gr_blocks PRIVATE -DHAS_STD_FILESYSTEM=1)
|
||||
if(${find_experimental})
|
||||
target_compile_definitions(pvt_gr_blocks PRIVATE -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1)
|
||||
endif()
|
||||
target_link_libraries(pvt_gr_blocks PRIVATE std::filesystem)
|
||||
else()
|
||||
target_link_libraries(pvt_gr_blocks PRIVATE Boost::filesystem Boost::system)
|
||||
|
||||
@@ -83,10 +83,15 @@
|
||||
#include <sys/msg.h> // for msgctl
|
||||
|
||||
#if HAS_STD_FILESYSTEM
|
||||
#include <filesystem>
|
||||
#include <system_error>
|
||||
namespace fs = std::filesystem;
|
||||
namespace errorlib = std;
|
||||
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
||||
#include <experimental/filesystem>
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#else
|
||||
#include <filesystem>
|
||||
namespace fs = std::filesystem;
|
||||
#endif
|
||||
#else
|
||||
#include <boost/filesystem/path.hpp>
|
||||
#include <boost/system/error_code.hpp> // for error_code
|
||||
|
||||
@@ -63,6 +63,9 @@ add_library(pvt_libs ${PVT_LIB_SOURCES} ${PVT_LIB_HEADERS})
|
||||
|
||||
if(${FILESYSTEM_FOUND})
|
||||
target_compile_definitions(pvt_libs PRIVATE -DHAS_STD_FILESYSTEM=1)
|
||||
if(${find_experimental})
|
||||
target_compile_definitions(pvt_libs PRIVATE -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1)
|
||||
endif()
|
||||
target_link_libraries(pvt_libs PRIVATE std::filesystem)
|
||||
else()
|
||||
target_link_libraries(pvt_libs PRIVATE Boost::filesystem Boost::system)
|
||||
|
||||
@@ -33,15 +33,6 @@
|
||||
#include "geojson_printer.h"
|
||||
#include "pvt_solution.h"
|
||||
#include <boost/date_time/posix_time/posix_time.hpp>
|
||||
#if HAS_STD_FILESYSTEM
|
||||
#include <filesystem>
|
||||
#include <system_error>
|
||||
#else
|
||||
#include <boost/filesystem/operations.hpp> // for create_directories, exists
|
||||
#include <boost/filesystem/path.hpp> // for path, operator<<
|
||||
#include <boost/filesystem/path_traits.hpp> // for filesystem
|
||||
#include <boost/system/error_code.hpp> // for error_code
|
||||
#endif
|
||||
#include <glog/logging.h>
|
||||
#include <cstdio> // for remove
|
||||
#include <ctime> // for tm
|
||||
@@ -51,9 +42,20 @@
|
||||
#include <sstream> // for stringstream
|
||||
|
||||
#if HAS_STD_FILESYSTEM
|
||||
namespace fs = std::filesystem;
|
||||
#include <system_error>
|
||||
namespace errorlib = std;
|
||||
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
||||
#include <experimental/filesystem>
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#else
|
||||
#include <filesystem>
|
||||
namespace fs = std::filesystem;
|
||||
#endif
|
||||
#else
|
||||
#include <boost/filesystem/operations.hpp> // for create_directories, exists
|
||||
#include <boost/filesystem/path.hpp> // for path, operator<<
|
||||
#include <boost/filesystem/path_traits.hpp> // for filesystem
|
||||
#include <boost/system/error_code.hpp> // for error_code
|
||||
namespace fs = boost::filesystem;
|
||||
namespace errorlib = boost::system;
|
||||
#endif
|
||||
|
||||
@@ -33,15 +33,6 @@
|
||||
#include "gpx_printer.h"
|
||||
#include "rtklib_solver.h"
|
||||
#include <boost/date_time/posix_time/posix_time.hpp>
|
||||
#if HAS_STD_FILESYSTEM
|
||||
#include <filesystem>
|
||||
#include <system_error>
|
||||
#else
|
||||
#include <boost/filesystem/operations.hpp> // for create_directories, exists
|
||||
#include <boost/filesystem/path.hpp> // for path, operator<<
|
||||
#include <boost/filesystem/path_traits.hpp> // for filesystem
|
||||
#include <boost/system/error_code.hpp> // for error_code
|
||||
#endif
|
||||
#include <glog/logging.h>
|
||||
#include <cstdio> // for remove
|
||||
#include <ctime> // for tm
|
||||
@@ -51,9 +42,20 @@
|
||||
#include <sstream> // for stringstream
|
||||
|
||||
#if HAS_STD_FILESYSTEM
|
||||
namespace fs = std::filesystem;
|
||||
#include <system_error>
|
||||
namespace errorlib = std;
|
||||
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
||||
#include <experimental/filesystem>
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#else
|
||||
#include <filesystem>
|
||||
namespace fs = std::filesystem;
|
||||
#endif
|
||||
#else
|
||||
#include <boost/filesystem/operations.hpp> // for create_directories, exists
|
||||
#include <boost/filesystem/path.hpp> // for path, operator<<
|
||||
#include <boost/filesystem/path_traits.hpp> // for filesystem
|
||||
#include <boost/system/error_code.hpp> // for error_code
|
||||
namespace fs = boost::filesystem;
|
||||
namespace errorlib = boost::system;
|
||||
#endif
|
||||
|
||||
@@ -33,15 +33,6 @@
|
||||
#include "kml_printer.h"
|
||||
#include "rtklib_solver.h"
|
||||
#include <boost/date_time/posix_time/posix_time.hpp>
|
||||
#if HAS_STD_FILESYSTEM
|
||||
#include <filesystem>
|
||||
#include <system_error>
|
||||
#else
|
||||
#include <boost/filesystem/operations.hpp> // for create_directories, exists
|
||||
#include <boost/filesystem/path.hpp> // for path, operator<<
|
||||
#include <boost/filesystem/path_traits.hpp> // for filesystem
|
||||
#include <boost/system/error_code.hpp> // for error_code
|
||||
#endif
|
||||
#include <glog/logging.h>
|
||||
#include <cstdio> // for remove
|
||||
#include <cstdlib> // for mkstemp
|
||||
@@ -55,9 +46,20 @@
|
||||
#include <sys/types.h> //for mode_t
|
||||
|
||||
#if HAS_STD_FILESYSTEM
|
||||
namespace fs = std::filesystem;
|
||||
#include <system_error>
|
||||
namespace errorlib = std;
|
||||
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
||||
#include <experimental/filesystem>
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#else
|
||||
#include <filesystem>
|
||||
namespace fs = std::filesystem;
|
||||
#endif
|
||||
#else
|
||||
#include <boost/filesystem/operations.hpp> // for create_directories, exists
|
||||
#include <boost/filesystem/path.hpp> // for path, operator<<
|
||||
#include <boost/filesystem/path_traits.hpp> // for filesystem
|
||||
#include <boost/system/error_code.hpp> // for error_code
|
||||
namespace fs = boost::filesystem;
|
||||
namespace errorlib = boost::system;
|
||||
#endif
|
||||
|
||||
@@ -36,15 +36,6 @@
|
||||
#include "nmea_printer.h"
|
||||
#include "rtklib_solution.h"
|
||||
#include "rtklib_solver.h"
|
||||
#if HAS_STD_FILESYSTEM
|
||||
#include <filesystem>
|
||||
#include <system_error>
|
||||
#else
|
||||
#include <boost/filesystem/operations.hpp> // for create_directories, exists
|
||||
#include <boost/filesystem/path.hpp> // for path, operator<<
|
||||
#include <boost/filesystem/path_traits.hpp> // for filesystem
|
||||
#include <boost/system/error_code.hpp> // for error_code
|
||||
#endif
|
||||
#include <glog/logging.h>
|
||||
#include <cstdint>
|
||||
#include <exception>
|
||||
@@ -53,9 +44,20 @@
|
||||
#include <termios.h>
|
||||
|
||||
#if HAS_STD_FILESYSTEM
|
||||
namespace fs = std::filesystem;
|
||||
#include <system_error>
|
||||
namespace errorlib = std;
|
||||
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
||||
#include <experimental/filesystem>
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#else
|
||||
#include <filesystem>
|
||||
namespace fs = std::filesystem;
|
||||
#endif
|
||||
#else
|
||||
#include <boost/filesystem/operations.hpp> // for create_directories, exists
|
||||
#include <boost/filesystem/path.hpp> // for path, operator<<
|
||||
#include <boost/filesystem/path_traits.hpp> // for filesystem
|
||||
#include <boost/system/error_code.hpp> // for error_code
|
||||
namespace fs = boost::filesystem;
|
||||
namespace errorlib = boost::system;
|
||||
#endif
|
||||
|
||||
@@ -53,15 +53,6 @@
|
||||
#include <boost/date_time/gregorian/gregorian.hpp>
|
||||
#include <boost/date_time/local_time/local_time.hpp>
|
||||
#include <boost/date_time/time_zone_base.hpp>
|
||||
#if HAS_STD_FILESYSTEM
|
||||
#include <filesystem>
|
||||
#include <system_error>
|
||||
#else
|
||||
#include <boost/filesystem/operations.hpp> // for create_directories, exists
|
||||
#include <boost/filesystem/path.hpp> // for path, operator<<
|
||||
#include <boost/filesystem/path_traits.hpp> // for filesystem
|
||||
#include <boost/system/error_code.hpp> // for error_code
|
||||
#endif
|
||||
#include <glog/logging.h>
|
||||
#include <algorithm> // for min and max
|
||||
#include <cmath> // for floor
|
||||
@@ -76,9 +67,20 @@
|
||||
#include <vector>
|
||||
|
||||
#if HAS_STD_FILESYSTEM
|
||||
namespace fs = std::filesystem;
|
||||
#include <system_error>
|
||||
namespace errorlib = std;
|
||||
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
||||
#include <experimental/filesystem>
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#else
|
||||
#include <filesystem>
|
||||
namespace fs = std::filesystem;
|
||||
#endif
|
||||
#else
|
||||
#include <boost/filesystem/operations.hpp> // for create_directories, exists
|
||||
#include <boost/filesystem/path.hpp> // for path, operator<<
|
||||
#include <boost/filesystem/path_traits.hpp> // for filesystem
|
||||
#include <boost/system/error_code.hpp> // for error_code
|
||||
namespace fs = boost::filesystem;
|
||||
namespace errorlib = boost::system;
|
||||
#endif
|
||||
|
||||
@@ -39,16 +39,6 @@
|
||||
#include "gps_cnav_ephemeris.h"
|
||||
#include "gps_ephemeris.h"
|
||||
#include "rtcm.h"
|
||||
#if HAS_STD_FILESYSTEM
|
||||
#include <filesystem>
|
||||
#include <system_error>
|
||||
#else
|
||||
#include <boost/date_time/posix_time/posix_time.hpp>
|
||||
#include <boost/filesystem/operations.hpp> // for create_directories, exists
|
||||
#include <boost/filesystem/path.hpp> // for path, operator<<
|
||||
#include <boost/filesystem/path_traits.hpp> // for filesystem
|
||||
#include <boost/system/error_code.hpp> // for error_codes
|
||||
#endif
|
||||
#include <glog/logging.h>
|
||||
#include <cstdio> // for remove
|
||||
#include <ctime> // for tm
|
||||
@@ -59,9 +49,20 @@
|
||||
#include <unistd.h> // for close, write
|
||||
|
||||
#if HAS_STD_FILESYSTEM
|
||||
namespace fs = std::filesystem;
|
||||
#include <system_error>
|
||||
namespace errorlib = std;
|
||||
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
||||
#include <experimental/filesystem>
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#else
|
||||
#include <filesystem>
|
||||
namespace fs = std::filesystem;
|
||||
#endif
|
||||
#else
|
||||
#include <boost/filesystem/operations.hpp> // for create_directories, exists
|
||||
#include <boost/filesystem/path.hpp> // for path, operator<<
|
||||
#include <boost/filesystem/path_traits.hpp> // for filesystem
|
||||
#include <boost/system/error_code.hpp> // for error_code
|
||||
namespace fs = boost::filesystem;
|
||||
namespace errorlib = boost::system;
|
||||
#endif
|
||||
|
||||
@@ -68,6 +68,9 @@ add_library(acquisition_gr_blocks ${ACQ_GR_BLOCKS_SOURCES} ${ACQ_GR_BLOCKS_HEADE
|
||||
|
||||
if(${FILESYSTEM_FOUND})
|
||||
target_compile_definitions(acquisition_gr_blocks PRIVATE -DHAS_STD_FILESYSTEM=1)
|
||||
if(${find_experimental})
|
||||
target_compile_definitions(acquisition_gr_blocks PRIVATE -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1)
|
||||
endif()
|
||||
target_link_libraries(acquisition_gr_blocks PRIVATE std::filesystem)
|
||||
else()
|
||||
target_link_libraries(acquisition_gr_blocks PRIVATE Boost::filesystem)
|
||||
|
||||
@@ -40,7 +40,11 @@
|
||||
#include "gnss_sdr_create_directory.h"
|
||||
#include "gnss_synchro.h"
|
||||
#if HAS_STD_FILESYSTEM
|
||||
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
||||
#include <experimental/filesystem>
|
||||
#else
|
||||
#include <filesystem>
|
||||
#endif
|
||||
#else
|
||||
#include <boost/filesystem/path.hpp>
|
||||
#endif
|
||||
@@ -58,7 +62,11 @@
|
||||
#include <map>
|
||||
|
||||
#if HAS_STD_FILESYSTEM
|
||||
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#else
|
||||
namespace fs = std::filesystem;
|
||||
#endif
|
||||
#else
|
||||
namespace fs = boost::filesystem;
|
||||
#endif
|
||||
|
||||
@@ -35,7 +35,11 @@
|
||||
#include "gnss_sdr_create_directory.h"
|
||||
#include "gps_sdr_signal_processing.h"
|
||||
#if HAS_STD_FILESYSTEM
|
||||
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
||||
#include <experimental/filesystem>
|
||||
#else
|
||||
#include <filesystem>
|
||||
#endif
|
||||
#else
|
||||
#include <boost/filesystem/path.hpp>
|
||||
#endif
|
||||
@@ -48,7 +52,11 @@
|
||||
#include <sstream>
|
||||
|
||||
#if HAS_STD_FILESYSTEM
|
||||
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#else
|
||||
namespace fs = std::filesystem;
|
||||
#endif
|
||||
#else
|
||||
namespace fs = boost::filesystem;
|
||||
#endif
|
||||
|
||||
@@ -90,6 +90,9 @@ add_library(algorithms_libs ${GNSS_SPLIBS_SOURCES} ${GNSS_SPLIBS_HEADERS})
|
||||
|
||||
if(${FILESYSTEM_FOUND})
|
||||
target_compile_definitions(algorithms_libs PRIVATE -DHAS_STD_FILESYSTEM=1)
|
||||
if(${find_experimental})
|
||||
target_compile_definitions(algorithms_libs PRIVATE -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1)
|
||||
endif()
|
||||
target_link_libraries(algorithms_libs PRIVATE std::filesystem)
|
||||
else()
|
||||
target_link_libraries(algorithms_libs PRIVATE Boost::filesystem Boost::system)
|
||||
@@ -141,6 +144,9 @@ add_library(gnss_sdr_flags gnss_sdr_flags.cc gnss_sdr_flags.h)
|
||||
|
||||
if(${FILESYSTEM_FOUND})
|
||||
target_compile_definitions(gnss_sdr_flags PRIVATE -DHAS_STD_FILESYSTEM=1)
|
||||
if(${find_experimental})
|
||||
add_definitions(-DHAS_STD_FILESYSTEM_EXPERIMENTAL=1)
|
||||
endif()
|
||||
target_link_libraries(gnss_sdr_flags PRIVATE std::filesystem)
|
||||
else()
|
||||
target_link_libraries(gnss_sdr_flags PRIVATE Boost::filesystem)
|
||||
|
||||
@@ -29,22 +29,24 @@
|
||||
*/
|
||||
|
||||
#include "gnss_sdr_create_directory.h"
|
||||
#include <exception> // for exception
|
||||
#include <fstream> // for ofstream
|
||||
|
||||
#if HAS_STD_FILESYSTEM
|
||||
#include <filesystem>
|
||||
#include <system_error>
|
||||
namespace errorlib = std;
|
||||
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
||||
#include <experimental/filesystem>
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#else
|
||||
#include <filesystem>
|
||||
namespace fs = std::filesystem;
|
||||
#endif
|
||||
#else
|
||||
#include <boost/filesystem/operations.hpp> // for create_directories, exists
|
||||
#include <boost/filesystem/path.hpp> // for path, operator<<
|
||||
#include <boost/filesystem/path_traits.hpp> // for filesystem
|
||||
#include <boost/system/error_code.hpp> // for error_code
|
||||
#endif
|
||||
#include <exception> // for exception
|
||||
#include <fstream> // for ofstream
|
||||
|
||||
#if HAS_STD_FILESYSTEM
|
||||
namespace fs = std::filesystem;
|
||||
namespace errorlib = std;
|
||||
#else
|
||||
namespace fs = boost::filesystem;
|
||||
namespace errorlib = boost::system;
|
||||
#endif
|
||||
|
||||
@@ -30,18 +30,20 @@
|
||||
|
||||
|
||||
#include "gnss_sdr_flags.h"
|
||||
#if HAS_STD_FILESYSTEM
|
||||
#include <filesystem>
|
||||
#else
|
||||
#include <boost/filesystem/operations.hpp> // for exists
|
||||
#endif
|
||||
#include <cstdint>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#if HAS_STD_FILESYSTEM
|
||||
namespace fs = std::filesystem;
|
||||
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
||||
#include <experimental/filesystem>
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#else
|
||||
#include <filesystem>
|
||||
namespace fs = std::filesystem;
|
||||
#endif
|
||||
#else
|
||||
#include <boost/filesystem/path.hpp>
|
||||
namespace fs = boost::filesystem;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -30,6 +30,9 @@ add_library(obs_gr_blocks ${OBS_GR_BLOCKS_SOURCES} ${OBS_GR_BLOCKS_HEADERS})
|
||||
|
||||
if(${FILESYSTEM_FOUND})
|
||||
target_compile_definitions(obs_gr_blocks PRIVATE -DHAS_STD_FILESYSTEM=1)
|
||||
if(${find_experimental})
|
||||
target_compile_definitions(obs_gr_blocks PRIVATE -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1)
|
||||
endif()
|
||||
target_link_libraries(obs_gr_blocks PRIVATE std::filesystem)
|
||||
else()
|
||||
target_link_libraries(obs_gr_blocks PRIVATE Boost::filesystem)
|
||||
|
||||
@@ -46,13 +46,19 @@
|
||||
#include <utility> // for move
|
||||
|
||||
#if HAS_STD_FILESYSTEM
|
||||
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
||||
#include <experimental/filesystem>
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#else
|
||||
#include <filesystem>
|
||||
namespace fs = std::filesystem;
|
||||
#endif
|
||||
#else
|
||||
#include <boost/filesystem/path.hpp>
|
||||
namespace fs = boost::filesystem;
|
||||
#endif
|
||||
|
||||
|
||||
hybrid_observables_gs_sptr hybrid_observables_gs_make(unsigned int nchannels_in, unsigned int nchannels_out, bool dump, bool dump_mat, std::string dump_filename)
|
||||
{
|
||||
return hybrid_observables_gs_sptr(new hybrid_observables_gs(nchannels_in, nchannels_out, dump, dump_mat, std::move(dump_filename)));
|
||||
|
||||
@@ -78,6 +78,9 @@ add_library(tracking_gr_blocks
|
||||
|
||||
if(${FILESYSTEM_FOUND})
|
||||
target_compile_definitions(tracking_gr_blocks PRIVATE -DHAS_STD_FILESYSTEM=1)
|
||||
if(${find_experimental})
|
||||
target_compile_definitions(tracking_gr_blocks PRIVATE -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1)
|
||||
endif()
|
||||
target_link_libraries(tracking_gr_blocks PRIVATE std::filesystem)
|
||||
else()
|
||||
target_link_libraries(tracking_gr_blocks PRIVATE Boost::filesystem)
|
||||
|
||||
@@ -67,8 +67,13 @@
|
||||
#include <map>
|
||||
|
||||
#if HAS_STD_FILESYSTEM
|
||||
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
||||
#include <experimental/filesystem>
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#else
|
||||
#include <filesystem>
|
||||
namespace fs = std::filesystem;
|
||||
#endif
|
||||
#else
|
||||
#include <boost/filesystem/path.hpp>
|
||||
namespace fs = boost::filesystem;
|
||||
|
||||
@@ -60,8 +60,13 @@
|
||||
#include <map>
|
||||
|
||||
#if HAS_STD_FILESYSTEM
|
||||
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
||||
#include <experimental/filesystem>
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#else
|
||||
#include <filesystem>
|
||||
namespace fs = std::filesystem;
|
||||
#endif
|
||||
#else
|
||||
#include <boost/filesystem/path.hpp>
|
||||
namespace fs = boost::filesystem;
|
||||
|
||||
Reference in New Issue
Block a user