diff --git a/include/caosdb/utility.h b/include/caosdb/utility.h index 2822e0c2538cbd91005ca73e6a325be3dde78e31..7f75594431c1316e9d918be6aae038c134adfabf 100644 --- a/include/caosdb/utility.h +++ b/include/caosdb/utility.h @@ -84,9 +84,9 @@ auto getEnumValueFromName<caosdb::entity::Role>(const std::string &name) -> caos /** * @brief Read a text file into a string and return the file's content. */ -inline auto load_string_file(const std::string &file_path) -> std::string { +inline auto load_string_file(const path &file_path) -> std::string { std::string result; - boost::filesystem::load_string_file(file_path, result); + boost::filesystem::load_string_file(file_path.string(), result); return result; } diff --git a/src/caosdb/configuration.cpp b/src/caosdb/configuration.cpp index b08046d5ff687220ddfc4fa6c2cefc2e876f0900..dc09d3dc4019ed6b920fe7d6157424b31f198b59 100644 --- a/src/caosdb/configuration.cpp +++ b/src/caosdb/configuration.cpp @@ -471,12 +471,12 @@ auto ConfigurationManager::InitializeDefaults() -> int { // NOLINT configuration_file_path = std::make_unique<path>(); const path raw(configuration_file); // resolve home directory - for (auto segment = raw.begin(); segment != raw.end(); ++segment) { - if (segment->string() == "$HOME") { + for (const auto &segment : raw) { + if (segment.string() == "$HOME") { path expanded_home(get_home_directory()); *configuration_file_path /= expanded_home; } else { - *configuration_file_path /= *segment; + *configuration_file_path /= segment; } } if (exists(*configuration_file_path)) {