00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef _EXCEPTIONS_H
00030 #define _EXCEPTIONS_H
00031
00032
00033 #include <exception>
00034 #include <string>
00035 #include <sstream>
00036 #include "typedefs.h"
00037
00038 namespace libgexf {
00039
00043 class ReadLockException : public std::exception {
00044 public:
00045 ReadLockException(const std::string& what) throw() { _text = what; };
00046 virtual ~ReadLockException() throw() {};
00047 virtual const char* what() const throw() {
00048 return (const char *)(_text.c_str());
00049 }
00050 private:
00051 std::string _text;
00052 };
00053
00057 class WriteLockException : public std::exception {
00058 public:
00059 WriteLockException(const std::string& what) throw() { _text = what; };
00060 virtual ~WriteLockException() throw() {};
00061 virtual const char* what() const throw() {
00062 return (const char *)(_text.c_str());
00063 }
00064 private:
00065 std::string _text;
00066 };
00067
00071 class FileWriterException : public std::exception {
00072 public:
00073 FileWriterException(const std::string& what) throw() { _text = what; };
00074 virtual ~FileWriterException() throw() {};
00075 virtual const char* what() const throw() {
00076 return (const char *)(_text.c_str());
00077 }
00078 private:
00079 std::string _text;
00080 };
00081
00085 class FileReaderException : public std::exception {
00086 public:
00087 FileReaderException(const std::string& what) throw() { _text = what; };
00088 virtual ~FileReaderException() throw() {};
00089 virtual const char* what() const throw() {
00090 return (const char *)(_text.c_str());
00091 }
00092 private:
00093 std::string _text;
00094 };
00095 }
00096
00097 #endif
00098