Skip to content

Commit f1eabc3

Browse files
authored
Replace boost::filesystem with std (#6432)
1 parent c3f2a6c commit f1eabc3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+416
-310
lines changed

.github/workflows/osrm-backend.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ jobs:
152152
>&2 echo "No berlin-latest.geojson found"
153153
exit 1
154154
fi
155-
156155
# removing `.osrm.nbg` to check that whole pipeline works without it
157156
rm -rf "${PWD}/berlin-latest.osrm.nbg"
158157
@@ -740,3 +739,4 @@ jobs:
740739
needs: [build-test-publish, docker-image-matrix, windows-release-node, benchmarks]
741740
steps:
742741
- run: echo "CI complete"
742+

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
- CHANGED: Avoid copy of std::function-based callback in path unpacking [#6895](https://github.com/Project-OSRM/osrm-backend/pull/6895)
4545
- CHANGED: Replace boost::hash by std::hash [#6892](https://github.com/Project-OSRM/osrm-backend/pull/6892)
4646
- CHANGED: Partial fix migration from boost::optional to std::optional [#6551](https://github.com/Project-OSRM/osrm-backend/issues/6551)
47+
- CHANGED: Replace boost::filesystem with std::filesystem [#6432](https://github.com/Project-OSRM/osrm-backend/pull/6432)
4748
- CHANGED: Update Conan Boost version to 1.85.0. [#6868](https://github.com/Project-OSRM/osrm-backend/pull/6868)
4849
- FIXED: Fix an error in a RouteParameters AnnotationsType operator overload. [#6646](https://github.com/Project-OSRM/osrm-backend/pull/6646)
4950
- ADDED: Add support for "unlimited" to be passed as a value for the default-radius and max-matching-radius flags. [#6599](https://github.com/Project-OSRM/osrm-backend/pull/6599)

features/support/env.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ module.exports = function () {
4242
this.OSRM_PORT = process.env.OSRM_PORT && parseInt(process.env.OSRM_PORT) || 5000;
4343
this.OSRM_IP = process.env.OSRM_IP || '127.0.0.1';
4444
this.OSRM_CONNECTION_RETRIES = process.env.OSRM_CONNECTION_RETRIES && parseInt(process.env.OSRM_CONNECTION_RETRIES) || 10;
45-
this.OSRM_CONNECTION_EXP_BACKOFF_COEF = process.env.OSRM_CONNECTION_EXP_BACKOFF_COEF && parseFloat(process.env.OSRM_CONNECTION_EXP_BACKOFF_COEF) || 1.0;
45+
this.OSRM_CONNECTION_EXP_BACKOFF_COEF = process.env.OSRM_CONNECTION_EXP_BACKOFF_COEF && parseFloat(process.env.OSRM_CONNECTION_EXP_BACKOFF_COEF) || 1.1;
4646

4747
this.HOST = `http://${this.OSRM_IP}:${this.OSRM_PORT}`;
4848

include/contractor/contractor_config.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3131
#include "storage/io_config.hpp"
3232
#include "updater/updater_config.hpp"
3333

34-
#include <boost/filesystem/path.hpp>
35-
34+
#include <filesystem>
3635
#include <string>
3736

3837
namespace osrm::contractor
@@ -47,7 +46,7 @@ struct ContractorConfig final : storage::IOConfig
4746
}
4847

4948
// Infer the output names from the path of the .osrm file
50-
void UseDefaultOutputNames(const boost::filesystem::path &base)
49+
void UseDefaultOutputNames(const std::filesystem::path &base)
5150
{
5251
IOConfig::UseDefaultOutputNames(base);
5352
updater_config.UseDefaultOutputNames(base);

include/contractor/files.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace osrm::contractor::files
99
{
1010
// reads .osrm.hsgr file
1111
template <typename ContractedMetricT>
12-
inline void readGraph(const boost::filesystem::path &path,
12+
inline void readGraph(const std::filesystem::path &path,
1313
std::unordered_map<std::string, ContractedMetricT> &metrics,
1414
std::uint32_t &connectivity_checksum)
1515
{
@@ -30,7 +30,7 @@ inline void readGraph(const boost::filesystem::path &path,
3030

3131
// writes .osrm.hsgr file
3232
template <typename ContractedMetricT>
33-
inline void writeGraph(const boost::filesystem::path &path,
33+
inline void writeGraph(const std::filesystem::path &path,
3434
const std::unordered_map<std::string, ContractedMetricT> &metrics,
3535
const std::uint32_t connectivity_checksum)
3636
{

include/customizer/customizer_config.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
#ifndef OSRM_CUSTOMIZE_CUSTOMIZER_CONFIG_HPP
22
#define OSRM_CUSTOMIZE_CUSTOMIZER_CONFIG_HPP
33

4-
#include <boost/filesystem/path.hpp>
5-
64
#include <array>
5+
#include <filesystem>
76
#include <string>
87

98
#include "storage/io_config.hpp"
@@ -27,7 +26,7 @@ struct CustomizationConfig final : storage::IOConfig
2726
{
2827
}
2928

30-
void UseDefaultOutputNames(const boost::filesystem::path &base)
29+
void UseDefaultOutputNames(const std::filesystem::path &base)
3130
{
3231
IOConfig::UseDefaultOutputNames(base);
3332
updater_config.UseDefaultOutputNames(base);

include/customizer/edge_based_graph.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#include "storage/shared_memory_ownership.hpp"
1111

12-
#include <boost/filesystem/path.hpp>
12+
#include <filesystem>
1313

1414
namespace osrm::customizer
1515
{

include/customizer/files.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace osrm::customizer::files
1414

1515
// reads .osrm.cell_metrics file
1616
template <typename CellMetricT>
17-
inline void readCellMetrics(const boost::filesystem::path &path,
17+
inline void readCellMetrics(const std::filesystem::path &path,
1818
std::unordered_map<std::string, std::vector<CellMetricT>> &metrics)
1919
{
2020
static_assert(std::is_same<CellMetricView, CellMetricT>::value ||
@@ -44,7 +44,7 @@ inline void readCellMetrics(const boost::filesystem::path &path,
4444
// writes .osrm.cell_metrics file
4545
template <typename CellMetricT>
4646
inline void
47-
writeCellMetrics(const boost::filesystem::path &path,
47+
writeCellMetrics(const std::filesystem::path &path,
4848
const std::unordered_map<std::string, std::vector<CellMetricT>> &metrics)
4949
{
5050
static_assert(std::is_same<CellMetricView, CellMetricT>::value ||
@@ -72,7 +72,7 @@ writeCellMetrics(const boost::filesystem::path &path,
7272

7373
// reads .osrm.mldgr file
7474
template <typename MultiLevelGraphT>
75-
inline void readGraph(const boost::filesystem::path &path,
75+
inline void readGraph(const std::filesystem::path &path,
7676
MultiLevelGraphT &graph,
7777
std::uint32_t &connectivity_checksum)
7878
{
@@ -88,7 +88,7 @@ inline void readGraph(const boost::filesystem::path &path,
8888

8989
// writes .osrm.mldgr file
9090
template <typename MultiLevelGraphT>
91-
inline void writeGraph(const boost::filesystem::path &path,
91+
inline void writeGraph(const std::filesystem::path &path,
9292
const MultiLevelGraphT &graph,
9393
const std::uint32_t connectivity_checksum)
9494
{

include/engine/datafacade/contiguous_internalmem_datafacade.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
177177

178178
SharedRTree m_static_rtree;
179179
std::unique_ptr<SharedGeospatialQuery> m_geospatial_query;
180-
boost::filesystem::path file_index_path;
180+
std::filesystem::path file_index_path;
181181

182182
std::optional<extractor::IntersectionBearingsView> intersection_bearings_view;
183183

include/engine/engine_config.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3131
#include "storage/storage_config.hpp"
3232
#include "osrm/datasets.hpp"
3333

34-
#include <boost/filesystem/path.hpp>
35-
34+
#include <filesystem>
3635
#include <set>
3736
#include <string>
3837

@@ -83,7 +82,7 @@ struct EngineConfig final
8382
boost::optional<double> default_radius = -1.0;
8483
int max_alternatives = 3; // set an arbitrary upper bound; can be adjusted by user
8584
bool use_shared_memory = true;
86-
boost::filesystem::path memory_file;
85+
std::filesystem::path memory_file;
8786
bool use_mmap = true;
8887
Algorithm algorithm = Algorithm::CH;
8988
std::vector<storage::FeatureDataset> disable_feature_dataset;

0 commit comments

Comments
 (0)