This class provides a converter for configuration files.
More...
#include <CLI11.hpp>
|
virtual std::string | to_config (const App *, bool, bool, std::string) const =0 |
| Convert an app into a configuration.
|
|
virtual std::vector< ConfigItem > | from_config (std::istream &) const =0 |
| Convert a configuration into an app.
|
|
virtual std::string | to_flag (const ConfigItem &item) const |
| Get a flag value.
|
|
std::vector< ConfigItem > | from_file (const std::string &name) |
| Parse a config file, throw an error (ParseError:ConfigParseError or FileError) on failure.
|
|
virtual | ~Config ()=default |
| Virtual destructor.
|
|
Definition at line 1982 of file CLI11.hpp.
◆ ~Config()
virtual CLI::Config::~Config |
( |
| ) |
|
|
virtualdefault |
◆ from_config()
virtual std::vector< ConfigItem > CLI::Config::from_config |
( |
std::istream & | | ) |
const |
|
pure virtual |
◆ from_file()
std::vector< ConfigItem > CLI::Config::from_file |
( |
const std::string & | name | ) |
|
|
inline |
Definition at line 2002 of file CLI11.hpp.
2002 {
2003 std::ifstream input{
name};
2004 if(!input.good())
2005 throw FileError::Missing(
name);
2006
2008 }
virtual std::vector< ConfigItem > from_config(std::istream &) const =0
Convert a configuration into an app.
◆ to_config()
virtual std::string CLI::Config::to_config |
( |
const App * | , |
|
|
bool | , |
|
|
bool | , |
|
|
std::string | ) const |
|
pure virtual |
◆ to_flag()
virtual std::string CLI::Config::to_flag |
( |
const ConfigItem & | item | ) |
const |
|
inlinevirtual |
Definition at line 1994 of file CLI11.hpp.
1994 {
1995 if(item.inputs.size() == 1) {
1996 return item.inputs.at(0);
1997 }
1998 throw ConversionError::TooManyInputsFlag(item.fullname());
1999 }
◆ items
The documentation for this class was generated from the following file: