AnCH command line interface library namespace.
More...
|
| using | BindArg = std::function<void(const std::string&)> |
AnCH command line interface library namespace.
Arguments parsing and terminal output formatting. See AnCH CLI library documentation.
◆ BindArg
◆ Color
Console color definition
- Author
- Vincent Lachenal
| Enumerator |
|---|
| BLACK | Black
|
| RED | Red
|
| GREEN | Green
|
| YELLOW | Yellow
|
| BLUE | Blue
|
| MAGENTA | Magenta
|
| CYAN | Cyan
|
| WHITE | White
|
| DEFAULT | Default color console
|
◆ bindCol() [1/3]
| BindArg anch::cli::bindCol |
( |
std::list< std::string > & | dest | ) |
|
Add value to list
- Parameters
-
| dest | the sdt::list to fill |
- Returns
- the binding function
◆ bindCol() [2/3]
| BindArg anch::cli::bindCol |
( |
std::set< std::string > & | dest | ) |
|
Add value to set
- Parameters
-
- Returns
- the binding function
◆ bindCol() [3/3]
| BindArg anch::cli::bindCol |
( |
std::vector< std::string > & | dest | ) |
|
Add value to vector
- Parameters
-
| dest | the std::vector to fill |
- Returns
- the binding function
◆ bindCout()
| std::function< void(std::ostream &)> anch::cli::bindCout |
( |
std::shared_ptr< std::ostream > & | dest | ) |
|
Bind std::cout to output stream
- Parameters
-
| dest | the destination output stream |
◆ bindFalse()
| BindArg anch::cli::bindFalse |
( |
bool & | dest | ) |
|
Bind false utility function
- Parameters
-
- Returns
- the binding function
◆ bindIFS()
| BindArg anch::cli::bindIFS |
( |
std::shared_ptr< std::istream > & | dest | ) |
|
Bind input file stream
- Parameters
-
| dest | the std::istream to fill |
- Returns
- the binding function (which raises
std::invalid_argument when file does not exist, is not a regular file or can not be read)
◆ bindNum() [1/8]
| BindArg anch::cli::bindNum |
( |
double & | dest | ) |
|
Bind double value utility function
- Parameters
-
- Returns
- the binding function (which raises
std::invalid_argument when value is empty, is not a number or is out of range ; dest is not modified in this case)
◆ bindNum() [2/8]
| BindArg anch::cli::bindNum |
( |
float & | dest | ) |
|
Bind float value utility function
- Parameters
-
- Returns
- the binding function (which raises
std::invalid_argument when value is empty, is not a number or is out of range ; dest is not modified in this case)
◆ bindNum() [3/8]
| BindArg anch::cli::bindNum |
( |
int16_t & | dest | ) |
|
Bind int64_t value utility function
- Parameters
-
- Returns
- the binding function (which raises
std::invalid_argument when value is empty, is not a number or is out of range ; dest is not modified in this case)
◆ bindNum() [4/8]
| BindArg anch::cli::bindNum |
( |
int32_t & | dest | ) |
|
Bind int32_t value utility function
- Parameters
-
- Returns
- the binding function (which raises
std::invalid_argument when value is empty, is not a number or is out of range ; dest is not modified in this case)
◆ bindNum() [5/8]
| BindArg anch::cli::bindNum |
( |
int64_t & | dest | ) |
|
Bind int64_t value utility function
- Parameters
-
- Returns
- the binding function (which raises
std::invalid_argument when value is empty, is not a number or is out of range ; dest is not modified in this case)
◆ bindNum() [6/8]
| BindArg anch::cli::bindNum |
( |
uint16_t & | dest | ) |
|
Bind uint16_t value utility function
- Parameters
-
- Returns
- the binding function (which raises
std::invalid_argument when value is empty, is not a number or is out of range ; dest is not modified in this case)
◆ bindNum() [7/8]
| BindArg anch::cli::bindNum |
( |
uint32_t & | dest | ) |
|
Bind uint16_t value utility function
- Parameters
-
- Returns
- the binding function (which raises
std::invalid_argument when value is empty, is not a number or is out of range ; dest is not modified in this case)
◆ bindNum() [8/8]
| BindArg anch::cli::bindNum |
( |
uint64_t & | dest | ) |
|
Bind uint32_t value utility function
- Parameters
-
- Returns
- the binding function (which raises
std::invalid_argument when value is empty, is not a number or is out of range ; dest is not modified in this case)
◆ bindOFS() [1/2]
| BindArg anch::cli::bindOFS |
( |
std::shared_ptr< std::ofstream > & | dest, |
|
|
std::ios_base::openmode | mode = std::ios_base::out ) |
Bind output file stream
- Parameters
-
| dest | the std::ofstream to fill |
| mode | the file open mode (default to std::ios_base::out ) |
- Returns
- the binding function (which raises
std::invalid_argument when file can not be opened for writing)
◆ bindOFS() [2/2]
| BindArg anch::cli::bindOFS |
( |
std::shared_ptr< std::ostream > & | dest | ) |
|
Bind output file stream
- Parameters
-
| dest | the std::ostream to fill |
- Returns
- the binding function (which raises
std::invalid_argument when file can not be opened for writing)
◆ bindPath()
| BindArg anch::cli::bindPath |
( |
std::filesystem::path & | dest | ) |
|
Bind input file stream
- Parameters
-
| dest | the std::filesystem::path to fill |
- Returns
- the binding function
◆ bindPipe()
| std::function< void(std::istream &)> anch::cli::bindPipe |
( |
std::shared_ptr< std::istream > & | dest | ) |
|
Bind std::cin to input stream
- Parameters
-
| dest | the destination input stream |
◆ bindStr() [1/2]
| BindArg anch::cli::bindStr |
( |
std::optional< std::string > & | dest | ) |
|
Bind caracters' string value utility function and macro
- Parameters
-
- Returns
- the binding function
◆ bindStr() [2/2]
| BindArg anch::cli::bindStr |
( |
std::string & | dest | ) |
|
Bind caracters' string value utility function
- Parameters
-
- Returns
- the binding function
◆ bindTrue()
| BindArg anch::cli::bindTrue |
( |
bool & | dest | ) |
|
Bind true utility function
- Parameters
-
- Returns
- the binding function
◆ manageEnvNoFormat()
| void anch::cli::manageEnvNoFormat |
( |
| ) |
|
Disable console formatting when environment variable ANCH_CLI_NO_FMT is set to 1
◆ operator<<()
Formatter output stream operator.
It is declared in anch::cli namespace so that it is found by argument-dependent lookup from any namespace.
- Parameters
-
| stream | the output stream to use |
| fmt | the formatter to use |
- Returns
- the output stream
◆ BLINK
Predefined blink formatter
◆ BOLD
Predefined bold formatter
◆ RESET
Predefined reset formatter
◆ UNBLINK
Predefined unblink formatter
◆ UNBOLD
Predefined unbold formatter
◆ UNDERLINE
Predefined underline formatter
◆ UNUNDERLINE
Predefined ununderline formatter