2010-02-11 17:24:21 +01:00
|
|
|
#include "posexcept.hh"
|
|
|
|
|
2010-02-18 12:23:05 +01:00
|
|
|
#include <sstream>
|
|
|
|
|
2010-02-11 17:24:21 +01:00
|
|
|
using namespace std ;
|
|
|
|
|
|
|
|
|
2010-03-04 11:59:17 +01:00
|
|
|
|
2010-04-20 15:59:27 +02:00
|
|
|
/* *** Miscellaneous exceptions *** */
|
2010-02-18 12:23:05 +01:00
|
|
|
|
|
|
|
|
2010-06-02 12:37:43 +02:00
|
|
|
cannot_merge::
|
|
|
|
cannot_merge(const string &_explanation) throw():
|
|
|
|
posexcept(_explanation) {}
|
|
|
|
|
|
|
|
|
2010-02-11 18:33:45 +01:00
|
|
|
element_not_found::
|
|
|
|
element_not_found(const string &_explanation) throw():
|
2010-04-20 15:59:27 +02:00
|
|
|
posexcept("Element not found in collection: " + _explanation) {}
|
2010-02-11 18:33:45 +01:00
|
|
|
|
|
|
|
|
2010-03-04 11:59:17 +01:00
|
|
|
|
2010-04-20 15:59:27 +02:00
|
|
|
/* *** Configuration *** */
|
2010-04-02 15:49:22 +02:00
|
|
|
|
|
|
|
|
2010-04-20 15:59:27 +02:00
|
|
|
missing_configuration::
|
|
|
|
missing_configuration(const string &_explanation) throw():
|
|
|
|
posexcept(_explanation) {}
|
2010-04-02 15:49:22 +02:00
|
|
|
|
|
|
|
|
2010-04-20 15:59:27 +02:00
|
|
|
bad_configuration::
|
|
|
|
bad_configuration(const string &_explanation) throw():
|
|
|
|
posexcept(_explanation) {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* *** Input *** */
|
2010-04-02 15:49:22 +02:00
|
|
|
|
|
|
|
|
2010-06-23 16:38:39 +02:00
|
|
|
malformed_input_data::
|
|
|
|
malformed_input_data(const string &_explanation) throw():
|
|
|
|
posexcept("Read error: " + _explanation) {}
|
2010-04-02 15:49:22 +02:00
|
|
|
|
|
|
|
|
2010-04-20 15:59:27 +02:00
|
|
|
bad_direction::bad_direction(const char direction) throw()
|
|
|
|
{
|
|
|
|
ostringstream message ;
|
|
|
|
message << "`" << static_cast<int>(direction)
|
|
|
|
<< "` is not a valid direction value!" ;
|
|
|
|
explanation = message.str() ;
|
|
|
|
}
|
2010-03-04 11:59:17 +01:00
|
|
|
|
|
|
|
|
2010-04-01 17:51:59 +02:00
|
|
|
null_input_medium::null_input_medium() throw():
|
|
|
|
posexcept("The input medium is not initialised!") {}
|
2010-02-11 17:24:21 +01:00
|
|
|
|
|
|
|
|
2010-02-11 18:33:45 +01:00
|
|
|
|
2010-04-20 15:59:27 +02:00
|
|
|
/* *** Files *** */
|
2010-02-16 16:19:39 +01:00
|
|
|
|
|
|
|
|
2010-02-11 18:33:45 +01:00
|
|
|
error_opening_input_file::
|
2010-04-01 17:51:59 +02:00
|
|
|
error_opening_input_file(const string &file_name) throw():
|
|
|
|
posexcept("Error opening input file « " + file_name + " »!") {}
|
2010-03-04 11:59:17 +01:00
|
|
|
|
|
|
|
|
2010-03-22 14:14:44 +01:00
|
|
|
error_opening_output_file::
|
2010-04-01 17:51:59 +02:00
|
|
|
error_opening_output_file(const string &file_name) throw():
|
|
|
|
posexcept("Error opening output file « " + file_name + " »!") {}
|