From d4bbd9cb3abfd0dd6961f28c95c4bb4e9f7e3c47 Mon Sep 17 00:00:00 2001 From: Emily Boudreaux Date: Tue, 7 Apr 2026 09:28:27 -0400 Subject: [PATCH 1/2] feat(loading): robust error reporting and mutation cfg now reports which fields are missing when loading. Further, the mutate method has been added for easier mutation of the underlying configuration struct --- meson.build | 2 +- readme.md | 28 ++++ src/config/include/fourdst/config/ansi.h | 62 +++++++ src/config/include/fourdst/config/base.h | 58 ++++++- src/config/include/fourdst/config/validate.h | 157 ++++++++++++++++++ tests/config/configTest.cpp | 46 ++++- .../example.good.missing.field.toml | 16 ++ .../example.missing.nondefault.field.toml | 15 ++ tests/config/test_schema.h | 8 +- 9 files changed, 382 insertions(+), 10 deletions(-) create mode 100644 src/config/include/fourdst/config/ansi.h create mode 100644 src/config/include/fourdst/config/validate.h create mode 100644 tests/config/example_config_files/example.good.missing.field.toml create mode 100644 tests/config/example_config_files/example.missing.nondefault.field.toml diff --git a/meson.build b/meson.build index 367afbf..f518967 100644 --- a/meson.build +++ b/meson.build @@ -18,7 +18,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # *********************************************************************** # -project('libconfig', ['cpp', 'c'], version: 'v2.1.0', default_options: ['cpp_std=c++23'], meson_version: '>=1.5.0') +project('libconfig', ['cpp', 'c'], version: 'v2.2.0', default_options: ['cpp_std=c++23'], meson_version: '>=1.5.0') # Add default visibility for all C++ targets add_project_arguments('-fvisibility=default', language: 'cpp') diff --git a/readme.md b/readme.md index 7f4062a..6a0d70d 100644 --- a/readme.md +++ b/readme.md @@ -33,10 +33,12 @@ and strongly typed. #include "fourdst/config/config.h" #include #include +#include struct MyPhysicsOptions { int gravity = 10; float friction = 0.5f; + std::optional dampening = 0.1f; bool enable_wind = false; }; @@ -64,12 +66,38 @@ int main() { // You can load a config from a file try { cfg.load("my_config.toml"); + // You can also pass an optional bool as a second argument to turn on verbose error + // reporting. This will display a tree of missing or invalid fields. Note that due to limitations + // in C++'s ability to detect default iniailized values vs initializer list values + // missing fields which you set an initializer list for are still considered missing. + // **ONLY fields marked with std::optional are exempt from this rule.** } catch (const fourdst::config::exceptions::ConfigError& e) { std::println("Error loading config: {}", e.what()); } // You can access the config values std::println("My Simulation Name: {}, My Simulation Gravity: {}", cfg->name, cfg->physics.gravity); + + // libconfig intentioanlly discourages direct modification of config values. However, if you need + // to modify values after loading them you can use the mutate function. This takes a lambda + // which recives a mutable reference to the underlying config struct. + + cfg.mutate([](MySimulationConfig& config) { + config->physics.enable_wind = true; + }); + + // Making these mutations will put the config into a "MODIFIED" state and will cache the unmodified values. + // You can reset the state and revert to the unmodified values with the reset function. + + cfg.reset(); + + // The current state of the config can be checked with the get_state() function or the describe_state() function. + // get_state returns an enum value while describe_state returns a human readable string. + + std::println("Config State: {}", cfg.describe_state()); + fourdst::config::ConfigState state = cfg.get_state(); + + // Possible states are DEFAULT, LOADED_FROM_FILE, and MODIFIED } ``` diff --git a/src/config/include/fourdst/config/ansi.h b/src/config/include/fourdst/config/ansi.h new file mode 100644 index 0000000..b624251 --- /dev/null +++ b/src/config/include/fourdst/config/ansi.h @@ -0,0 +1,62 @@ +#pragma once + +#include +#include + +#ifdef _WIN32 +#include +#include +#define ISATTY _isatty +#define FILENO _fileno +#else +#include +#define ISATTY isatty +#define FILENO fileno +#endif + +namespace fourdst::config::utils { + + bool supports_ansi_colors() { + if (std::getenv("NO_COLOR")) return false; + if (std::getenv("FORCE_COLOR")) return true; + + if (!ISATTY(FILENO(stdout))) return false; + +#ifdef _WIN32 + HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE); + if (hOut == INVALID_HANDLE_VALUE) return false; + DWORD dwMode = 0; + if (!GetConsoleMode(hOut, &dwMode)) return false; + return (dwMode & ENABLE_VIRTUAL_TERMINAL_PROCESSING) != 0; +#else + const char* term = std::getenv("TERM"); + if (!term) return false; + const std::string term_str(term); + return term_str != "dumb"; +#endif + } + + const static bool TERM_COLOR_SUPPORT = supports_ansi_colors(); + + class ANSIColor { + public: + explicit ANSIColor(const std::string& value) : m_value(value) {} + + std::string_view get() const { + if (TERM_COLOR_SUPPORT) { + return m_value; + } + return ""; + } + private: + std::string m_value{""}; + ANSIColor() = default; + + }; + + static ANSIColor RED{"\033[31m"}; + static ANSIColor GREEN{"\033[32m"}; + static ANSIColor BLUE{"\033[34m"}; + static ANSIColor CYAN{"\033[36m"}; + static ANSIColor RESET{"\033[0m"}; +} \ No newline at end of file diff --git a/src/config/include/fourdst/config/base.h b/src/config/include/fourdst/config/base.h index a18e278..2c911ab 100644 --- a/src/config/include/fourdst/config/base.h +++ b/src/config/include/fourdst/config/base.h @@ -14,8 +14,10 @@ #include #include #include +#include #include "fourdst/config/exceptions/exceptions.h" +#include "fourdst/config/validate.h" #include "rfl.hpp" #include "rfl/toml.hpp" @@ -65,7 +67,9 @@ namespace fourdst::config { /** * @brief Configuration has been successfully populated from a file. */ - LOADED_FROM_FILE + LOADED_FROM_FILE, + + MODIFIED }; @@ -127,7 +131,7 @@ namespace fourdst::config { * @brief Get a mutable pointer to the configuration content. * @return Pointer to the mutable configuration content. */ - T* write() const { return &m_content; } + [[deprecated("write has been depreceated for mutate() and will be removed in versions >= v3.0.0")]] T* write() const { return &m_content; } /** * @brief Dereference operator to access the underlying configuration struct. @@ -246,7 +250,7 @@ namespace fourdst::config { * } * @endcode */ - void load(const std::string_view path) { + void load(const std::string_view path, const bool verbose = false) { if (m_state == ConfigState::LOADED_FROM_FILE) { throw exceptions::ConfigLoadError( "Config has already been loaded from file. Reloading is not supported."); @@ -261,8 +265,32 @@ namespace fourdst::config { const rfl::Result result = rfl::toml::load(std::string(path)); if (!result) { + std::vector missing_fields; + + try { + toml::table root_tbl = toml::parse_file(std::string(path)); + + if (!root_tbl.empty()) { + const auto loaded_root_name = std::string(root_tbl.begin()->first); + const toml::table* t_tbl = root_tbl[loaded_root_name].as_table(); + + if (t_tbl) { + validate::ConfigValidator::check(t_tbl, loaded_root_name, missing_fields); + } + } + } catch (const toml::parse_error&) { + throw exceptions::ConfigParseError("Unable to parse TOML file for an unknown reason. This normally means the toml file is empty or completely malformed. Please check the file content and ensure it is valid TOML. If the file is empty, consider adding at least an empty table (e.g., [main]) to it."); + } + + if (!missing_fields.empty() && verbose) { + std::cerr << validate::report_all_missing_fields(missing_fields) << std::endl; + } + throw exceptions::ConfigParseError( - std::format("Failed to load config from file: {}", path)); + std::format("Failed to load config from file: {}. Reason: {}", + path, + result.error().what()) + ); } @@ -328,13 +356,35 @@ namespace fourdst::config { return "DEFAULT"; case ConfigState::LOADED_FROM_FILE: return "LOADED_FROM_FILE"; + case ConfigState::MODIFIED: + return "MODIFIED"; default: return "UNKNOWN"; } } + template + void mutate(MutatorFunc&& mutator) { + m_content_mutex.lock(); + m_content_orig = m_content; + mutator(m_content); + m_state = ConfigState::MODIFIED; + m_content_mutex.unlock(); + } + + void reset() { + m_content_mutex.lock(); + if (m_state == ConfigState::MODIFIED) { + m_content = m_content_orig; + m_state = ConfigState::LOADED_FROM_FILE; + } + m_content_mutex.unlock(); + } + private: T m_content; + T m_content_orig; + std::mutex m_content_mutex; std::string m_root_name = "main"; ConfigState m_state = ConfigState::DEFAULT; RootNameLoadPolicy m_root_name_load_policy = RootNameLoadPolicy::KEEP_CURRENT; diff --git a/src/config/include/fourdst/config/validate.h b/src/config/include/fourdst/config/validate.h new file mode 100644 index 0000000..49b6735 --- /dev/null +++ b/src/config/include/fourdst/config/validate.h @@ -0,0 +1,157 @@ +#pragma once + +#include "fourdst/config/ansi.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace fourdst::config::validate { + + template struct is_optional_impl : std::false_type {}; + template struct is_optional_impl> : std::true_type {}; + template constexpr bool is_optional_v = is_optional_impl>::value; + + template struct is_vector_impl : std::false_type {}; + template struct is_vector_impl> : std::true_type {}; + template constexpr bool is_vector_v = is_vector_impl>::value; + + template struct is_map_impl : std::false_type {}; + template struct is_map_impl> : std::true_type {}; + template struct is_map_impl> : std::true_type {}; + template constexpr bool is_map_v = is_map_impl>::value; + + template + constexpr bool is_string_like_v = std::is_same_v, std::string> || + std::is_same_v, std::string_view>; + + template + constexpr bool is_reflectable_struct_v = std::is_class_v> && + !is_string_like_v && + !is_vector_v && + !is_optional_v && + !is_map_v; + + template + struct ConfigValidator { + using NT = rfl::named_tuple_t; + + static void check(const toml::table* tbl, const std::string& current_path, std::vector& missing) { + if (!tbl) return; + check_tuple(tbl, current_path, missing); + } + private: + template + struct TupleChecker; + + template + struct TupleChecker> { + static void check(const toml::table* tbl, const std::string& path, std::vector& missing) { + (check_field(tbl, path, missing), ...); + } + }; + + template + static void check_tuple(const toml::table* tbl, const std::string& path, std::vector& missing) { + TupleChecker::check(tbl, path, missing); + } + + template + static void check_field(const toml::table* tbl, const std::string& path, std::vector& missing) { + std::string_view name_sv = Field::name(); + std::string name(name_sv); + + using RawType = typename Field::Type; + using Type = std::remove_cvref_t; + + std::string full_path = path.empty() ? name : path + "." + name; + const toml::node* node = tbl->get(name_sv); + + if (!node) { + if constexpr (!is_optional_v) { + missing.push_back(full_path); + } + } else { + if constexpr (is_reflectable_struct_v) { + if (node->is_table()) { + ConfigValidator::check(node->as_table(), full_path, missing); + } + } else if constexpr (is_vector_v) { + using ElementType = std::remove_cvref_t; + if constexpr (is_reflectable_struct_v) { + if (node->is_array()) { + const auto& arr = *node->as_array(); + for (size_t i = 0; i < arr.size(); ++i) { + if (arr.get(i)->is_table()) { + ConfigValidator::check( + arr.get(i)->as_table(), + std::format("{}[{}]", full_path, i), + missing + ); + } + } + } + } + } else if constexpr (is_optional_v) { + using InnerType = std::remove_cvref_t; + if constexpr (is_reflectable_struct_v) { + if (node->is_table()) { + ConfigValidator::check(node->as_table(), full_path, missing); + } + } + } + } + } + }; + + struct MissingFieldTree { + std::map children; + bool is_missing = false; + }; + + inline void print_missing_field_tree(const MissingFieldTree& tree, std::string indent, bool is_last, const std::string& name, std::string& output) { + if (!name.empty()) { + std::string display_name = tree.is_missing ? std::format("{}{}{}", utils::RED.get(), name, utils::RESET.get()) : name; + output += std::format("{}{} {}\n", indent, is_last ? "└──" : "├──", display_name); + indent += is_last ? " " : "│ "; + } + + size_t count = 0; + for (auto const& [child_name, child_tree] : tree.children) { + print_missing_field_tree(child_tree, indent, count == tree.children.size() - 1, child_name, output); + ++count; + } + } + + inline std::string report_all_missing_fields(const std::vector& missing) { + if (missing.empty()) return ""; + + MissingFieldTree root; + for (const auto& path : missing) { + std::stringstream ss(path); + std::string part; + MissingFieldTree* current = &root; + while (std::getline(ss, part, '.')) { + current = ¤t->children[part]; + } + current->is_missing = true; + } + + std::string output = "\nConfiguration Missing Field Path(s):\n"; + size_t count = 0; + for (auto const& [name, child_tree] : root.children) { + print_missing_field_tree(child_tree, "", count == root.children.size() - 1, name, output); + ++count; + } + return output; + } +} \ No newline at end of file diff --git a/tests/config/configTest.cpp b/tests/config/configTest.cpp index 9064a9c..0ee8bd2 100644 --- a/tests/config/configTest.cpp +++ b/tests/config/configTest.cpp @@ -18,11 +18,20 @@ std::string get_good_example_file() { return std::string(source_root) + "/tests/config/example_config_files/example.good.toml"; } +std::string get_good_missing_keys_example_file() { + const char* source_root = getenv("MESON_SOURCE_ROOT"); + if (source_root == nullptr) { + throw std::runtime_error("MESON_SOURCE_ROOT environment variable is not set."); + } + return std::string(source_root) + "/tests/config/example_config_files/example.good.missing.field.toml"; +} + enum class BAD_FILES { UNKNOWN_KEY, INVALID_TYPE, - INCORRECT_ARRAY_SIZE + INCORRECT_ARRAY_SIZE, + MISSING_NONDEFAULT_KEY }; std::string get_bad_example_file(BAD_FILES type) { @@ -37,6 +46,8 @@ std::string get_bad_example_file(BAD_FILES type) { return std::string(source_root) + "/tests/config/example_config_files/example.invalidtype.toml"; case BAD_FILES::INCORRECT_ARRAY_SIZE: return std::string(source_root) + "/tests/config/example_config_files/example.incorrectarraysize.toml"; + case BAD_FILES::MISSING_NONDEFAULT_KEY: + return std::string(source_root) + "/tests/config/example_config_files/example.missing.nondefault.field.toml"; } throw std::runtime_error("Invalid BAD_FILES type."); } @@ -131,3 +142,36 @@ TEST_F(configTest, save_schema) { Config cfg; EXPECT_NO_THROW(cfg.save_schema("TestConfigSchema.schema.json")); } + +TEST_F(configTest, missing_default_keys) { + using namespace fourdst::config; + Config cfg; + EXPECT_NO_THROW(cfg.load(get_good_example_file())); +} + +TEST_F(configTest, missing_nondefault_keys) { + using namespace fourdst::config; + Config cfg; + EXPECT_THROW(cfg.load(get_bad_example_file(BAD_FILES::MISSING_NONDEFAULT_KEY)), exceptions::ConfigParseError); +} + +TEST_F(configTest, mutate_and_reset) { + using namespace fourdst::config; + Config cfg; + EXPECT_NO_THROW(cfg.load(get_good_example_file())); + + EXPECT_TRUE(cfg->physics.diffusion); + EXPECT_EQ(cfg.get_state(), ConfigState::LOADED_FROM_FILE); + EXPECT_NO_THROW( + cfg.mutate([](auto& data) { + data.physics.diffusion = false; + }); + ); + EXPECT_FALSE(cfg->physics.diffusion); + EXPECT_EQ(cfg.get_state(), ConfigState::MODIFIED); + + EXPECT_NO_THROW(cfg.reset()); + EXPECT_TRUE(cfg->physics.diffusion); + EXPECT_EQ(cfg.get_state(), ConfigState::LOADED_FROM_FILE); + +} \ No newline at end of file diff --git a/tests/config/example_config_files/example.good.missing.field.toml b/tests/config/example_config_files/example.good.missing.field.toml new file mode 100644 index 0000000..589aee0 --- /dev/null +++ b/tests/config/example_config_files/example.good.missing.field.toml @@ -0,0 +1,16 @@ +[main] +description = "This is an example configuration file." +author = "Example Author" + +[main.physics] +diffusion = true +convection = false +radiation = true +flags = [1, 0, 1] + +[main.simulation] +output_frequency = 10 + +[main.output] +format = "csv" +directory = "results/" diff --git a/tests/config/example_config_files/example.missing.nondefault.field.toml b/tests/config/example_config_files/example.missing.nondefault.field.toml new file mode 100644 index 0000000..e6eb02a --- /dev/null +++ b/tests/config/example_config_files/example.missing.nondefault.field.toml @@ -0,0 +1,15 @@ +[main] +description = "This is an example configuration file." +author = "Example Author" + +[main.physics] +flags = [1, 0, 1] + +[main.simulation] +time_step = 0.01 +total_time = 100.0 +output_frequency = 10 + +[main.output] +format = "csv" +directory = "results/" diff --git a/tests/config/test_schema.h b/tests/config/test_schema.h index 472300c..8e6f27c 100644 --- a/tests/config/test_schema.h +++ b/tests/config/test_schema.h @@ -4,8 +4,8 @@ struct PhysicsConfigOptions { bool diffusion; - bool convection; - bool radiation; + std::optional convection; + std::optional radiation; std::array flags; }; @@ -18,7 +18,7 @@ struct SimulationConfigOptions { struct OutputConfigOptions { std::string directory = "./output"; std::string format = "hdf5"; - bool save_plots = false; + std::optional save_plots = false; }; struct TestConfigSchema { @@ -28,4 +28,4 @@ struct TestConfigSchema { PhysicsConfigOptions physics; SimulationConfigOptions simulation; OutputConfigOptions output; -}; \ No newline at end of file +}; From 65aa39048fdb93bcad2ce80efb2cedf1eac96890 Mon Sep 17 00:00:00 2001 From: Emily Boudreaux Date: Tue, 7 Apr 2026 09:28:58 -0400 Subject: [PATCH 2/2] docs(docs): rebuilt --- Doxyfile | 2 +- docs/html/_logo_8png.html | 2 +- docs/html/annotated.html | 26 +- docs/html/annotated_dup.js | 14 + docs/html/base_8h.html | 7 +- docs/html/base_8h.js | 3 +- docs/html/base_8h__incl.map | 80 ++- docs/html/base_8h__incl.md5 | 2 +- docs/html/base_8h__incl.svg | 422 +++++++++++--- docs/html/base_8h__incl_org.svg | 422 +++++++++++--- docs/html/classes.html | 21 +- ...sfourdst_1_1config_1_1_config-members.html | 14 +- .../classfourdst_1_1config_1_1_config.html | 145 ++++- .../html/classfourdst_1_1config_1_1_config.js | 6 +- ...rdst_1_1config_1_1_config__coll__graph.map | 16 +- ...rdst_1_1config_1_1_config__coll__graph.md5 | 2 +- ...rdst_1_1config_1_1_config__coll__graph.svg | 70 ++- ..._1_1config_1_1_config__coll__graph_org.svg | 70 ++- ..._1exceptions_1_1_config_error-members.html | 2 +- ...config_1_1exceptions_1_1_config_error.html | 2 +- ...eptions_1_1_config_load_error-members.html | 2 +- ...g_1_1exceptions_1_1_config_load_error.html | 2 +- ...ptions_1_1_config_parse_error-members.html | 2 +- ..._1_1exceptions_1_1_config_parse_error.html | 2 +- ...eptions_1_1_config_save_error-members.html | 2 +- ...g_1_1exceptions_1_1_config_save_error.html | 2 +- ...eptions_1_1_schema_save_error-members.html | 2 +- ...g_1_1exceptions_1_1_schema_save_error.html | 2 +- docs/html/cli_8h.html | 4 +- docs/html/cli_8h__incl.map | 88 ++- docs/html/cli_8h__incl.md5 | 2 +- docs/html/cli_8h__incl.svg | 446 +++++++++++---- docs/html/cli_8h__incl_org.svg | 446 +++++++++++---- ...eptfourdst_1_1config_1_1_is_c_l_i_app.html | 2 +- ...ourdst_1_1config_1_1_is_config_schema.html | 4 +- docs/html/concepts.html | 2 +- docs/html/config_8h.html | 14 +- docs/html/config_8h__incl.map | 96 ++-- docs/html/config_8h__incl.md5 | 2 +- docs/html/config_8h__incl.svg | 514 +++++++++++++----- docs/html/config_8h__incl_org.svg | 514 +++++++++++++----- docs/html/dir_000001_000003.html | 2 +- .../dir_2c16a3647d2e0836781345a6734d56f4.html | 2 +- .../dir_49e56c817e5e54854c35e136979f97ca.html | 2 +- .../dir_4b2c286be604226a61b42b7694f18b88.html | 2 +- .../dir_68267d1309a1af8e8297ef4c3efbcdba.html | 2 +- .../dir_7e83d1792d529f4aa7126ac7e0b3b699.html | 2 +- .../dir_904591e9279cabe43293bc1a827ea462.html | 2 +- .../dir_c34d5e8363cf0aa3fabc4f3fad3412a4.html | 2 +- .../dir_db2a2ef06a7c8abde1f4700fa96ffaaa.html | 6 +- .../dir_db2a2ef06a7c8abde1f4700fa96ffaaa.js | 4 +- docs/html/doxygen_crawl.html | 58 +- docs/html/exceptions_8h.html | 2 +- docs/html/files.html | 10 +- docs/html/functions.html | 73 ++- docs/html/functions_func.html | 59 +- docs/html/functions_vars.html | 7 +- docs/html/graph_legend.html | 2 +- docs/html/hierarchy.html | 46 +- docs/html/hierarchy.js | 22 +- docs/html/index.html | 45 +- docs/html/inherit_graph_2.map | 12 +- docs/html/inherit_graph_2.md5 | 2 +- docs/html/inherit_graph_2.svg | 110 +--- docs/html/inherit_graph_3.map | 8 +- docs/html/inherit_graph_3.md5 | 2 +- docs/html/inherit_graph_3.svg | 72 +-- docs/html/inherit_graph_4.map | 2 +- docs/html/inherit_graph_4.md5 | 2 +- docs/html/inherit_graph_4.svg | 19 +- docs/html/inherits.html | 13 +- docs/html/mainpage_8md.html | 2 +- docs/html/menudata.js | 39 +- docs/html/namespacefourdst.html | 2 +- docs/html/namespacefourdst_1_1config.html | 10 +- docs/html/namespacefourdst_1_1config.js | 5 +- ...espacefourdst_1_1config_1_1exceptions.html | 2 +- docs/html/namespacemembers.html | 16 +- docs/html/namespacemembers_enum.html | 2 +- docs/html/namespacemembers_func.html | 5 +- docs/html/namespaces.html | 4 +- docs/html/navtreedata.js | 10 +- docs/html/navtreeindex0.js | 203 ++++--- docs/html/search/all_0.js | 5 +- docs/html/search/all_1.js | 13 +- docs/html/search/all_10.js | 6 +- docs/html/search/all_2.js | 18 +- docs/html/search/all_3.js | 5 +- docs/html/search/all_4.js | 9 +- docs/html/search/all_5.js | 13 +- docs/html/search/all_6.js | 11 +- docs/html/search/all_7.js | 21 +- docs/html/search/all_8.js | 5 +- docs/html/search/all_9.js | 11 +- docs/html/search/all_a.js | 16 +- docs/html/search/all_b.js | 2 +- docs/html/search/all_c.js | 5 +- docs/html/search/all_d.js | 7 +- docs/html/search/all_e.js | 7 +- docs/html/search/all_f.js | 7 +- docs/html/search/classes_0.js | 6 +- docs/html/search/classes_1.js | 7 +- docs/html/search/classes_2.js | 4 +- docs/html/search/classes_3.js | 11 +- docs/html/search/files_0.js | 2 +- docs/html/search/files_1.js | 3 +- docs/html/search/files_2.js | 3 +- docs/html/search/files_3.js | 2 +- docs/html/search/files_4.js | 2 +- docs/html/search/functions_0.js | 3 +- docs/html/search/functions_1.js | 7 +- docs/html/search/functions_2.js | 3 +- docs/html/search/functions_3.js | 4 +- docs/html/search/functions_4.js | 5 +- docs/html/search/functions_5.js | 2 +- docs/html/search/functions_6.js | 4 +- docs/html/search/functions_7.js | 3 +- docs/html/search/functions_8.js | 3 +- docs/html/search/functions_9.js | 7 +- docs/html/search/functions_a.js | 7 +- docs/html/search/namespaces_0.js | 4 +- docs/html/search/searchdata.js | 40 +- docs/html/search/variables_0.js | 6 +- ...uctfourdst_1_1config_1_1_inspect_type.html | 2 +- ...rdst_1_1config_1_1is__config__wrapper.html | 2 +- ..._wrapper_3_01_config_3_01_t_01_4_01_4.html | 2 +- ...3_01_t_01_4_00_01_char_t_01_4-members.html | 2 +- ..._config_3_01_t_01_4_00_01_char_t_01_4.html | 2 +- docs/static/mainpage.md | 28 + examples/cli_example.cpp | 2 +- 130 files changed, 3420 insertions(+), 1289 deletions(-) diff --git a/Doxyfile b/Doxyfile index 25b207c..10d8fdd 100644 --- a/Doxyfile +++ b/Doxyfile @@ -48,7 +48,7 @@ PROJECT_NAME = libconfig # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = v2.1.0 +PROJECT_NUMBER = v2.2.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewers a diff --git a/docs/html/_logo_8png.html b/docs/html/_logo_8png.html index a7e6176..96f1968 100644 --- a/docs/html/_logo_8png.html +++ b/docs/html/_logo_8png.html @@ -31,7 +31,7 @@ Logo -
libconfig v2.1.0 +
libconfig v2.2.0
Reflection based C++ configuration library
diff --git a/docs/html/annotated.html b/docs/html/annotated.html index 8b8d80b..9749b29 100644 --- a/docs/html/annotated.html +++ b/docs/html/annotated.html @@ -31,7 +31,7 @@ Logo -
libconfig v2.1.0 +
libconfig v2.2.0
Reflection based C++ configuration library
@@ -105,7 +105,7 @@ $(function(){initNavTree('annotated.html',''); initResizable(true); });
Here are the classes, structs, unions and interfaces with brief descriptions:
-
[detail level 1234]
+
[detail level 12345]
@@ -114,10 +114,24 @@ $(function(){initNavTree('annotated.html',''); initResizable(true); }); - - - - + + + + + + + + + + + + + + + + + +
 Nfourdst
 Nconfig
 Nexceptions
 CConfigParseErrorThrown when parsing the configuration file fails
 CConfigSaveErrorThrown when saving the configuration to a file fails
 CSchemaSaveErrorThrown when generating or saving the JSON schema fails
 CConfigWrapper class for managing strongly-typed configuration structures
 CInspectType
 Cis_config_wrapperType trait to determine if a type is a Config wrapper
 Cis_config_wrapper< Config< T > >Specialization of is_config_wrapper for Config<T>
 Nutils
 CANSIColor
 Nvalidate
 CConfigValidator
 CTupleChecker
 CTupleChecker< rfl::NamedTuple< Fields... > >
 Cis_map_impl
 Cis_map_impl< std::map< K, V, C, A > >
 Cis_map_impl< std::unordered_map< K, V, H, E, A > >
 Cis_optional_impl
 Cis_optional_impl< std::optional< T > >
 Cis_vector_impl
 Cis_vector_impl< std::vector< T, A > >
 CMissingFieldTree
 CConfigWrapper class for managing strongly-typed configuration structures
 CInspectType
 Cis_config_wrapperType trait to determine if a type is a Config wrapper
 Cis_config_wrapper< Config< T > >Specialization of is_config_wrapper for Config<T>
 NstdSTL namespace
 Cformatter< fourdst::config::Config< T >, CharT >Formatter specialization for Config<T> to allow easy printing
diff --git a/docs/html/annotated_dup.js b/docs/html/annotated_dup.js index dfa23c2..205d1a3 100644 --- a/docs/html/annotated_dup.js +++ b/docs/html/annotated_dup.js @@ -9,6 +9,20 @@ var annotated_dup = [ "ConfigSaveError", "classfourdst_1_1config_1_1exceptions_1_1_config_save_error.html", "classfourdst_1_1config_1_1exceptions_1_1_config_save_error" ], [ "SchemaSaveError", "classfourdst_1_1config_1_1exceptions_1_1_schema_save_error.html", "classfourdst_1_1config_1_1exceptions_1_1_schema_save_error" ] ] ], + [ "utils", "namespacefourdst_1_1config_1_1utils.html", [ + [ "ANSIColor", "classfourdst_1_1config_1_1utils_1_1_a_n_s_i_color.html", "classfourdst_1_1config_1_1utils_1_1_a_n_s_i_color" ] + ] ], + [ "validate", "namespacefourdst_1_1config_1_1validate.html", [ + [ "ConfigValidator", "structfourdst_1_1config_1_1validate_1_1_config_validator.html", "structfourdst_1_1config_1_1validate_1_1_config_validator" ], + [ "is_map_impl", "structfourdst_1_1config_1_1validate_1_1is__map__impl.html", null ], + [ "is_map_impl< std::map< K, V, C, A > >", "structfourdst_1_1config_1_1validate_1_1is__map__impl_3_01std_1_1map_3_01_k_00_01_v_00_01_c_00_01_a_01_4_01_4.html", null ], + [ "is_map_impl< std::unordered_map< K, V, H, E, A > >", "structfourdst_1_1config_1_1validate_1_1is__map__impl_3_01std_1_1unordered__map_3_01_k_00_01_v_00_01_h_00_01_e_00_01_a_01_4_01_4.html", null ], + [ "is_optional_impl", "structfourdst_1_1config_1_1validate_1_1is__optional__impl.html", null ], + [ "is_optional_impl< std::optional< T > >", "structfourdst_1_1config_1_1validate_1_1is__optional__impl_3_01std_1_1optional_3_01_t_01_4_01_4.html", null ], + [ "is_vector_impl", "structfourdst_1_1config_1_1validate_1_1is__vector__impl.html", null ], + [ "is_vector_impl< std::vector< T, A > >", "structfourdst_1_1config_1_1validate_1_1is__vector__impl_3_01std_1_1vector_3_01_t_00_01_a_01_4_01_4.html", null ], + [ "MissingFieldTree", "structfourdst_1_1config_1_1validate_1_1_missing_field_tree.html", "structfourdst_1_1config_1_1validate_1_1_missing_field_tree" ] + ] ], [ "Config", "classfourdst_1_1config_1_1_config.html", "classfourdst_1_1config_1_1_config" ], [ "InspectType", "structfourdst_1_1config_1_1_inspect_type.html", null ], [ "is_config_wrapper", "structfourdst_1_1config_1_1is__config__wrapper.html", null ], diff --git a/docs/html/base_8h.html b/docs/html/base_8h.html index f94743f..ec539f2 100644 --- a/docs/html/base_8h.html +++ b/docs/html/base_8h.html @@ -31,7 +31,7 @@ Logo -
libconfig v2.1.0 +
libconfig v2.2.0
Reflection based C++ configuration library
@@ -119,14 +119,16 @@ $(function(){initNavTree('base_8h.html',''); initResizable(true); }); #include <vector>
#include <string_view>
#include <type_traits>
+#include <mutex>
#include "fourdst/config/exceptions/exceptions.h"
+#include "fourdst/config/validate.h"
#include "rfl.hpp"
#include "rfl/toml.hpp"
#include "rfl/json.hpp"
Include dependency graph for base.h:
-
+
This graph shows which files directly or indirectly include this file:
@@ -165,6 +167,7 @@ Enumerations   enum class  fourdst::config::ConfigState { fourdst::config::DEFAULT , fourdst::config::LOADED_FROM_FILE +, fourdst::config::MODIFIED }  Represents the current state of a Config object. More...
  diff --git a/docs/html/base_8h.js b/docs/html/base_8h.js index 399d08f..a6511ad 100644 --- a/docs/html/base_8h.js +++ b/docs/html/base_8h.js @@ -5,7 +5,8 @@ var base_8h = [ "fourdst::config::IsConfigSchema", "conceptfourdst_1_1config_1_1_is_config_schema.html", null ], [ "fourdst::config::ConfigState", "namespacefourdst_1_1config.html#a18da8b2ec98ddd0a28e61644ce795b7e", [ [ "fourdst::config::ConfigState::DEFAULT", "namespacefourdst_1_1config.html#a18da8b2ec98ddd0a28e61644ce795b7ea5b39c8b553c821e7cddc6da64b5bd2ee", null ], - [ "fourdst::config::ConfigState::LOADED_FROM_FILE", "namespacefourdst_1_1config.html#a18da8b2ec98ddd0a28e61644ce795b7eac24435b28cc6d977d5d7804236dca3db", null ] + [ "fourdst::config::ConfigState::LOADED_FROM_FILE", "namespacefourdst_1_1config.html#a18da8b2ec98ddd0a28e61644ce795b7eac24435b28cc6d977d5d7804236dca3db", null ], + [ "fourdst::config::ConfigState::MODIFIED", "namespacefourdst_1_1config.html#a18da8b2ec98ddd0a28e61644ce795b7ea40e3819215b52841e19a7cac06b5f065", null ] ] ], [ "fourdst::config::RootNameLoadPolicy", "namespacefourdst_1_1config.html#a9870cefcd568dac301257ca35b73ab14", [ [ "fourdst::config::RootNameLoadPolicy::FROM_FILE", "namespacefourdst_1_1config.html#a9870cefcd568dac301257ca35b73ab14a0d7d491492131155ecdbcd14f592a729", null ], diff --git a/docs/html/base_8h__incl.map b/docs/html/base_8h__incl.map index 47a7735..395af46 100644 --- a/docs/html/base_8h__incl.map +++ b/docs/html/base_8h__incl.map @@ -1,28 +1,56 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/html/base_8h__incl.md5 b/docs/html/base_8h__incl.md5 index e07a65a..7a54ce7 100644 --- a/docs/html/base_8h__incl.md5 +++ b/docs/html/base_8h__incl.md5 @@ -1 +1 @@ -0726498beabe8e14e23e93b8e4505bb3 \ No newline at end of file +09cef44d093f39047c9971ec43768d2a \ No newline at end of file diff --git a/docs/html/base_8h__incl.svg b/docs/html/base_8h__incl.svg index 9f4890a..ffc02ee 100644 --- a/docs/html/base_8h__incl.svg +++ b/docs/html/base_8h__incl.svg @@ -1,10 +1,10 @@ - - + @@ -47,8 +47,8 @@ @@ -59,9 +59,9 @@ var sectionId = 'dynsection-0'; Node1 - -src/config/include -/fourdst/config/base.h + +src/config/include +/fourdst/config/base.h @@ -69,8 +69,8 @@ var sectionId = 'dynsection-0'; Node2 - -filesystem + +filesystem @@ -78,8 +78,8 @@ var sectionId = 'dynsection-0'; Node1->Node2 - - + + @@ -87,8 +87,8 @@ var sectionId = 'dynsection-0'; Node3 - -string + +string @@ -96,8 +96,8 @@ var sectionId = 'dynsection-0'; Node1->Node3 - - + + @@ -105,8 +105,8 @@ var sectionId = 'dynsection-0'; Node4 - -map + +map @@ -114,8 +114,8 @@ var sectionId = 'dynsection-0'; Node1->Node4 - - + + @@ -123,8 +123,8 @@ var sectionId = 'dynsection-0'; Node5 - -format + +format @@ -132,8 +132,8 @@ var sectionId = 'dynsection-0'; Node1->Node5 - - + + @@ -141,8 +141,8 @@ var sectionId = 'dynsection-0'; Node6 - -vector + +vector @@ -150,8 +150,8 @@ var sectionId = 'dynsection-0'; Node1->Node6 - - + + @@ -159,8 +159,8 @@ var sectionId = 'dynsection-0'; Node7 - -string_view + +string_view @@ -168,8 +168,8 @@ var sectionId = 'dynsection-0'; Node1->Node7 - - + + @@ -177,8 +177,8 @@ var sectionId = 'dynsection-0'; Node8 - -type_traits + +type_traits @@ -186,18 +186,17 @@ var sectionId = 'dynsection-0'; Node1->Node8 - - + + Node9 - - -fourdst/config/exceptions -/exceptions.h + + +mutex @@ -205,35 +204,36 @@ var sectionId = 'dynsection-0'; Node1->Node9 - - + + - - -Node11 - - -rfl.hpp + + +Node10 + + +fourdst/config/exceptions +/exceptions.h - - -Node1->Node11 - - - + + +Node1->Node10 + + + Node12 - - -rfl/toml.hpp + + +fourdst/config/validate.h @@ -241,53 +241,305 @@ var sectionId = 'dynsection-0'; Node1->Node12 - - + + + + + + + +Node16 + + +rfl.hpp + + + + + +Node1->Node16 + + + + + + + + +Node22 + + +rfl/toml.hpp + + + + + +Node1->Node22 + + + + + + + + +Node23 + + +rfl/json.hpp + + + + + +Node1->Node23 + + + + + + + + +Node10->Node3 + + + + + + + + +Node11 + + +stdexcept + + + + + +Node10->Node11 + + + + + + + + +Node12->Node3 + + + + + + + + +Node12->Node4 + + + + + + + + +Node12->Node5 + + + + + + + + +Node12->Node6 + + + + + + + + +Node12->Node7 + + + + + + + + +Node12->Node8 + + + Node13 - - -rfl/json.hpp + + +fourdst/config/ansi.h - - -Node1->Node13 - - - + + +Node12->Node13 + + + - - -Node9->Node3 - - - + + +Node12->Node16 + + + - - -Node10 - - -stdexcept + + +Node17 + + +toml++/toml.h - - -Node9->Node10 - - - + + +Node12->Node17 + + + + + + + + +Node18 + + +iostream + + + + + +Node12->Node18 + + + + + + + + +Node19 + + +optional + + + + + +Node12->Node19 + + + + + + + + +Node20 + + +unordered_map + + + + + +Node12->Node20 + + + + + + + + +Node21 + + +sstream + + + + + +Node12->Node21 + + + + + + + + +Node13->Node3 + + + + + + + + +Node14 + + +cstdlib + + + + + +Node13->Node14 + + + + + + + + +Node15 + + +unistd.h + + + + + +Node13->Node15 + + + diff --git a/docs/html/base_8h__incl_org.svg b/docs/html/base_8h__incl_org.svg index 9fcf06f..4f6be73 100644 --- a/docs/html/base_8h__incl_org.svg +++ b/docs/html/base_8h__incl_org.svg @@ -1,20 +1,20 @@ - - - + + src/config/include/fourdst/config/base.h Node1 - -src/config/include -/fourdst/config/base.h + +src/config/include +/fourdst/config/base.h @@ -22,8 +22,8 @@ Node2 - -filesystem + +filesystem @@ -31,8 +31,8 @@ Node1->Node2 - - + + @@ -40,8 +40,8 @@ Node3 - -string + +string @@ -49,8 +49,8 @@ Node1->Node3 - - + + @@ -58,8 +58,8 @@ Node4 - -map + +map @@ -67,8 +67,8 @@ Node1->Node4 - - + + @@ -76,8 +76,8 @@ Node5 - -format + +format @@ -85,8 +85,8 @@ Node1->Node5 - - + + @@ -94,8 +94,8 @@ Node6 - -vector + +vector @@ -103,8 +103,8 @@ Node1->Node6 - - + + @@ -112,8 +112,8 @@ Node7 - -string_view + +string_view @@ -121,8 +121,8 @@ Node1->Node7 - - + + @@ -130,8 +130,8 @@ Node8 - -type_traits + +type_traits @@ -139,18 +139,17 @@ Node1->Node8 - - + + Node9 - - -fourdst/config/exceptions -/exceptions.h + + +mutex @@ -158,35 +157,36 @@ Node1->Node9 - - + + - - -Node11 - - -rfl.hpp + + +Node10 + + +fourdst/config/exceptions +/exceptions.h - - -Node1->Node11 - - - + + +Node1->Node10 + + + Node12 - - -rfl/toml.hpp + + +fourdst/config/validate.h @@ -194,53 +194,305 @@ Node1->Node12 - - + + + + + + + +Node16 + + +rfl.hpp + + + + + +Node1->Node16 + + + + + + + + +Node22 + + +rfl/toml.hpp + + + + + +Node1->Node22 + + + + + + + + +Node23 + + +rfl/json.hpp + + + + + +Node1->Node23 + + + + + + + + +Node10->Node3 + + + + + + + + +Node11 + + +stdexcept + + + + + +Node10->Node11 + + + + + + + + +Node12->Node3 + + + + + + + + +Node12->Node4 + + + + + + + + +Node12->Node5 + + + + + + + + +Node12->Node6 + + + + + + + + +Node12->Node7 + + + + + + + + +Node12->Node8 + + + Node13 - - -rfl/json.hpp + + +fourdst/config/ansi.h - - -Node1->Node13 - - - + + +Node12->Node13 + + + - - -Node9->Node3 - - - + + +Node12->Node16 + + + - - -Node10 - - -stdexcept + + +Node17 + + +toml++/toml.h - - -Node9->Node10 - - - + + +Node12->Node17 + + + + + + + + +Node18 + + +iostream + + + + + +Node12->Node18 + + + + + + + + +Node19 + + +optional + + + + + +Node12->Node19 + + + + + + + + +Node20 + + +unordered_map + + + + + +Node12->Node20 + + + + + + + + +Node21 + + +sstream + + + + + +Node12->Node21 + + + + + + + + +Node13->Node3 + + + + + + + + +Node14 + + +cstdlib + + + + + +Node13->Node14 + + + + + + + + +Node15 + + +unistd.h + + + + + +Node13->Node15 + + + diff --git a/docs/html/classes.html b/docs/html/classes.html index 5994481..ab83e7b 100644 --- a/docs/html/classes.html +++ b/docs/html/classes.html @@ -31,7 +31,7 @@
Logo -
libconfig v2.1.0 +
libconfig v2.2.0
Reflection based C++ configuration library
@@ -104,20 +104,29 @@ $(function(){initNavTree('classes.html',''); initResizable(true); });
Class Index
-
C | F | I | S
+
A | C | F | I | M | S | T
diff --git a/docs/html/classfourdst_1_1config_1_1_config-members.html b/docs/html/classfourdst_1_1config_1_1_config-members.html index 6c2ea34..60d7878 100644 --- a/docs/html/classfourdst_1_1config_1_1_config-members.html +++ b/docs/html/classfourdst_1_1config_1_1_config-members.html @@ -31,7 +31,7 @@ Logo -
libconfig v2.1.0 +
libconfig v2.2.0
Reflection based C++ configuration library
@@ -113,15 +113,19 @@ $(function(){initNavTree('classfourdst_1_1config_1_1_config.html',''); initResiz get_root_name() constfourdst::config::Config< T >inline get_root_name_load_policy() constfourdst::config::Config< T >inline get_state() constfourdst::config::Config< T >inline - load(const std::string_view path)fourdst::config::Config< T >inline + load(const std::string_view path, const bool verbose=false)fourdst::config::Config< T >inline m_contentfourdst::config::Config< T >private + m_content_mutexfourdst::config::Config< T >private + m_content_origfourdst::config::Config< T >private m_root_namefourdst::config::Config< T >private m_root_name_load_policyfourdst::config::Config< T >private m_statefourdst::config::Config< T >private main() constfourdst::config::Config< T >inline - operator*()fourdst::config::Config< T >inline - operator*() constfourdst::config::Config< T >inline - operator->() constfourdst::config::Config< T >inline + mutate(MutatorFunc &&mutator)fourdst::config::Config< T >inline + operator*()fourdst::config::Config< T >inline + operator*() constfourdst::config::Config< T >inline + operator->() constfourdst::config::Config< T >inline + reset()fourdst::config::Config< T >inline save(std::string_view path) constfourdst::config::Config< T >inline save_schema(const std::string &path)fourdst::config::Config< T >inlinestatic set_root_name(const std::string_view name)fourdst::config::Config< T >inline diff --git a/docs/html/classfourdst_1_1config_1_1_config.html b/docs/html/classfourdst_1_1config_1_1_config.html index b1041c4..548dc82 100644 --- a/docs/html/classfourdst_1_1config_1_1_config.html +++ b/docs/html/classfourdst_1_1config_1_1_config.html @@ -31,7 +31,7 @@ Logo -
libconfig v2.1.0 +
libconfig v2.2.0
Reflection based C++ configuration library
@@ -117,7 +117,7 @@ $(function(){initNavTree('classfourdst_1_1config_1_1_config.html',''); initResiz
Collaboration diagram for fourdst::config::Config< T >:
-
+
[legend]
- - - + + + + + + + +

@@ -158,15 +158,20 @@ Public Member Functions

std::string describe_root_name_load_policy () const
 Returns a string description of the current root name load policy.
 
void load (const std::string_view path)
 Loads configuration from a TOML file.
 
void load (const std::string_view path, const bool verbose=false)
 Loads configuration from a TOML file.
 
ConfigState get_state () const
 Gets the current state of the configuration object.
 
std::string describe_state () const
 Returns a string description of the current configuration state.
 
template<typename MutatorFunc>
void mutate (MutatorFunc &&mutator)
 
void reset ()
 
@@ -178,6 +183,10 @@ Static Public Member Functions Private Attributes + + + + @@ -213,18 +222,18 @@ class fourdst::config::Config< T >

Wrapper class for managing stro

cfg.save("settings.toml");
// Load from file
-
cfg.load("settings.toml");
+
cfg.load("settings.toml");
// Save JSON Schema for editors
cfg.save_schema("schema.json");
return 0;
}
-
Wrapper class for managing strongly-typed configuration structures.
Definition base.h:113
-
const T & main() const
Explicit accessor for the main configuration content.
Definition base.h:148
-
void save(std::string_view path) const
Saves the current configuration to a TOML file.
Definition base.h:164
-
void load(const std::string_view path)
Loads configuration from a TOML file.
Definition base.h:249
-
static void save_schema(const std::string &path)
Generates and saves a JSON schema for the configuration structure.
Definition base.h:300
+
Wrapper class for managing strongly-typed configuration structures.
Definition base.h:117
+
const T & main() const
Explicit accessor for the main configuration content.
Definition base.h:152
+
void load(const std::string_view path, const bool verbose=false)
Loads configuration from a TOML file.
Definition base.h:253
+
void save(std::string_view path) const
Saves the current configuration to a TOML file.
Definition base.h:168
+
static void save_schema(const std::string &path)
Generates and saves a JSON schema for the configuration structure.
Definition base.h:328
Main entry point for the fourdst::config library.

Constructor & Destructor Documentation

@@ -408,8 +417,8 @@ template<IsConfigSchema T> - -

◆ load()

+ +

◆ load()

@@ -422,8 +431,12 @@ template<IsConfigSchema T>
- + + + + +

Static Public Member Functions

m_content
 
m_content_orig
 
std::mutex m_content_mutex
 
std::string m_root_name = "main"
 
ConfigState m_state = ConfigState::DEFAULT
void fourdst::config::Config< T >::load (const std::string_view path)const std::string_view path,
const bool verbose = false )
@@ -487,6 +500,35 @@ template<IsConfigSchema T>

Explicit accessor for the main configuration content.

Returns
Reference to the constant configuration content.
+
+
+ +

◆ mutate()

+ +
+
+
+template<IsConfigSchema T>
+
+template<typename MutatorFunc>
+ + + + + +
+ + + + + + + +
void fourdst::config::Config< T >::mutate (MutatorFunc && mutator)
+
+inline
+
+
@@ -577,6 +619,33 @@ template<IsConfigSchema T>

Access member of the underlying configuration struct.

Returns
Pointer to the constant configuration content.
+
+ + +

◆ reset()

+ +
+
+
+template<IsConfigSchema T>
+ + + + + +
+ + + + + + + +
void fourdst::config::Config< T >::reset ()
+
+inline
+
+
@@ -791,6 +860,54 @@ template<IsConfigSchema T>
+
+ + +

◆ m_content_mutex

+ +
+
+
+template<IsConfigSchema T>
+ + + + + +
+ + + + +
std::mutex fourdst::config::Config< T >::m_content_mutex
+
+private
+
+ +
+
+ +

◆ m_content_orig

+ +
+
+
+template<IsConfigSchema T>
+ + + + + +
+ + + + +
T fourdst::config::Config< T >::m_content_orig
+
+private
+
+
diff --git a/docs/html/classfourdst_1_1config_1_1_config.js b/docs/html/classfourdst_1_1config_1_1_config.js index 1f4646c..1d8b010 100644 --- a/docs/html/classfourdst_1_1config_1_1_config.js +++ b/docs/html/classfourdst_1_1config_1_1_config.js @@ -6,17 +6,21 @@ var classfourdst_1_1config_1_1_config = [ "get_root_name", "classfourdst_1_1config_1_1_config.html#af2cd9ccc1d066a4e9d5bf9e82e61961d", null ], [ "get_root_name_load_policy", "classfourdst_1_1config_1_1_config.html#a17b045d5646e982572abf87ce881895d", null ], [ "get_state", "classfourdst_1_1config_1_1_config.html#a531023140279187dc4bf4720ad64a75a", null ], - [ "load", "classfourdst_1_1config_1_1_config.html#ae0097a0c728ad24a5d03f9a8580eac74", null ], + [ "load", "classfourdst_1_1config_1_1_config.html#a6d51abcf7ab58a3e7a696817871916e9", null ], [ "main", "classfourdst_1_1config_1_1_config.html#a4715e05dc32076789462266e4b571dc0", null ], + [ "mutate", "classfourdst_1_1config_1_1_config.html#acf39608ffb91ee1dc058fcf42fedfb5f", null ], [ "operator*", "classfourdst_1_1config_1_1_config.html#a4d143396a1165ee7fcdc00eb116ec31e", null ], [ "operator*", "classfourdst_1_1config_1_1_config.html#a4c316b0026d41e731b03ac9f7bfb24fe", null ], [ "operator->", "classfourdst_1_1config_1_1_config.html#ac51cd4e8354046ac42631b4b8b83d853", null ], + [ "reset", "classfourdst_1_1config_1_1_config.html#a8f0ae5e8f5ebff21c94ed40986f8802f", null ], [ "save", "classfourdst_1_1config_1_1_config.html#a91fa54016e231a8361142b51807f047d", null ], [ "save_schema", "classfourdst_1_1config_1_1_config.html#ae698328f4cf5b175bf113b0d8dbc7937", null ], [ "set_root_name", "classfourdst_1_1config_1_1_config.html#a65d0b3c0a7063f6f56f6cde4700ad312", null ], [ "set_root_name_load_policy", "classfourdst_1_1config_1_1_config.html#a2a106d63f18536ad950b325a0acd4a5f", null ], [ "write", "classfourdst_1_1config_1_1_config.html#a4549293d409139a0c732b0c2c956290d", null ], [ "m_content", "classfourdst_1_1config_1_1_config.html#a77b1d1992d65f58f33cb3c0f67c751b1", null ], + [ "m_content_mutex", "classfourdst_1_1config_1_1_config.html#a9e4c3f8fd24643d1af9bf08b197b4930", null ], + [ "m_content_orig", "classfourdst_1_1config_1_1_config.html#af9174a0225bcadc7a653d1742a40f163", null ], [ "m_root_name", "classfourdst_1_1config_1_1_config.html#a01fd433545e9fb6309e0aa24cf59b01c", null ], [ "m_root_name_load_policy", "classfourdst_1_1config_1_1_config.html#a3c2d0c8bf35817767089340036d18ebb", null ], [ "m_state", "classfourdst_1_1config_1_1_config.html#ae493f71623caf944ed8f078167941adf", null ] diff --git a/docs/html/classfourdst_1_1config_1_1_config__coll__graph.map b/docs/html/classfourdst_1_1config_1_1_config__coll__graph.map index d8b92ba..fa33139 100644 --- a/docs/html/classfourdst_1_1config_1_1_config__coll__graph.map +++ b/docs/html/classfourdst_1_1config_1_1_config__coll__graph.map @@ -1,9 +1,11 @@ - - - - - - - + + + + + + + + + diff --git a/docs/html/classfourdst_1_1config_1_1_config__coll__graph.md5 b/docs/html/classfourdst_1_1config_1_1_config__coll__graph.md5 index c6e98d2..c842ef1 100644 --- a/docs/html/classfourdst_1_1config_1_1_config__coll__graph.md5 +++ b/docs/html/classfourdst_1_1config_1_1_config__coll__graph.md5 @@ -1 +1 @@ -dd2b904061233f445904053cf3fe06c4 \ No newline at end of file +133b937822d7c0558c7c46148cd4514f \ No newline at end of file diff --git a/docs/html/classfourdst_1_1config_1_1_config__coll__graph.svg b/docs/html/classfourdst_1_1config_1_1_config__coll__graph.svg index 2f8b283..7409a40 100644 --- a/docs/html/classfourdst_1_1config_1_1_config__coll__graph.svg +++ b/docs/html/classfourdst_1_1config_1_1_config__coll__graph.svg @@ -1,11 +1,11 @@ - - + @@ -17,14 +17,14 @@ ]]> - + fourdst::config::Config< T > Node1 - -fourdst::config::Config< T > + +fourdst::config::Config< T > @@ -32,8 +32,8 @@ Node2 - -T + +T @@ -41,18 +41,19 @@ Node2->Node1 - - + + - m_content + m_content +m_content_orig Node3 - -std::string + +std::mutex @@ -60,28 +61,47 @@ Node3->Node1 - - + + - m_root_name + m_content_mutex Node4 - -std::basic_string< - Char > + +std::string - - -Node4->Node3 - - - + + +Node4->Node1 + + + + + + m_root_name + + + +Node5 + + +std::basic_string< + Char > + + + + + +Node5->Node4 + + + diff --git a/docs/html/classfourdst_1_1config_1_1_config__coll__graph_org.svg b/docs/html/classfourdst_1_1config_1_1_config__coll__graph_org.svg index e7b8d20..763c302 100644 --- a/docs/html/classfourdst_1_1config_1_1_config__coll__graph_org.svg +++ b/docs/html/classfourdst_1_1config_1_1_config__coll__graph_org.svg @@ -1,19 +1,19 @@ - - - + + fourdst::config::Config< T > Node1 - -fourdst::config::Config< T > + +fourdst::config::Config< T > @@ -21,8 +21,8 @@ Node2 - -T + +T @@ -30,18 +30,19 @@ Node2->Node1 - - + + - m_content + m_content +m_content_orig Node3 - -std::string + +std::mutex @@ -49,28 +50,47 @@ Node3->Node1 - - + + - m_root_name + m_content_mutex Node4 - -std::basic_string< - Char > + +std::string - - -Node4->Node3 - - - + + +Node4->Node1 + + + + + + m_root_name + + + +Node5 + + +std::basic_string< + Char > + + + + + +Node5->Node4 + + + diff --git a/docs/html/classfourdst_1_1config_1_1exceptions_1_1_config_error-members.html b/docs/html/classfourdst_1_1config_1_1exceptions_1_1_config_error-members.html index 5d8f7ac..d0af73b 100644 --- a/docs/html/classfourdst_1_1config_1_1exceptions_1_1_config_error-members.html +++ b/docs/html/classfourdst_1_1config_1_1exceptions_1_1_config_error-members.html @@ -31,7 +31,7 @@
Logo -
libconfig v2.1.0 +
libconfig v2.2.0
Reflection based C++ configuration library
diff --git a/docs/html/classfourdst_1_1config_1_1exceptions_1_1_config_error.html b/docs/html/classfourdst_1_1config_1_1exceptions_1_1_config_error.html index 4096ce2..294a59a 100644 --- a/docs/html/classfourdst_1_1config_1_1exceptions_1_1_config_error.html +++ b/docs/html/classfourdst_1_1config_1_1exceptions_1_1_config_error.html @@ -31,7 +31,7 @@ Logo -
libconfig v2.1.0 +
libconfig v2.2.0
Reflection based C++ configuration library
diff --git a/docs/html/classfourdst_1_1config_1_1exceptions_1_1_config_load_error-members.html b/docs/html/classfourdst_1_1config_1_1exceptions_1_1_config_load_error-members.html index 26e940e..52efe1b 100644 --- a/docs/html/classfourdst_1_1config_1_1exceptions_1_1_config_load_error-members.html +++ b/docs/html/classfourdst_1_1config_1_1exceptions_1_1_config_load_error-members.html @@ -31,7 +31,7 @@ Logo -
libconfig v2.1.0 +
libconfig v2.2.0
Reflection based C++ configuration library
diff --git a/docs/html/classfourdst_1_1config_1_1exceptions_1_1_config_load_error.html b/docs/html/classfourdst_1_1config_1_1exceptions_1_1_config_load_error.html index df7e779..fd6a7f6 100644 --- a/docs/html/classfourdst_1_1config_1_1exceptions_1_1_config_load_error.html +++ b/docs/html/classfourdst_1_1config_1_1exceptions_1_1_config_load_error.html @@ -31,7 +31,7 @@ Logo -
libconfig v2.1.0 +
libconfig v2.2.0
Reflection based C++ configuration library
diff --git a/docs/html/classfourdst_1_1config_1_1exceptions_1_1_config_parse_error-members.html b/docs/html/classfourdst_1_1config_1_1exceptions_1_1_config_parse_error-members.html index 62d4c23..0adcc0e 100644 --- a/docs/html/classfourdst_1_1config_1_1exceptions_1_1_config_parse_error-members.html +++ b/docs/html/classfourdst_1_1config_1_1exceptions_1_1_config_parse_error-members.html @@ -31,7 +31,7 @@ Logo -
libconfig v2.1.0 +
libconfig v2.2.0
Reflection based C++ configuration library
diff --git a/docs/html/classfourdst_1_1config_1_1exceptions_1_1_config_parse_error.html b/docs/html/classfourdst_1_1config_1_1exceptions_1_1_config_parse_error.html index d0c145f..320e2b2 100644 --- a/docs/html/classfourdst_1_1config_1_1exceptions_1_1_config_parse_error.html +++ b/docs/html/classfourdst_1_1config_1_1exceptions_1_1_config_parse_error.html @@ -31,7 +31,7 @@ Logo -
libconfig v2.1.0 +
libconfig v2.2.0
Reflection based C++ configuration library
diff --git a/docs/html/classfourdst_1_1config_1_1exceptions_1_1_config_save_error-members.html b/docs/html/classfourdst_1_1config_1_1exceptions_1_1_config_save_error-members.html index 14790cb..8b42982 100644 --- a/docs/html/classfourdst_1_1config_1_1exceptions_1_1_config_save_error-members.html +++ b/docs/html/classfourdst_1_1config_1_1exceptions_1_1_config_save_error-members.html @@ -31,7 +31,7 @@ Logo -
libconfig v2.1.0 +
libconfig v2.2.0
Reflection based C++ configuration library
diff --git a/docs/html/classfourdst_1_1config_1_1exceptions_1_1_config_save_error.html b/docs/html/classfourdst_1_1config_1_1exceptions_1_1_config_save_error.html index 8e0297a..a5ac00d 100644 --- a/docs/html/classfourdst_1_1config_1_1exceptions_1_1_config_save_error.html +++ b/docs/html/classfourdst_1_1config_1_1exceptions_1_1_config_save_error.html @@ -31,7 +31,7 @@ Logo -
libconfig v2.1.0 +
libconfig v2.2.0
Reflection based C++ configuration library
diff --git a/docs/html/classfourdst_1_1config_1_1exceptions_1_1_schema_save_error-members.html b/docs/html/classfourdst_1_1config_1_1exceptions_1_1_schema_save_error-members.html index b2758de..8f802a8 100644 --- a/docs/html/classfourdst_1_1config_1_1exceptions_1_1_schema_save_error-members.html +++ b/docs/html/classfourdst_1_1config_1_1exceptions_1_1_schema_save_error-members.html @@ -31,7 +31,7 @@ Logo -
libconfig v2.1.0 +
libconfig v2.2.0
Reflection based C++ configuration library
diff --git a/docs/html/classfourdst_1_1config_1_1exceptions_1_1_schema_save_error.html b/docs/html/classfourdst_1_1config_1_1exceptions_1_1_schema_save_error.html index 535911f..037bedf 100644 --- a/docs/html/classfourdst_1_1config_1_1exceptions_1_1_schema_save_error.html +++ b/docs/html/classfourdst_1_1config_1_1exceptions_1_1_schema_save_error.html @@ -31,7 +31,7 @@ Logo -
libconfig v2.1.0 +
libconfig v2.2.0
Reflection based C++ configuration library
diff --git a/docs/html/cli_8h.html b/docs/html/cli_8h.html index 0ba7f80..9be7672 100644 --- a/docs/html/cli_8h.html +++ b/docs/html/cli_8h.html @@ -31,7 +31,7 @@ Logo -
libconfig v2.1.0 +
libconfig v2.2.0
Reflection based C++ configuration library
@@ -118,7 +118,7 @@ $(function(){initNavTree('cli_8h.html',''); initResizable(true); });
Include dependency graph for cli.h:
-
+
This graph shows which files directly or indirectly include this file:
diff --git a/docs/html/cli_8h__incl.map b/docs/html/cli_8h__incl.map index 23f0339..623da03 100644 --- a/docs/html/cli_8h__incl.map +++ b/docs/html/cli_8h__incl.map @@ -1,32 +1,60 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/html/cli_8h__incl.md5 b/docs/html/cli_8h__incl.md5 index 5ea9609..baf278c 100644 --- a/docs/html/cli_8h__incl.md5 +++ b/docs/html/cli_8h__incl.md5 @@ -1 +1 @@ -d6bebe30e2fd50da4a99155f952c3a89 \ No newline at end of file +fdfecae95400a265b8a2919ac2238bc2 \ No newline at end of file diff --git a/docs/html/cli_8h__incl.svg b/docs/html/cli_8h__incl.svg index a1be3e7..ae26849 100644 --- a/docs/html/cli_8h__incl.svg +++ b/docs/html/cli_8h__incl.svg @@ -1,10 +1,10 @@ - - + @@ -47,8 +47,8 @@ @@ -59,9 +59,9 @@ var sectionId = 'dynsection-0'; Node1 - -src/config/include -/fourdst/config/cli.h + +src/config/include +/fourdst/config/cli.h @@ -69,8 +69,8 @@ var sectionId = 'dynsection-0'; Node2 - -type_traits + +type_traits @@ -78,8 +78,8 @@ var sectionId = 'dynsection-0'; Node1->Node2 - - + + @@ -87,8 +87,8 @@ var sectionId = 'dynsection-0'; Node3 - -fourdst/config/base.h + +fourdst/config/base.h @@ -96,26 +96,26 @@ var sectionId = 'dynsection-0'; Node1->Node3 - - + + - - -Node12 - - -rfl.hpp + + +Node17 + + +rfl.hpp - - -Node1->Node12 - - - + + +Node1->Node17 + + + @@ -123,8 +123,8 @@ var sectionId = 'dynsection-0'; Node3->Node2 - - + + @@ -132,8 +132,8 @@ var sectionId = 'dynsection-0'; Node4 - -filesystem + +filesystem @@ -141,8 +141,8 @@ var sectionId = 'dynsection-0'; Node3->Node4 - - + + @@ -150,8 +150,8 @@ var sectionId = 'dynsection-0'; Node5 - -string + +string @@ -159,8 +159,8 @@ var sectionId = 'dynsection-0'; Node3->Node5 - - + + @@ -168,8 +168,8 @@ var sectionId = 'dynsection-0'; Node6 - -map + +map @@ -177,8 +177,8 @@ var sectionId = 'dynsection-0'; Node3->Node6 - - + + @@ -186,8 +186,8 @@ var sectionId = 'dynsection-0'; Node7 - -format + +format @@ -195,8 +195,8 @@ var sectionId = 'dynsection-0'; Node3->Node7 - - + + @@ -204,8 +204,8 @@ var sectionId = 'dynsection-0'; Node8 - -vector + +vector @@ -213,8 +213,8 @@ var sectionId = 'dynsection-0'; Node3->Node8 - - + + @@ -222,8 +222,8 @@ var sectionId = 'dynsection-0'; Node9 - -string_view + +string_view @@ -231,18 +231,17 @@ var sectionId = 'dynsection-0'; Node3->Node9 - - + + Node10 - - -fourdst/config/exceptions -/exceptions.h + + +mutex @@ -250,26 +249,36 @@ var sectionId = 'dynsection-0'; Node3->Node10 - - + + - - -Node3->Node12 - - - + + +Node11 + + +fourdst/config/exceptions +/exceptions.h + + + + + +Node3->Node11 + + + Node13 - - -rfl/toml.hpp + + +fourdst/config/validate.h @@ -277,53 +286,296 @@ var sectionId = 'dynsection-0'; Node3->Node13 - - + + + + + + + +Node3->Node17 + + + + + + + + +Node23 + + +rfl/toml.hpp + + + + + +Node3->Node23 + + + + + + + + +Node24 + + +rfl/json.hpp + + + + + +Node3->Node24 + + + + + + + + +Node11->Node5 + + + + + + + + +Node12 + + +stdexcept + + + + + +Node11->Node12 + + + + + + + + +Node13->Node2 + + + + + + + + +Node13->Node5 + + + + + + + + +Node13->Node6 + + + + + + + + +Node13->Node7 + + + + + + + + +Node13->Node8 + + + + + + + + +Node13->Node9 + + + Node14 - - -rfl/json.hpp + + +fourdst/config/ansi.h - - -Node3->Node14 - - - + + +Node13->Node14 + + + - - -Node10->Node5 - - - + + +Node13->Node17 + + + - - -Node11 - - -stdexcept + + +Node18 + + +toml++/toml.h - - -Node10->Node11 - - - + + +Node13->Node18 + + + + + + + + +Node19 + + +iostream + + + + + +Node13->Node19 + + + + + + + + +Node20 + + +optional + + + + + +Node13->Node20 + + + + + + + + +Node21 + + +unordered_map + + + + + +Node13->Node21 + + + + + + + + +Node22 + + +sstream + + + + + +Node13->Node22 + + + + + + + + +Node14->Node5 + + + + + + + + +Node15 + + +cstdlib + + + + + +Node14->Node15 + + + + + + + + +Node16 + + +unistd.h + + + + + +Node14->Node16 + + + diff --git a/docs/html/cli_8h__incl_org.svg b/docs/html/cli_8h__incl_org.svg index 90722f9..53fa3f1 100644 --- a/docs/html/cli_8h__incl_org.svg +++ b/docs/html/cli_8h__incl_org.svg @@ -1,20 +1,20 @@ - - - + + src/config/include/fourdst/config/cli.h Node1 - -src/config/include -/fourdst/config/cli.h + +src/config/include +/fourdst/config/cli.h @@ -22,8 +22,8 @@ Node2 - -type_traits + +type_traits @@ -31,8 +31,8 @@ Node1->Node2 - - + + @@ -40,8 +40,8 @@ Node3 - -fourdst/config/base.h + +fourdst/config/base.h @@ -49,26 +49,26 @@ Node1->Node3 - - + + - - -Node12 - - -rfl.hpp + + +Node17 + + +rfl.hpp - - -Node1->Node12 - - - + + +Node1->Node17 + + + @@ -76,8 +76,8 @@ Node3->Node2 - - + + @@ -85,8 +85,8 @@ Node4 - -filesystem + +filesystem @@ -94,8 +94,8 @@ Node3->Node4 - - + + @@ -103,8 +103,8 @@ Node5 - -string + +string @@ -112,8 +112,8 @@ Node3->Node5 - - + + @@ -121,8 +121,8 @@ Node6 - -map + +map @@ -130,8 +130,8 @@ Node3->Node6 - - + + @@ -139,8 +139,8 @@ Node7 - -format + +format @@ -148,8 +148,8 @@ Node3->Node7 - - + + @@ -157,8 +157,8 @@ Node8 - -vector + +vector @@ -166,8 +166,8 @@ Node3->Node8 - - + + @@ -175,8 +175,8 @@ Node9 - -string_view + +string_view @@ -184,18 +184,17 @@ Node3->Node9 - - + + Node10 - - -fourdst/config/exceptions -/exceptions.h + + +mutex @@ -203,26 +202,36 @@ Node3->Node10 - - + + - - -Node3->Node12 - - - + + +Node11 + + +fourdst/config/exceptions +/exceptions.h + + + + + +Node3->Node11 + + + Node13 - - -rfl/toml.hpp + + +fourdst/config/validate.h @@ -230,53 +239,296 @@ Node3->Node13 - - + + + + + + + +Node3->Node17 + + + + + + + + +Node23 + + +rfl/toml.hpp + + + + + +Node3->Node23 + + + + + + + + +Node24 + + +rfl/json.hpp + + + + + +Node3->Node24 + + + + + + + + +Node11->Node5 + + + + + + + + +Node12 + + +stdexcept + + + + + +Node11->Node12 + + + + + + + + +Node13->Node2 + + + + + + + + +Node13->Node5 + + + + + + + + +Node13->Node6 + + + + + + + + +Node13->Node7 + + + + + + + + +Node13->Node8 + + + + + + + + +Node13->Node9 + + + Node14 - - -rfl/json.hpp + + +fourdst/config/ansi.h - - -Node3->Node14 - - - + + +Node13->Node14 + + + - - -Node10->Node5 - - - + + +Node13->Node17 + + + - - -Node11 - - -stdexcept + + +Node18 + + +toml++/toml.h - - -Node10->Node11 - - - + + +Node13->Node18 + + + + + + + + +Node19 + + +iostream + + + + + +Node13->Node19 + + + + + + + + +Node20 + + +optional + + + + + +Node13->Node20 + + + + + + + + +Node21 + + +unordered_map + + + + + +Node13->Node21 + + + + + + + + +Node22 + + +sstream + + + + + +Node13->Node22 + + + + + + + + +Node14->Node5 + + + + + + + + +Node15 + + +cstdlib + + + + + +Node14->Node15 + + + + + + + + +Node16 + + +unistd.h + + + + + +Node14->Node16 + + + diff --git a/docs/html/conceptfourdst_1_1config_1_1_is_c_l_i_app.html b/docs/html/conceptfourdst_1_1config_1_1_is_c_l_i_app.html index dbafac5..194e02e 100644 --- a/docs/html/conceptfourdst_1_1config_1_1_is_c_l_i_app.html +++ b/docs/html/conceptfourdst_1_1config_1_1_is_c_l_i_app.html @@ -31,7 +31,7 @@
Logo -
libconfig v2.1.0 +
libconfig v2.2.0
Reflection based C++ configuration library
diff --git a/docs/html/conceptfourdst_1_1config_1_1_is_config_schema.html b/docs/html/conceptfourdst_1_1config_1_1_is_config_schema.html index 47dddab..08f4b6c 100644 --- a/docs/html/conceptfourdst_1_1config_1_1_is_config_schema.html +++ b/docs/html/conceptfourdst_1_1config_1_1_is_config_schema.html @@ -31,7 +31,7 @@ Logo -
libconfig v2.1.0 +
libconfig v2.2.0
Reflection based C++ configuration library
@@ -115,7 +115,7 @@ $(function(){initNavTree('conceptfourdst_1_1config_1_1_is_config_schema.html',''
std::is_class_v<std::decay_t<T>> &&
std::is_aggregate_v<std::decay_t<T>> &&
!std::same_as<std::decay_t<T>, std::string>
-
Concept ensuring a type is suitable for configuration schema.
Definition base.h:38
+
Concept ensuring a type is suitable for configuration schema.
Definition base.h:40

Detailed Description

Concept ensuring a type is suitable for configuration schema.

A valid configuration schema must be: