Fixed problem in DeviceSettings::strParam, returned wrong string
[avr-sim.git] / src / FormatExceptions.h
blob4d6db2164df6b764dfd43813ee2be74283ff302e
1 #ifndef UTIL_FORMAT_EXCEPTIONS_H
2 #define UTIL_FORMAT_EXCEPTIONS_H
4 #include <stdexcept>
6 namespace util {
7 class format_error : public std::exception {
8 public:
9 format_error() {}
10 virtual const char *what() const throw() {
11 return "Format::format_error: format generic failure";
15 class bad_format_string : public format_error {
16 public:
17 bad_format_string() {}
18 virtual const char *what() const throw() {
19 return "Format::bad_format_string: format-string is ill-formed";
23 class too_few_args : public format_error {
24 public:
25 too_few_args() {}
26 virtual const char *what() const throw() {
28 return "Format::too_few_args: format-string refered to more arguments than were passed";
34 class too_many_args : public format_error {
35 public:
36 too_many_args() {}
37 virtual const char *what() const throw() {
38 return "Format::too_many_args: format-string refered to less arguments than were passed";
42 class out_of_range : public format_error {
43 public:
44 out_of_range() {}
45 virtual const char *what() const throw() {
46 return "Format::out_of_range: "
47 "tried to refer to an argument (or item) number which is out of range, "
48 "according to the format string.";
52 #endif