Read JSON, YAML, TOML, XML or INI configuration by declaring a struct
figcone::Config
constructors with using Config::Config;
declaration)clang-format
configsfun
library to v3.0.0nameof
library, now figcone
can be used with MSVC compiler when functionality provided by nameof
is enabled (C++20 is required)figcone_formats
static library which is built and linked automatically if any format is enabled in CMake. That means that figcone
isn't a header-only library anymore if any config format support is enabled. If you disable a built-in config format support (and creation of library figcone_formats
) by unsetting FIGCONE_USE_ALL
CMake variable, figcone
still can be used as a header-only library, for example, for providing an interface for your own parser.figcone/format/<format name>
directories. It could affect you, if you included figcone_toml/datetime.h
header, now it's located in figcone/format/toml/datetime.h
rapidyaml
definitions is built into figcone_formats library, so you don't need to create a separate yaml_impl.cpp
in your project anymore.nameof
library isn't supported by MSVC)seal_lake
library.sfun
library to v2.1.1figcone_tree
library to v0.10.1figcone_ini
library to v0.10.1figcone_json
library to v0.10.1figcone_shoal
library to v0.1.1figcone_toml
library to v0.10.1figcone_xml
library to v0.10.1figcone_yaml
library to v0.10.1figcone::optional
figcone::optional
shoal
configuration formatauto cfg = MyCfg{};
cfg.readJson("{}");
you need to write it like that:
auto cfgReader = figcone::ConfigReader{};
auto cfg = cfgReader.readJson<MyCfg>("{}");
This change was required for placing all config structure registration data outside the config object. Now figcone::Config contains only a single pointer, besides the user provided data, so by default the config object is a copyable aggregate that can be used however you want.
figcone::optional
instead of std::optional
. figcone::optional
- is a std::optional-like wrapper with similar interface.sfun
and gsl
library were replaced with their fetched versions, system wide installation of nameof
library was disabled.PARAMLIST(foo, std::vector<std::string>)
, NODELIST(bar, std::deque<MyCfg>)
, etc.
FIGCONE_*LIST
macros can use any sequence container, providing emplace_back
method
FIGCONE_DICT
macro can use any associative container, providing emplace
method()
operator for setting field's default value or enable default initialization. FIGCONE_NODE
, FIGCONE_NODELIST
and FIGCONE_COPY_NODELIST
can only use operator ()
without parameters, to default initialize the created field;std::optional
, including fields registered with FIGCONE_*LIST
and FIGCONE_DICT
std::string
.Initial version