00001 #include "IoExceptions.h"
00002
00003 namespace Sct {
00004
00005
00006 IoException::IoException(const string& msg, const string& file, int line) throw() {
00007 initialize("IO_EXCEPTION", "Sct::IoException", msg, 0, file, line);
00008 }
00009
00010 IoException::IoException(Throwable& cause, const string& file, int line) throw() {
00011 initialize("IO_EXCEPTION", "Sct::IoException", "", &cause, file, line);
00012 }
00013
00014 IoException::IoException(const string& msg, Throwable& cause, const string& file, int line) throw() {
00015 initialize("IO_EXCEPTION", "Sct::IoException", msg, &cause, file, line);
00016 }
00017
00018
00019 IsException::IsException(int status, const string& msg, const string& file, int line) throw() : status(status) {
00020 initialize("IS_EXCEPTION", "Sct::IsException", msg, 0, file, line);
00021 }
00022
00023 IsException::IsException(int status, Throwable& cause, const string& file, int line) throw() : status(status) {
00024 initialize("IS_EXCEPTION", "Sct::IsException", "", &cause, file, line);
00025 }
00026
00027 IsException::IsException(int status, const string& msg, Throwable& cause, const string& file, int line) throw() : status(status) {
00028 initialize("IS_EXCEPTION", "Sct::IsException", msg, &cause, file, line);
00029 }
00030
00031 int IsException::getStatus() const throw() {
00032 return status;
00033 }
00034
00035 shared_ptr<Throwable> IsException::clone() const throw() {
00036 return shared_ptr<Throwable>(new IsException(*this));
00037 }
00038
00039 string IsException::getMessage() const throw() {
00040 std::ostringstream output;
00041 output << msg << " [Status = " << status << "]";
00042 return output.str();
00043 }
00044
00045
00046 FileException::FileException(const string& fileName, const string& msg, const string& file, int line) throw() : fileName(fileName) {
00047 initialize("IS_EXCEPTION", "Sct::IsException", msg, 0, file, line);
00048 }
00049
00050 FileException::FileException(const string& fileName, Throwable& cause, const string& file, int line) throw() : fileName(fileName) {
00051 initialize("IS_EXCEPTION", "Sct::IsException", "", &cause, file, line);
00052 }
00053
00054 FileException::FileException(const string& fileName, const string& msg, Throwable& cause, const string& file, int line) throw() : fileName(fileName) {
00055 initialize("IS_EXCEPTION", "Sct::IsException", msg, &cause, file, line);
00056 }
00057
00058
00059 const string& FileException::getFileName() const throw() {
00060 return fileName;
00061 }
00062
00063 shared_ptr<Throwable> FileException::clone() const throw() {
00064 return shared_ptr<Throwable>(new FileException(*this));
00065 }
00066
00067 string FileException::getMessage() const throw() {
00068 std::ostringstream output;
00069 output << text << " [File = " << fileName << "]";
00070 return output.str();
00071 }
00072
00073
00074
00075 StreamCorruptedException::StreamCorruptedException(const string& msg, const string& file, int line) throw() {
00076 initialize("STREAM_EXCEPTION", "Sct::StreamCorruptedException", msg, 0, file, line);
00077 }
00078
00079 StreamCorruptedException::StreamCorruptedException(Throwable& cause, const string& file, int line) throw() {
00080 initialize("STREAM_EXCEPTION", "Sct::StreamCorruptedException", "", &cause, file, line);
00081 }
00082
00083 StreamCorruptedException::StreamCorruptedException(const string& msg, Throwable& cause, const string& file, int line) throw() {
00084 initialize("STREAM_EXCEPTION", "Sct::StreamCorruptedException", msg, &cause, file, line);
00085 }
00086
00087
00088
00089
00090
00091 NoSuchStreamerException::NoSuchStreamerException(const string& className, const string& msg,
00092 const string& file, int line) throw() : className(className) {
00093 initialize("NO_STREAMER", "Sct::NoSuchStreamerException", msg, 0, file, line);
00094 }
00095
00096
00097 NoSuchStreamerException::NoSuchStreamerException(const string& className, Throwable& cause, const string& file,
00098 int line) throw() : className(className) {
00099 initialize("NO_STREAMER", "Sct::NoSuchStreamerException", "", &cause, file, line);
00100 }
00101
00102
00103 NoSuchStreamerException::NoSuchStreamerException(const string& className, const string& msg, Throwable& cause,
00104 const string& file, int line) throw() : className(className) {
00105 initialize("NO_STREAMER", "Sct::NoSuchStreamerException", msg, &cause, file, line);
00106 }
00107
00108 const string& NoSuchStreamerException::getClassName() const throw() {
00109 return className;
00110 }
00111
00112 shared_ptr<Throwable> NoSuchStreamerException::clone() const throw() {
00113 return shared_ptr<Throwable> (new NoSuchStreamerException(*this));
00114 }
00115
00116 string NoSuchStreamerException::getMessage() const throw() {
00117 return msg + " ClassName: " + className;
00118 }
00119
00120 }
00121