JayBeams  0.1
Another project to have fun coding.
usage.hpp
Go to the documentation of this file.
1 #ifndef jb_usage_hpp
2 #define jb_usage_hpp
3 
4 #include <stdexcept>
5 
6 namespace jb {
7 
8 /**
9  * A simple class to communicate the result of parsing the options.
10  */
11 class usage : public std::runtime_error {
12 public:
13  usage(std::string const& msg, int e)
14  : std::runtime_error(msg)
15  , exit_(e) {
16  }
17  usage(char const* msg, int e)
18  : usage(std::string(msg), e) {
19  }
20 
21  int exit_status() const {
22  return exit_;
23  }
24 
25 private:
26  // The exit status for the program.
27  int exit_;
28 };
29 
30 } // namespace jb
31 
32 #endif // jb_usage_hpp
usage(std::string const &msg, int e)
Definition: usage.hpp:13
int exit_status() const
Definition: usage.hpp:21
STL namespace.
int exit_
Definition: usage.hpp:27
usage(char const *msg, int e)
Definition: usage.hpp:17
A simple class to communicate the result of parsing the options.
Definition: usage.hpp:11
The top-level namespace for the JayBeams library.
Definition: as_hhmmss.hpp:7