Loading...
Searching...
No Matches
Error.hpp File Reference
`#include <exception>`
`#include <stdexcept>`
`#include <string>`
`#include <utility>`
`#include <vector>`
`#include "Macros.hpp"`
`#include "StringTools.hpp"`

Go to the source code of this file.

## Classes

class | CLI::Error
| All errors derive from this one. More...
class | CLI::ConstructionError
| Construction errors (not in parsing). More...
class | CLI::IncorrectConstruction
| Thrown when an option is set to conflicting values (non-vector and multi args, for example). More...
class | CLI::BadNameString
| Thrown on construction of a bad name. More...
class | CLI::OptionAlreadyAdded
| Thrown when an option already exists. More...
class | CLI::ParseError
| Anything that can error in Parse. More...
class | CLI::Success
| This is a successful completion on parsing, supposed to exit. More...
class | CLI::CallForHelp
| -h or –help on command line More...
class | CLI::CallForAllHelp
| Usually something like –help-all on command line. More...
class | CLI::CallForVersion
| -v or –version on command line More...
class | CLI::RuntimeError
| Does not output a diagnostic in CLI11_PARSE, but allows main() to return with a specific error code. More...
class | CLI::FileError
| Thrown when parsing an INI file and it is missing. More...
class | CLI::ConversionError
| Thrown when conversion call back fails, such as when an int fails to coerce to a string. More...
class | CLI::ValidationError
| Thrown when validation of results fails. More...
class | CLI::RequiredError
| Thrown when a required option is missing. More...
class | CLI::ArgumentMismatch
| Thrown when the wrong number of arguments has been received. More...
class | CLI::RequiresError
| Thrown when a requires option is missing. More...
class | CLI::ExcludesError
| Thrown when an excludes option is present. More...
class | CLI::ExtrasError
| Thrown when too many positionals or options are found. More...
class | CLI::ConfigError
| Thrown when extra values are found in an INI file. More...
class | CLI::InvalidError
| Thrown when validation fails before parsing. More...
class | CLI::HorribleError
class | CLI::OptionNotFound
| Thrown when counting a nonexistent option. More...

## Namespaces

namespace | CLI

## Macros

#define | CLI11_ERROR_DEF(parent, name)
#define | CLI11_ERROR_SIMPLE(name)

## Enumerations

enum class

CLI::ExitCodes : int {
CLI::Success = 0 , CLI::IncorrectConstruction = 100 , CLI::BadNameString , CLI::OptionAlreadyAdded ,
CLI::FileError , CLI::ConversionError , CLI::ValidationError , CLI::RequiredError ,
CLI::RequiresError , CLI::ExcludesError , CLI::ExtrasError , CLI::ConfigError ,
CLI::InvalidError , CLI::HorribleError , CLI::OptionNotFound , CLI::ArgumentMismatch ,
CLI::BaseClass = 127
}

## Macro Definition Documentation

## CLI11_ERROR_DEF

#define CLI11_ERROR_DEF | ( |  | parent,
|  |  | name )

Value:
protected: \
name(std::string ename, std::string msg, int exit_code) : parent(std::move(ename), std::move(msg), exit_code) {} \
name(std::string ename, std::string msg, ExitCodes exit_code) \
: parent(std::move(ename), std::move(msg), exit_code) {} \
\
public: \
name(std::string msg, ExitCodes exit_code) : parent(#name, std::move(msg), exit_code) {} \
name(std::string msg, int exit_code) : parent(#name, std::move(msg), exit_code) {}

## CLI11_ERROR_SIMPLE

#define CLI11_ERROR_SIMPLE | ( |  | name | ) |

Value:
explicit name(std::string msg) : name(#name, msg, ExitCodes::name) {}