Replace boost::filesystem with std (#6432)

This commit is contained in:
Dennis Luxen
2024-06-20 21:44:28 +02:00
committed by GitHub
parent c3f2a6cdb9
commit f1eabc3ecc
64 changed files with 417 additions and 311 deletions
+1 -2
View File
@@ -11,11 +11,10 @@
#include "util/serialization.hpp"
#include "util/timing_util.hpp"
#include <fstream>
#include <iostream>
#include <random>
#include <boost/filesystem/fstream.hpp>
namespace osrm::benchmarks
{
@@ -44,7 +44,7 @@ MMapMemoryAllocator::MMapMemoryAllocator(const storage::StorageConfig &config)
for (const auto &file : files)
{
if (boost::filesystem::exists(file.second))
if (std::filesystem::exists(file.second))
{
std::unique_ptr<storage::BaseDataLayout> layout =
std::make_unique<storage::TarDataLayout>();
+3 -2
View File
@@ -2,10 +2,11 @@
#include "util/log.hpp"
#include <boost/assert.hpp>
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/numeric/conversion/cast.hpp>
#include <filesystem>
#include <fstream>
#include <iostream>
#include <limits>
#include <string>
+4 -4
View File
@@ -7,17 +7,17 @@
#include <rapidjson/error/en.h>
#include <rapidjson/istreamwrapper.h>
#include <boost/filesystem.hpp>
#include <boost/geometry/algorithms/equals.hpp>
#include <boost/iterator/function_output_iterator.hpp>
#include <filesystem>
#include <fstream>
#include <string>
namespace osrm::extractor
{
LocationDependentData::LocationDependentData(const std::vector<boost::filesystem::path> &file_paths)
LocationDependentData::LocationDependentData(const std::vector<std::filesystem::path> &file_paths)
{
std::vector<rtree_t::value_type> bounding_boxes;
for (const auto &path : file_paths)
@@ -32,12 +32,12 @@ LocationDependentData::LocationDependentData(const std::vector<boost::filesystem
}
void LocationDependentData::loadLocationDependentData(
const boost::filesystem::path &file_path, std::vector<rtree_t::value_type> &bounding_boxes)
const std::filesystem::path &file_path, std::vector<rtree_t::value_type> &bounding_boxes)
{
if (file_path.empty())
return;
if (!boost::filesystem::exists(file_path) || !boost::filesystem::is_regular_file(file_path))
if (!std::filesystem::exists(file_path) || !std::filesystem::is_regular_file(file_path))
{
throw osrm::util::exception(std::string("File with location-dependent data ") +
file_path.string() + " does not exists");
+2 -2
View File
@@ -103,8 +103,8 @@ int RasterContainer::LoadRasterSource(const std::string &path_string,
util::Log() << "[source loader] Loading from " << path_string << " ... ";
TIMER_START(loading_source);
boost::filesystem::path filepath(path_string);
if (!boost::filesystem::exists(filepath))
std::filesystem::path filepath(path_string);
if (!std::filesystem::exists(filepath))
{
throw util::RuntimeError(
path_string, ErrorCode::FileOpenError, SOURCE_REF, "File not found");
+1 -1
View File
@@ -113,7 +113,7 @@ void handle_lua_error(const sol::protected_function_result &luares)
Sol2ScriptingEnvironment::Sol2ScriptingEnvironment(
const std::string &file_name,
const std::vector<boost::filesystem::path> &location_dependent_data_paths)
const std::vector<std::filesystem::path> &location_dependent_data_paths)
: file_name(file_name), location_dependent_data(location_dependent_data_paths)
{
util::Log() << "Using script " << file_name;
+7 -8
View File
@@ -19,16 +19,15 @@
#include "util/json_container.hpp"
#include "util/log.hpp"
#include "util/mmap_file.hpp"
#include <algorithm>
#include <iterator>
#include <vector>
#include "util/timing_util.hpp"
#include <boost/assert.hpp>
#include <boost/filesystem/operations.hpp>
#include <tbb/global_control.h>
#include "util/timing_util.hpp"
#include <algorithm>
#include <filesystem>
#include <iterator>
#include <vector>
namespace osrm::partitioner
{
@@ -171,11 +170,11 @@ int Partitioner::Run(const PartitionerConfig &config)
extractor::files::writeManeuverOverrides(filename, maneuver_overrides, node_sequences);
}
if (boost::filesystem::exists(config.GetPath(".osrm.hsgr")))
if (std::filesystem::exists(config.GetPath(".osrm.hsgr")))
{
util::Log(logWARNING) << "Found existing .osrm.hsgr file, removing. You need to re-run "
"osrm-contract after osrm-partition.";
boost::filesystem::remove(config.GetPath(".osrm.hsgr"));
std::filesystem::remove(config.GetPath(".osrm.hsgr"));
}
TIMER_STOP(renumber);
util::Log() << "Renumbered data in " << TIMER_SEC(renumber) << " seconds";
+2 -4
View File
@@ -2,14 +2,12 @@
#include "util/log.hpp"
#include <boost/filesystem.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/path.hpp>
#include <filesystem>
namespace osrm::storage
{
namespace fs = boost::filesystem;
namespace fs = std::filesystem;
bool IOConfig::IsValid() const
{
+24 -26
View File
@@ -23,13 +23,11 @@
#endif
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/filesystem/path.hpp>
#include <boost/interprocess/sync/file_lock.hpp>
#include <boost/interprocess/sync/scoped_lock.hpp>
#include <cstdint>
#include <filesystem>
#include <fstream>
#include <iterator>
#include <new>
@@ -164,7 +162,7 @@ bool swapData(Monitor &monitor,
}
} // namespace
void populateLayoutFromFile(const boost::filesystem::path &path, storage::BaseDataLayout &layout)
void populateLayoutFromFile(const std::filesystem::path &path, storage::BaseDataLayout &layout)
{
tar::FileReader reader(path, tar::FileReader::VerifyFingerprint);
@@ -190,11 +188,11 @@ int Storage::Run(int max_wait, const std::string &dataset_name, bool only_metric
util::LogPolicy::GetInstance().Unmute();
boost::filesystem::path lock_path =
boost::filesystem::temp_directory_path() / "osrm-datastore.lock";
if (!boost::filesystem::exists(lock_path))
std::filesystem::path lock_path =
std::filesystem::temp_directory_path() / "osrm-datastore.lock";
if (!std::filesystem::exists(lock_path))
{
boost::filesystem::ofstream ofs(lock_path);
std::ofstream ofs(lock_path);
}
boost::interprocess::file_lock file_lock(lock_path.string().c_str());
@@ -257,7 +255,7 @@ int Storage::Run(int max_wait, const std::string &dataset_name, bool only_metric
std::unique_ptr<storage::BaseDataLayout> static_layout =
std::make_unique<storage::ContiguousDataLayout>();
Storage::PopulateLayoutWithRTree(*static_layout);
std::vector<std::pair<bool, boost::filesystem::path>> files = Storage::GetStaticFiles();
std::vector<std::pair<bool, std::filesystem::path>> files = Storage::GetStaticFiles();
Storage::PopulateLayout(*static_layout, files);
auto static_handle = setupRegion(shared_register, *static_layout);
regions.push_back({static_handle.data_ptr, std::move(static_layout)});
@@ -266,7 +264,7 @@ int Storage::Run(int max_wait, const std::string &dataset_name, bool only_metric
std::unique_ptr<storage::BaseDataLayout> updatable_layout =
std::make_unique<storage::ContiguousDataLayout>();
std::vector<std::pair<bool, boost::filesystem::path>> files = Storage::GetUpdatableFiles();
std::vector<std::pair<bool, std::filesystem::path>> files = Storage::GetUpdatableFiles();
Storage::PopulateLayout(*updatable_layout, files);
auto updatable_handle = setupRegion(shared_register, *updatable_layout);
regions.push_back({updatable_handle.data_ptr, std::move(updatable_layout)});
@@ -285,12 +283,12 @@ int Storage::Run(int max_wait, const std::string &dataset_name, bool only_metric
return EXIT_SUCCESS;
}
std::vector<std::pair<bool, boost::filesystem::path>> Storage::GetStaticFiles()
std::vector<std::pair<bool, std::filesystem::path>> Storage::GetStaticFiles()
{
constexpr bool IS_REQUIRED = true;
constexpr bool IS_OPTIONAL = false;
std::vector<std::pair<bool, boost::filesystem::path>> files = {
std::vector<std::pair<bool, std::filesystem::path>> files = {
{IS_OPTIONAL, config.GetPath(".osrm.cells")},
{IS_OPTIONAL, config.GetPath(".osrm.partition")},
{IS_REQUIRED, config.GetPath(".osrm.ebg_nodes")},
@@ -310,7 +308,7 @@ std::vector<std::pair<bool, boost::filesystem::path>> Storage::GetStaticFiles()
for (const auto &file : files)
{
if (file.first == IS_REQUIRED && !boost::filesystem::exists(file.second))
if (file.first == IS_REQUIRED && !std::filesystem::exists(file.second))
{
throw util::exception("Could not find required file(s): " + std::get<1>(file).string());
}
@@ -319,12 +317,12 @@ std::vector<std::pair<bool, boost::filesystem::path>> Storage::GetStaticFiles()
return files;
}
std::vector<std::pair<bool, boost::filesystem::path>> Storage::GetUpdatableFiles()
std::vector<std::pair<bool, std::filesystem::path>> Storage::GetUpdatableFiles()
{
constexpr bool IS_REQUIRED = true;
constexpr bool IS_OPTIONAL = false;
std::vector<std::pair<bool, boost::filesystem::path>> files = {
std::vector<std::pair<bool, std::filesystem::path>> files = {
{IS_OPTIONAL, config.GetPath(".osrm.mldgr")},
{IS_OPTIONAL, config.GetPath(".osrm.cell_metrics")},
{IS_OPTIONAL, config.GetPath(".osrm.hsgr")},
@@ -335,7 +333,7 @@ std::vector<std::pair<bool, boost::filesystem::path>> Storage::GetUpdatableFiles
for (const auto &file : files)
{
if (file.first == IS_REQUIRED && !boost::filesystem::exists(file.second))
if (file.first == IS_REQUIRED && !std::filesystem::exists(file.second))
{
throw util::exception("Could not find required file(s): " + std::get<1>(file).string());
}
@@ -347,9 +345,9 @@ std::vector<std::pair<bool, boost::filesystem::path>> Storage::GetUpdatableFiles
std::string Storage::PopulateLayoutWithRTree(storage::BaseDataLayout &layout)
{
// Figure out the path to the rtree file (it's not a tar file)
auto absolute_file_index_path = boost::filesystem::absolute(config.GetPath(".osrm.fileIndex"));
auto absolute_file_index_path = std::filesystem::absolute(config.GetPath(".osrm.fileIndex"));
// Convert the boost::filesystem::path object into a plain string
// Convert the std::filesystem::path object into a plain string
// that can then be stored as a member of an allocator object
auto rtree_filename = absolute_file_index_path.string();
@@ -366,11 +364,11 @@ std::string Storage::PopulateLayoutWithRTree(storage::BaseDataLayout &layout)
* in that big block. It updates the fields in the layout parameter.
*/
void Storage::PopulateLayout(storage::BaseDataLayout &layout,
const std::vector<std::pair<bool, boost::filesystem::path>> &files)
const std::vector<std::pair<bool, std::filesystem::path>> &files)
{
for (const auto &file : files)
{
if (boost::filesystem::exists(file.second))
if (std::filesystem::exists(file.second))
{
populateLayoutFromFile(file.second, layout);
}
@@ -389,7 +387,7 @@ void Storage::PopulateStaticData(const SharedDataIndex &index)
file_index_path_ptr + index.GetBlockSize("/common/rtree/file_index_path"),
0);
const auto absolute_file_index_path =
boost::filesystem::absolute(config.GetPath(".osrm.fileIndex")).string();
std::filesystem::absolute(config.GetPath(".osrm.fileIndex")).string();
BOOST_ASSERT(static_cast<std::size_t>(index.GetBlockSize(
"/common/rtree/file_index_path")) >= absolute_file_index_path.size());
std::copy(
@@ -482,13 +480,13 @@ void Storage::PopulateStaticData(const SharedDataIndex &index)
metric_name = profile_properties_ptr->GetWeightName();
}
if (boost::filesystem::exists(config.GetPath(".osrm.partition")))
if (std::filesystem::exists(config.GetPath(".osrm.partition")))
{
auto mlp = make_partition_view(index, "/mld/multilevelpartition");
partitioner::files::readPartition(config.GetPath(".osrm.partition"), mlp);
}
if (boost::filesystem::exists(config.GetPath(".osrm.cells")))
if (std::filesystem::exists(config.GetPath(".osrm.cells")))
{
auto storage = make_cell_storage_view(index, "/mld/cellstorage");
partitioner::files::readCells(config.GetPath(".osrm.cells"), storage);
@@ -541,7 +539,7 @@ void Storage::PopulateUpdatableData(const SharedDataIndex &index)
metric_name = properties.GetWeightName();
}
if (boost::filesystem::exists(config.GetPath(".osrm.hsgr")))
if (std::filesystem::exists(config.GetPath(".osrm.hsgr")))
{
const std::string metric_prefix = "/ch/metrics/" + metric_name;
auto contracted_metric = make_contracted_metric_view(index, metric_prefix);
@@ -567,7 +565,7 @@ void Storage::PopulateUpdatableData(const SharedDataIndex &index)
}
}
if (boost::filesystem::exists(config.GetPath(".osrm.cell_metrics")))
if (std::filesystem::exists(config.GetPath(".osrm.cell_metrics")))
{
auto exclude_metrics = make_cell_metric_view(index, "/mld/metrics/" + metric_name);
std::unordered_map<std::string, std::vector<customizer::CellMetricView>> metrics = {
@@ -576,7 +574,7 @@ void Storage::PopulateUpdatableData(const SharedDataIndex &index)
customizer::files::readCellMetrics(config.GetPath(".osrm.cell_metrics"), metrics);
}
if (boost::filesystem::exists(config.GetPath(".osrm.mldgr")))
if (std::filesystem::exists(config.GetPath(".osrm.mldgr")))
{
auto graph_view = make_multi_level_graph_view(index, "/mld/multilevelgraph");
std::uint32_t graph_connectivity_checksum = 0;
+2 -2
View File
@@ -10,7 +10,6 @@
#include "util/tarjan_scc.hpp"
#include "util/typedefs.hpp"
#include <boost/filesystem.hpp>
#include <boost/iterator/function_output_iterator.hpp>
#include <tbb/parallel_sort.h>
@@ -19,6 +18,7 @@
#include <cstdlib>
#include <algorithm>
#include <filesystem>
#include <fstream>
#include <memory>
#include <ostream>
@@ -118,7 +118,7 @@ int main(int argc, char *argv[])
const std::string inpath{argv[1]};
const std::string outpath{argv[2]};
if (boost::filesystem::exists(outpath))
if (std::filesystem::exists(outpath))
{
util::Log(logWARNING) << "Components file " << outpath << " already exists";
return EXIT_FAILURE;
+3 -3
View File
@@ -6,12 +6,12 @@
#include "util/timezones.hpp"
#include "util/version.hpp"
#include <boost/filesystem.hpp>
#include <boost/program_options.hpp>
#include <boost/program_options/errors.hpp>
#include <cstdlib>
#include <exception>
#include <filesystem>
#include <new>
#include <ostream>
#include <thread>
@@ -86,7 +86,7 @@ return_code parseArguments(int argc,
boost::program_options::options_description hidden_options("Hidden options");
hidden_options.add_options()(
"input,i",
boost::program_options::value<boost::filesystem::path>(&contractor_config.base_path),
boost::program_options::value<std::filesystem::path>(&contractor_config.base_path),
"Input file in .osm, .osm.bz2 or .osm.pbf format");
// positional option
@@ -99,7 +99,7 @@ return_code parseArguments(int argc,
const auto *executable = argv[0];
boost::program_options::options_description visible_options(
"Usage: " + boost::filesystem::path(executable).filename().string() +
"Usage: " + std::filesystem::path(executable).filename().string() +
" <input.osrm> [options]");
visible_options.add(generic_options).add(config_options);
+3 -3
View File
@@ -5,9 +5,9 @@
#include "util/meminfo.hpp"
#include "util/version.hpp"
#include <boost/filesystem.hpp>
#include <boost/program_options.hpp>
#include <filesystem>
#include <iostream>
#include <thread>
@@ -76,7 +76,7 @@ return_code parseArguments(int argc,
boost::program_options::options_description hidden_options("Hidden options");
hidden_options.add_options()(
"input,i",
boost::program_options::value<boost::filesystem::path>(&customization_config.base_path),
boost::program_options::value<std::filesystem::path>(&customization_config.base_path),
"Input base file path");
// positional option
@@ -89,7 +89,7 @@ return_code parseArguments(int argc,
const auto *executable = argv[0];
boost::program_options::options_description visible_options(
boost::filesystem::path(executable).filename().string() + " <input.osrm> [options]");
std::filesystem::path(executable).filename().string() + " <input.osrm> [options]");
visible_options.add(generic_options).add(config_options);
// parse command line options
+8 -10
View File
@@ -2,19 +2,17 @@
#include "osrm/extractor.hpp"
#include "osrm/extractor_config.hpp"
#include "util/log.hpp"
#include "util/meminfo.hpp"
#include "util/version.hpp"
#include <boost/filesystem.hpp>
#include <boost/program_options.hpp>
#include <cstdlib>
#include <exception>
#include <filesystem>
#include <iostream>
#include <new>
#include <thread>
#include "util/meminfo.hpp"
using namespace osrm;
enum class return_code : unsigned
@@ -40,7 +38,7 @@ return_code parseArguments(int argc,
boost::program_options::options_description config_options("Configuration");
config_options.add_options()(
"profile,p",
boost::program_options::value<boost::filesystem::path>(&extractor_config.profile_path)
boost::program_options::value<std::filesystem::path>(&extractor_config.profile_path)
->default_value("profiles/car.lua"),
"Path to LUA routing profile")(
"data_version,d",
@@ -67,7 +65,7 @@ return_code parseArguments(int argc,
->default_value(false),
"Save conditional restrictions found during extraction to disk for use "
"during contraction")("location-dependent-data",
boost::program_options::value<std::vector<boost::filesystem::path>>(
boost::program_options::value<std::vector<std::filesystem::path>>(
&extractor_config.location_dependent_data_paths)
->composing(),
"GeoJSON files with location-dependent data")(
@@ -88,7 +86,7 @@ return_code parseArguments(int argc,
boost::program_options::options_description hidden_options("Hidden options");
hidden_options.add_options()(
"input,i",
boost::program_options::value<boost::filesystem::path>(&extractor_config.input_path),
boost::program_options::value<std::filesystem::path>(&extractor_config.input_path),
"Input file in .osm, .osm.bz2 or .osm.pbf format")(
"generate-edge-lookup",
boost::program_options::bool_switch(&dummy)->implicit_value(true)->default_value(false),
@@ -104,7 +102,7 @@ return_code parseArguments(int argc,
const auto *executable = argv[0];
boost::program_options::options_description visible_options(
boost::filesystem::path(executable).filename().string() +
std::filesystem::path(executable).filename().string() +
" <input.osm/.osm.bz2/.osm.pbf> [options]");
visible_options.add(generic_options).add(config_options);
@@ -176,14 +174,14 @@ try
return EXIT_FAILURE;
}
if (!boost::filesystem::is_regular_file(extractor_config.input_path))
if (!std::filesystem::is_regular_file(extractor_config.input_path))
{
util::Log(logERROR) << "Input file " << extractor_config.input_path.string()
<< " not found!";
return EXIT_FAILURE;
}
if (!boost::filesystem::is_regular_file(extractor_config.profile_path))
if (!std::filesystem::is_regular_file(extractor_config.profile_path))
{
util::Log(logERROR) << "Profile " << extractor_config.profile_path.string()
<< " not found!";
+8 -9
View File
@@ -3,9 +3,6 @@
#include "util/log.hpp"
#include "util/timing_util.hpp"
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include <cmath>
#include <cstdio>
#include <fcntl.h>
@@ -15,6 +12,8 @@
#include <algorithm>
#include <chrono>
#include <filesystem>
#include <fstream>
#include <iomanip>
#include <numeric>
#include <random>
@@ -45,7 +44,7 @@ void runStatistics(std::vector<double> &timings_vector, Statistics &stats)
}
} // namespace osrm::tools
boost::filesystem::path test_path;
std::filesystem::path test_path;
int main(int argc, char *argv[])
{
@@ -66,7 +65,7 @@ int main(int argc, char *argv[])
return -1;
}
test_path = boost::filesystem::path(argv[1]);
test_path = std::filesystem::path(argv[1]);
test_path /= "osrm.tst";
osrm::util::Log(logDEBUG) << "temporary file: " << test_path.string();
@@ -74,7 +73,7 @@ int main(int argc, char *argv[])
if (2 == argc)
{
// create file to test
if (boost::filesystem::exists(test_path))
if (std::filesystem::exists(test_path))
{
throw osrm::util::exception("Data file already exists: " + test_path.string() +
SOURCE_REF);
@@ -120,7 +119,7 @@ int main(int argc, char *argv[])
else
{
// Run Non-Cached I/O benchmarks
if (!boost::filesystem::exists(test_path))
if (!std::filesystem::exists(test_path))
{
throw osrm::util::exception("data file does not exist" + SOURCE_REF);
}
@@ -298,9 +297,9 @@ int main(int argc, char *argv[])
<< "max: " << stats.max << "ms, "
<< "dev: " << stats.dev << "ms";
if (boost::filesystem::exists(test_path))
if (std::filesystem::exists(test_path))
{
boost::filesystem::remove(test_path);
std::filesystem::remove(test_path);
osrm::util::Log(logDEBUG) << "removing temporary files";
}
}
+5 -5
View File
@@ -8,10 +8,10 @@
#include "util/version.hpp"
#include <boost/algorithm/string/join.hpp>
#include <boost/filesystem.hpp>
#include <boost/program_options.hpp>
#include <boost/range/adaptor/transformed.hpp>
#include <filesystem>
#include <iostream>
#include <iterator>
#include <regex>
@@ -119,7 +119,7 @@ return_code parseArguments(int argc,
boost::program_options::options_description hidden_options("Hidden options");
hidden_options.add_options()(
"input,i",
boost::program_options::value<boost::filesystem::path>(&config.base_path),
boost::program_options::value<std::filesystem::path>(&config.base_path),
"Input base file path");
// positional option
@@ -132,7 +132,7 @@ return_code parseArguments(int argc,
const auto *executable = argv[0];
boost::program_options::options_description visible_options(
boost::filesystem::path(executable).filename().string() + " <input.osrm> [options]");
std::filesystem::path(executable).filename().string() + " <input.osrm> [options]");
visible_options.add(generic_options).add(config_options);
// parse command line options
@@ -216,9 +216,9 @@ try
return EXIT_FAILURE;
}
auto check_file = [](const boost::filesystem::path &path)
auto check_file = [](const std::filesystem::path &path)
{
if (!boost::filesystem::is_regular_file(path))
if (!std::filesystem::is_regular_file(path))
{
util::Log(logERROR) << "Input file " << path << " not found!";
return false;
+7 -7
View File
@@ -12,7 +12,6 @@
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/any.hpp>
#include <boost/filesystem.hpp>
#include <boost/optional/optional_io.hpp>
#include <boost/program_options.hpp>
@@ -22,6 +21,7 @@
#include <chrono>
#include <exception>
#include <filesystem>
#include <future>
#include <iostream>
#include <new>
@@ -102,7 +102,7 @@ void validate(boost::any &v, const std::vector<std::string> &values, double *, d
// generate boost::program_options object for the routing part
inline unsigned generateServerProgramOptions(const int argc,
const char *argv[],
boost::filesystem::path &base_path,
std::filesystem::path &base_path,
std::string &ip_address,
int &ip_port,
bool &trial,
@@ -110,8 +110,8 @@ inline unsigned generateServerProgramOptions(const int argc,
int &requested_thread_num,
short &keepalive_timeout)
{
using boost::filesystem::path;
using boost::program_options::value;
using std::filesystem::path;
const auto hardware_threads = std::max<int>(1, std::thread::hardware_concurrency());
@@ -148,7 +148,7 @@ inline unsigned generateServerProgramOptions(const int argc,
value<bool>(&config.use_shared_memory)->implicit_value(true)->default_value(false),
"Load data from shared memory") //
("memory_file",
value<boost::filesystem::path>(&config.memory_file),
value<std::filesystem::path>(&config.memory_file),
"DEPRECATED: Will behave the same as --mmap.")(
"mmap,m",
value<bool>(&config.use_mmap)->implicit_value(true)->default_value(false),
@@ -192,7 +192,7 @@ inline unsigned generateServerProgramOptions(const int argc,
// hidden options, will be allowed on command line, but will not be shown to the user
boost::program_options::options_description hidden_options("Hidden options");
hidden_options.add_options()(
"base,b", value<boost::filesystem::path>(&base_path), "base path to .osrm file");
"base,b", value<std::filesystem::path>(&base_path), "base path to .osrm file");
// positional option
boost::program_options::positional_options_description positional_options;
@@ -204,7 +204,7 @@ inline unsigned generateServerProgramOptions(const int argc,
const auto *executable = argv[0];
boost::program_options::options_description visible_options(
boost::filesystem::path(executable).filename().string() + " <base.osrm> [<options>]");
std::filesystem::path(executable).filename().string() + " <base.osrm> [<options>]");
visible_options.add(generic_options).add(config_options);
// parse command line options
@@ -267,7 +267,7 @@ try
int ip_port;
EngineConfig config;
boost::filesystem::path base_path;
std::filesystem::path base_path;
int requested_thread_num = 1;
short keepalive_timeout = 5;
+5 -5
View File
@@ -11,11 +11,11 @@
#include "util/version.hpp"
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/filesystem.hpp>
#include <boost/program_options.hpp>
#include <csignal>
#include <cstdlib>
#include <filesystem>
using namespace osrm;
@@ -97,7 +97,7 @@ void springClean()
bool generateDataStoreOptions(const int argc,
const char *argv[],
std::string &verbosity,
boost::filesystem::path &base_path,
std::filesystem::path &base_path,
int &max_wait,
std::string &dataset_name,
bool &list_datasets,
@@ -155,7 +155,7 @@ bool generateDataStoreOptions(const int argc,
// hidden options, will be allowed on command line but will not be shown to the user
boost::program_options::options_description hidden_options("Hidden options");
hidden_options.add_options()("base,b",
boost::program_options::value<boost::filesystem::path>(&base_path),
boost::program_options::value<std::filesystem::path>(&base_path),
"base path to .osrm file");
// positional option
@@ -168,7 +168,7 @@ bool generateDataStoreOptions(const int argc,
const auto *executable = argv[0];
boost::program_options::options_description visible_options(
boost::filesystem::path(executable).filename().string() + " [<options>] <configuration>");
std::filesystem::path(executable).filename().string() + " [<options>] <configuration>");
visible_options.add(generic_options).add(config_options);
// print help options if no infile is specified
@@ -242,7 +242,7 @@ try
util::LogPolicy::GetInstance().Unmute();
std::string verbosity;
boost::filesystem::path base_path;
std::filesystem::path base_path;
int max_wait = -1;
std::string dataset_name;
bool list_datasets = false;
+2 -2
View File
@@ -25,7 +25,6 @@
#include "util/typedefs.hpp"
#include <boost/assert.hpp>
#include <boost/filesystem/fstream.hpp>
#include <tbb/blocked_range.h>
#include <tbb/concurrent_vector.h>
@@ -38,6 +37,7 @@
#include <atomic>
#include <bitset>
#include <cstdint>
#include <fstream>
#include <iterator>
#include <memory>
#include <tuple>
@@ -408,7 +408,7 @@ void saveDatasourcesNames(const UpdaterConfig &config)
// for rendering in the debug tiles.
for (auto const &name : config.segment_speed_lookup_paths)
{
sources.SetSourceName(source, boost::filesystem::path(name).stem().string());
sources.SetSourceName(source, std::filesystem::path(name).stem().string());
source++;
}
+2 -4
View File
@@ -3,13 +3,11 @@
#include "util/geojson_validation.hpp"
#include "util/log.hpp"
#include <boost/filesystem/fstream.hpp>
#include <boost/filesystem/path.hpp>
#include <rapidjson/document.h>
#include <rapidjson/error/en.h>
#include <rapidjson/istreamwrapper.h>
#include <filesystem>
#include <fstream>
#include <optional>
#include <regex>
@@ -40,7 +38,7 @@ Timezoner::Timezoner(const char geojson[], std::time_t utc_time_now)
LoadLocalTimesRTree(doc, utc_time_now);
}
Timezoner::Timezoner(const boost::filesystem::path &tz_shapes_filename, std::time_t utc_time_now)
Timezoner::Timezoner(const std::filesystem::path &tz_shapes_filename, std::time_t utc_time_now)
{
util::Log() << "Time zone validation based on UTC time : " << utc_time_now;