Loading src/core/config/ConfigManager.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ using namespace allpix; /** * @throws ConfigFileUnavailableError If the main configuration file cannot be accessed */ ConfigManager::ConfigManager(std::string file_name, ConfigManager::ConfigManager(std::filesystem::path file_name, std::initializer_list<std::string> global, std::initializer_list<std::string> ignore) { // Check if the file exists Loading src/core/config/ConfigManager.hpp +2 −1 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ #ifndef ALLPIX_CONFIG_MANAGER_H #define ALLPIX_CONFIG_MANAGER_H #include <filesystem> #include <set> #include <string> #include <vector> Loading Loading @@ -40,7 +41,7 @@ namespace allpix { * @param global List of sections representing the global configuration (excluding the empty header section) * @param ignore List of sections that should be ignored */ explicit ConfigManager(std::string file_name, explicit ConfigManager(std::filesystem::path file_name, std::initializer_list<std::string> global = {}, std::initializer_list<std::string> ignore = {"Ignore"}); /** Loading src/core/config/ConfigReader.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ using namespace allpix; ConfigReader::ConfigReader() = default; ConfigReader::ConfigReader(std::istream& stream, std::string file_name) : ConfigReader() { ConfigReader::ConfigReader(std::istream& stream, std::filesystem::path file_name) : ConfigReader() { add(stream, std::move(file_name)); } Loading Loading @@ -96,7 +96,7 @@ std::pair<std::string, std::string> ConfigReader::parseKeyValue(std::string line * * The configuration is immediately parsed and all of its configurations are available after the functions returns. */ void ConfigReader::add(std::istream& stream, std::string file_name) { void ConfigReader::add(std::istream& stream, std::filesystem::path file_name) { LOG(TRACE) << "Parsing configuration file " << file_name; // Convert file name to absolute path (if given) Loading src/core/config/ConfigReader.hpp +3 −2 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ #ifndef ALLPIX_CONFIG_READER_H #define ALLPIX_CONFIG_READER_H #include <filesystem> #include <istream> #include <list> #include <map> Loading Loading @@ -38,7 +39,7 @@ namespace allpix { * @param stream Stream to read configuration from * @param file_name Name of the file related to the stream or empty if not linked to a file */ explicit ConfigReader(std::istream& stream, std::string file_name = ""); explicit ConfigReader(std::istream& stream, std::filesystem::path file_name = ""); /** * @brief Parse a line as key-value pair Loading @@ -52,7 +53,7 @@ namespace allpix { * @param stream Stream to read configuration from * @param file_name Name of the file related to the stream or empty if not linked to a file */ void add(std::istream&, std::string file_name = ""); void add(std::istream&, std::filesystem::path file_name = ""); /** * @brief Directly add a configuration object to the reader Loading src/core/config/Configuration.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -39,7 +39,8 @@ void Configuration::AccessMarker::registerMarker(const std::string& key) { markers_.emplace(std::piecewise_construct, std::forward_as_tuple(key), std::forward_as_tuple()); } Configuration::Configuration(std::string name, std::string path) : name_(std::move(name)), path_(std::move(path)) {} Configuration::Configuration(std::string name, std::filesystem::path path) : name_(std::move(name)), path_(std::move(path)) {} bool Configuration::has(const std::string& key) const { return config_.find(key) != config_.cend(); Loading Loading
src/core/config/ConfigManager.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ using namespace allpix; /** * @throws ConfigFileUnavailableError If the main configuration file cannot be accessed */ ConfigManager::ConfigManager(std::string file_name, ConfigManager::ConfigManager(std::filesystem::path file_name, std::initializer_list<std::string> global, std::initializer_list<std::string> ignore) { // Check if the file exists Loading
src/core/config/ConfigManager.hpp +2 −1 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ #ifndef ALLPIX_CONFIG_MANAGER_H #define ALLPIX_CONFIG_MANAGER_H #include <filesystem> #include <set> #include <string> #include <vector> Loading Loading @@ -40,7 +41,7 @@ namespace allpix { * @param global List of sections representing the global configuration (excluding the empty header section) * @param ignore List of sections that should be ignored */ explicit ConfigManager(std::string file_name, explicit ConfigManager(std::filesystem::path file_name, std::initializer_list<std::string> global = {}, std::initializer_list<std::string> ignore = {"Ignore"}); /** Loading
src/core/config/ConfigReader.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ using namespace allpix; ConfigReader::ConfigReader() = default; ConfigReader::ConfigReader(std::istream& stream, std::string file_name) : ConfigReader() { ConfigReader::ConfigReader(std::istream& stream, std::filesystem::path file_name) : ConfigReader() { add(stream, std::move(file_name)); } Loading Loading @@ -96,7 +96,7 @@ std::pair<std::string, std::string> ConfigReader::parseKeyValue(std::string line * * The configuration is immediately parsed and all of its configurations are available after the functions returns. */ void ConfigReader::add(std::istream& stream, std::string file_name) { void ConfigReader::add(std::istream& stream, std::filesystem::path file_name) { LOG(TRACE) << "Parsing configuration file " << file_name; // Convert file name to absolute path (if given) Loading
src/core/config/ConfigReader.hpp +3 −2 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ #ifndef ALLPIX_CONFIG_READER_H #define ALLPIX_CONFIG_READER_H #include <filesystem> #include <istream> #include <list> #include <map> Loading Loading @@ -38,7 +39,7 @@ namespace allpix { * @param stream Stream to read configuration from * @param file_name Name of the file related to the stream or empty if not linked to a file */ explicit ConfigReader(std::istream& stream, std::string file_name = ""); explicit ConfigReader(std::istream& stream, std::filesystem::path file_name = ""); /** * @brief Parse a line as key-value pair Loading @@ -52,7 +53,7 @@ namespace allpix { * @param stream Stream to read configuration from * @param file_name Name of the file related to the stream or empty if not linked to a file */ void add(std::istream&, std::string file_name = ""); void add(std::istream&, std::filesystem::path file_name = ""); /** * @brief Directly add a configuration object to the reader Loading
src/core/config/Configuration.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -39,7 +39,8 @@ void Configuration::AccessMarker::registerMarker(const std::string& key) { markers_.emplace(std::piecewise_construct, std::forward_as_tuple(key), std::forward_as_tuple()); } Configuration::Configuration(std::string name, std::string path) : name_(std::move(name)), path_(std::move(path)) {} Configuration::Configuration(std::string name, std::filesystem::path path) : name_(std::move(name)), path_(std::move(path)) {} bool Configuration::has(const std::string& key) const { return config_.find(key) != config_.cend(); Loading