Option++  2.0
C++ library for reading command-line options
Public Member Functions | List of all members
optionpp::parse_error Class Reference

Exception class indicating an invalid option. More...

#include <parser.hpp>

Inheritance diagram for optionpp::parse_error:
Inheritance graph
[legend]
Collaboration diagram for optionpp::parse_error:
Collaboration graph
[legend]

Public Member Functions

 parse_error (const std::string msg, const std::string fn_name, const std::string option="")
 Constructor. More...
 
const std::string & option () const noexcept
 Return option name. More...
 
- Public Member Functions inherited from optionpp::error
 error (const std::string &msg, const std::string &fn_name)
 Constructor. More...
 
const std::string & function () const
 Return the name of function that threw the exception. More...
 

Detailed Description

Exception class indicating an invalid option.

Constructor & Destructor Documentation

◆ parse_error()

optionpp::parse_error::parse_error ( const std::string  msg,
const std::string  fn_name,
const std::string  option = "" 
)
inline

Constructor.

Parameters
msgString describing the error.
fn_nameName of the function that threw the exception.
optionName of the option that triggered the error (if any).

Member Function Documentation

◆ option()

const std::string& optionpp::parse_error::option ( ) const
inlinenoexcept

Return option name.

Returns
Option that triggered the error, if any.

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