args-parser
6.3.3
Loading...
Searching...
No Matches
exceptions.hpp
Go to the documentation of this file.
1
31
#ifndef ARGS__EXCEPTIONS_HPP__INCLUDED
32
#define ARGS__EXCEPTIONS_HPP__INCLUDED
33
34
// C++ include.
35
#include <stdexcept>
36
37
// Args include.
38
#include "
types.hpp
"
39
40
41
namespace
Args
{
42
43
//
44
// BaseException
45
//
46
48
class
BaseException
49
:
public
std::logic_error
50
{
51
public
:
52
explicit
BaseException
(
String
what )
53
: std::logic_error(
"Please use desc() method of the exception."
)
54
, m_what( std::move( what ) )
55
{
56
}
57
58
virtual
~BaseException
() noexcept
59
{
60
}
61
63
const
String
&
desc
() const noexcept
64
{
65
return
m_what;
66
}
67
68
private
:
70
String
m_what;
71
};
// class BaseException
72
73
74
//
75
// HelpHasBeenPrintedException
76
//
77
79
class
HelpHasBeenPrintedException
final
80
:
public
BaseException
81
{
82
public
:
83
HelpHasBeenPrintedException
()
84
:
BaseException
(
SL
(
"Help has been printed."
) )
85
{
86
}
87
};
// class HelpHasBeenPrintedException
88
89
}
/* namespace Args */
90
91
#endif
// ARGS__EXCEPTIONS_HPP__INCLUDED
Args::BaseException
Base exception of the library.
Definition
exceptions.hpp:50
Args::BaseException::~BaseException
virtual ~BaseException() noexcept
Definition
exceptions.hpp:58
Args::BaseException::desc
const String & desc() const noexcept
Definition
exceptions.hpp:63
Args::BaseException::BaseException
BaseException(String what)
Definition
exceptions.hpp:52
Args::HelpHasBeenPrintedException
This exception notifies about that help has been printed.
Definition
exceptions.hpp:81
Args::HelpHasBeenPrintedException::HelpHasBeenPrintedException
HelpHasBeenPrintedException()
Definition
exceptions.hpp:83
Args
Definition
api.hpp:42
Args::String
std::string String
String type.
Definition
types.hpp:324
types.hpp
SL
#define SL(str)
Definition
types.hpp:338
args-parser
exceptions.hpp
Generated by
1.9.8