diff --git a/include/engine/datafacade/internal_datafacade.hpp b/include/engine/datafacade/internal_datafacade.hpp index 16ab0769c..c15b12182 100644 --- a/include/engine/datafacade/internal_datafacade.hpp +++ b/include/engine/datafacade/internal_datafacade.hpp @@ -228,13 +228,13 @@ class InternalDataFacade final : public BaseDataFacade } } - void LoadDatasourceInfo(const std::string &datasource_names_file, - const std::string &datasource_indexes_file) + void LoadDatasourceInfo(const boost::filesystem::path &datasource_names_file, + const boost::filesystem::path &datasource_indexes_file) { boost::filesystem::ifstream datasources_stream(datasource_indexes_file, std::ios::binary); if (!datasources_stream) { - throw util::exception("Could not open " + datasource_indexes_file + " for reading!"); + throw util::exception("Could not open " + datasource_indexes_file.string() + " for reading!"); } BOOST_ASSERT(datasources_stream); @@ -251,7 +251,7 @@ class InternalDataFacade final : public BaseDataFacade boost::filesystem::ifstream datasourcenames_stream(datasource_names_file, std::ios::binary); if (!datasourcenames_stream) { - throw util::exception("Could not open " + datasource_names_file + " for reading!"); + throw util::exception("Could not open " + datasource_names_file.string() + " for reading!"); } BOOST_ASSERT(datasourcenames_stream); std::string name; diff --git a/include/storage/storage_config.hpp b/include/storage/storage_config.hpp index 29dd3cbc5..b5d016408 100644 --- a/include/storage/storage_config.hpp +++ b/include/storage/storage_config.hpp @@ -3,8 +3,6 @@ #include -#include - namespace osrm { namespace storage @@ -15,18 +13,18 @@ struct StorageConfig StorageConfig(const boost::filesystem::path &base); bool IsValid() const; - std::string ram_index_path; - std::string file_index_path; - std::string hsgr_data_path; - std::string nodes_data_path; - std::string edges_data_path; - std::string core_data_path; - std::string geometries_path; - std::string timestamp_path; - std::string datasource_names_path; - std::string datasource_indexes_path; - std::string names_data_path; - std::string properties_path; + boost::filesystem::path ram_index_path; + boost::filesystem::path file_index_path; + boost::filesystem::path hsgr_data_path; + boost::filesystem::path nodes_data_path; + boost::filesystem::path edges_data_path; + boost::filesystem::path core_data_path; + boost::filesystem::path geometries_path; + boost::filesystem::path timestamp_path; + boost::filesystem::path datasource_names_path; + boost::filesystem::path datasource_indexes_path; + boost::filesystem::path names_data_path; + boost::filesystem::path properties_path; }; } } diff --git a/src/storage/storage.cpp b/src/storage/storage.cpp index 4dea95b1a..be5ce3f83 100644 --- a/src/storage/storage.cpp +++ b/src/storage/storage.cpp @@ -126,7 +126,7 @@ int Storage::Run() auto shared_layout_ptr = new (layout_memory->Ptr()) SharedDataLayout(); shared_layout_ptr->SetBlockSize(SharedDataLayout::FILE_INDEX_PATH, - config.file_index_path.length() + 1); + config.file_index_path.string().length() + 1); // collect number of elements to store in shared memory object util::SimpleLogger().Write() << "load names from: " << config.names_data_path; @@ -316,7 +316,7 @@ int Storage::Run() file_index_path_ptr + shared_layout_ptr->GetBlockSize(SharedDataLayout::FILE_INDEX_PATH), 0); - std::copy(config.file_index_path.begin(), config.file_index_path.end(), file_index_path_ptr); + std::copy(config.file_index_path.string().begin(), config.file_index_path.string().end(), file_index_path_ptr); // Loading street names unsigned *name_offsets_ptr = shared_layout_ptr->GetBlockPtr( @@ -528,7 +528,7 @@ int Storage::Run() boost::filesystem::ifstream profile_properties_stream(config.properties_path); if (!profile_properties_stream) { - util::exception("Could not open " + config.properties_path + " for reading!"); + util::exception("Could not open " + config.properties_path.string() + " for reading!"); } profile_properties_stream.read(reinterpret_cast(profile_properties_ptr), sizeof(extractor::ProfileProperties));