2 // Boost general library 'format' ---------------------------
3 // See http://www.boost.org for updates, documentation, and revision history.
5 // (C) Samuel Krempp 2001
6 // krempp@crans.ens-cachan.fr
7 // Permission to copy, use, modify, sell and
8 // distribute this software is granted provided this copyright notice appears
9 // in all copies. This software is provided "as is" without express or implied
10 // warranty, and with no claim as to its suitability for any purpose.
12 // ideas taken from RĂ¼diger Loos's format class
13 // and Karl Nelson's ofstream (also took its parsing code as basis for printf parsing)
15 // ------------------------------------------------------------------------------
17 // ------------------------------------------------------------------------------
20 #ifndef BOOST_FORMAT_EXCEPTIONS_HPP
21 #define BOOST_FORMAT_EXCEPTIONS_HPP
31 // **** exceptions -----------------------------------------------
33 class format_error : public std::exception
37 virtual const char *what() const throw()
39 return "boost::format_error: "
40 "format generic failure";
44 class bad_format_string : public format_error
47 bad_format_string() {}
48 virtual const char *what() const throw()
50 return "boost::bad_format_string: "
51 "format-string is ill-formed";
55 class too_few_args : public format_error
59 virtual const char *what() const throw()
61 return "boost::too_few_args: "
62 "format-string refered to more arguments than were passed";
66 class too_many_args : public format_error
70 virtual const char *what() const throw()
72 return "boost::too_many_args: "
73 "format-string refered to less arguments than were passed";
78 class out_of_range : public format_error
82 virtual const char *what() const throw()
84 return "boost::out_of_range: "
85 "tried to refer to an argument (or item) number which is out of range, "
86 "according to the format string.";
96 #endif // BOOST_FORMAT_EXCEPTIONS_HPP