From 111c8ebd4938dd3e4648a911ee6f984e88587af7 Mon Sep 17 00:00:00 2001 From: Timm Fitschen <t.fitschen@indiscale.com> Date: Tue, 26 Oct 2021 14:38:44 +0200 Subject: [PATCH] Fix load_string_file --- include/caosdb/utility.h | 4 ++-- src/caosdb/configuration.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/caosdb/utility.h b/include/caosdb/utility.h index 2822e0c..7f75594 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 b08046d..dc09d3d 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)) { -- GitLab