C++ Utilities  4.17.0
Useful C++ classes and routines such as argument parser, IO and conversion utilities
failure.h
Go to the documentation of this file.
1 #ifndef APPLICATION_UTILITIES_FAILURE_H
2 #define APPLICATION_UTILITIES_FAILURE_H
3 
4 #include "../global.h"
5 
6 #include <exception>
7 #include <iosfwd>
8 #include <string>
9 
10 namespace ApplicationUtilities {
11 
12 class CPP_UTILITIES_EXPORT Failure : public std::exception {
13 public:
14  Failure();
15  Failure(const std::string &what);
17 
18  virtual const char *what() const USE_NOTHROW;
19 
20 private:
21  std::string m_what;
22 };
23 
24 CPP_UTILITIES_EXPORT std::ostream &operator<<(std::ostream &o, const Failure &failure);
25 
26 } // namespace ApplicationUtilities
27 
28 #endif // APPLICATION_UTILITIES_FAILURE_H
#define CPP_UTILITIES_EXPORT
Contains currently only ArgumentParser and related classes.
#define USE_NOTHROW
Marks a function as never throwing, under no circumstances.
The Failure class is thrown by an ArgumentParser when a parsing error occurs.
Definition: failure.h:12
CPP_UTILITIES_EXPORT std::ostream & operator<<(std::ostream &out, Indentation indentation)