Application configuration.
More...
#include <configuration.hpp>
|
| | Configuration (const Configuration &conf)=delete |
| | Configuration (Configuration &&conf)=delete |
| Configuration & | folders (const std::vector< std::filesystem::path > &folders) noexcept |
| Configuration & | name (const std::string &name) noexcept |
| Configuration & | profiles (const std::vector< std::string > &profiles) noexcept |
| Configuration & | load () |
| const anch::conf::Section * | section (const std::string &path) const noexcept |
| std::optional< std::string > | value (const std::string &path) const noexcept |
|
| static const Configuration & | inst () |
| static Configuration & | loader () noexcept |
Application configuration.
Load and manage configuration for an application.
It provides profiles inspired by Spring framework.
- Since
- 0.1
- Author
- Vincent Lachenal
◆ Configuration() [1/2]
| anch::conf::Configuration::Configuration |
( |
const Configuration & | conf | ) |
|
|
delete |
◆ Configuration() [2/2]
| anch::conf::Configuration::Configuration |
( |
Configuration && | conf | ) |
|
|
delete |
◆ folders()
| Configuration & anch::conf::Configuration::folders |
( |
const std::vector< std::filesystem::path > & | folders | ) |
|
|
noexcept |
Folders' setter
- Parameters
-
- Returns
this
◆ inst()
| const Configuration & anch::conf::Configuration::inst |
( |
| ) |
|
|
static |
◆ load()
| Configuration & anch::conf::Configuration::load |
( |
| ) |
|
Parse Configuration from base name.
Configuration will load configuration files in this order:
- look for <name> file with registered extenions (default name to application ; ini, conf, cnf and properties extensions will always been registered) in folders
- raise error when file is not found
- load the first file found (others will be ignored)
- load includes files
- for each active profiles, repeat the previous loading with <file>-<profile>.<extension>
- Returns
- the Configuration
- Exceptions
-
◆ loader()
| Configuration & anch::conf::Configuration::loader |
( |
| ) |
|
|
staticnoexcept |
◆ name()
| Configuration & anch::conf::Configuration::name |
( |
const std::string & | name | ) |
|
|
noexcept |
◆ profiles()
| Configuration & anch::conf::Configuration::profiles |
( |
const std::vector< std::string > & | profiles | ) |
|
|
noexcept |
◆ section()
| const anch::conf::Section * anch::conf::Configuration::section |
( |
const std::string & | path | ) |
const |
|
noexcept |
Get section
- Parameters
-
- Returns
- the section when found,
NULL otherwise.
◆ value()
| std::optional< std::string > anch::conf::Configuration::value |
( |
const std::string & | path | ) |
const |
|
noexcept |
Get value
- Parameters
-
- Returns
- the optional result
The documentation for this class was generated from the following file: