Introduced FileSystem and Out classes
[openstranded.git] / src / error.cc
blob66abb012718b6fa4df7a38fdb5382d28a273aa40
1 #include <iostream>
2 #include <string>
3 #include "output.hh"
4 #include "error.hh"
6 StrandedException::StrandedException (const char* m)
8 this->message = std::string (m);
11 StrandedException::StrandedException (const std::string& m)
13 this->message = m;
16 StrandedException::~StrandedException () throw ()
19 const char*
20 StrandedException::what () throw ()
22 return message.c_str ();
25 void
26 StrandedException::print ()
28 Out::msg << "StrandedException: " << this->what () << Out::endl;
33 * Derived constructors
36 StrandedWarning::StrandedWarning (const char* m):
37 StrandedException (m) {}
39 StrandedWarning::StrandedWarning (const std::string& m):
40 StrandedException (m) {}
42 StrandedError::StrandedError (const char* m):
43 StrandedException (m) {}
45 StrandedError::StrandedError (const std::string& m):
46 StrandedException (m) {}
48 StrandedFatal::StrandedFatal (const char* m):
49 StrandedException (m) {}
51 StrandedFatal::StrandedFatal (const std::string& m):
52 StrandedException (m) {}
55 * Derived methods
58 void
59 StrandedWarning::print ()
61 Out::warning << this->what () << Out::endl;
64 void
65 StrandedError::print ()
67 Out::error << this->what () << Out::endl;
70 void
71 StrandedFatal::print ()
73 Out::msg << this->what () << Out::endl;