Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
CLI::Config Class Referenceabstract

This class provides a converter for configuration files. More...

#include <CLI11.hpp>

Inheritance diagram for CLI::Config:

Public Member Functions

virtual std::string to_config (const App *, bool, bool, std::string) const =0
 Convert an app into a configuration.
 
virtual std::vector< ConfigItemfrom_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< ConfigItemfrom_file (const std::string &name)
 Parse a config file, throw an error (ParseError:ConfigParseError or FileError) on failure.
 
virtual ~Config ()=default
 Virtual destructor.
 

Protected Attributes

std::vector< ConfigItemitems {}
 

Detailed Description

Definition at line 1982 of file CLI11.hpp.

Constructor & Destructor Documentation

◆ ~Config()

virtual CLI::Config::~Config ( )
virtualdefault

Member Function Documentation

◆ from_config()

virtual std::vector< ConfigItem > CLI::Config::from_config ( std::istream & ) const
pure virtual

Implemented in CLI::ConfigBase.

Here is the caller graph for this function:

◆ 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
2007 return from_config(input);
2008 }
std::string name
virtual std::vector< ConfigItem > from_config(std::istream &) const =0
Convert a configuration into an app.
Here is the call graph for this function:

◆ to_config()

virtual std::string CLI::Config::to_config ( const App * ,
bool ,
bool ,
std::string  ) const
pure virtual

Implemented in CLI::ConfigBase.

◆ 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 }
Here is the call graph for this function:

Member Data Documentation

◆ items

std::vector<ConfigItem> CLI::Config::items {}
protected

Definition at line 1984 of file CLI11.hpp.

1984{};

The documentation for this class was generated from the following file: