00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00028
00029 #ifndef OggException
00030 #define OggException
00031
00032 #ifdef __GNUG__
00033 #pragma interface
00034 #endif
00035
00036 #include <exception>
00037 #include <string>
00038 #include <sstream>
00039
00040
00041 namespace Ogg
00042 {
00043 using std::exception;
00044 using std::string;
00045 using std::ostringstream;
00046
00050 class Exception : public exception, public ostringstream
00051 {
00052 public:
00053 Exception(
00054 const char * nm
00055 ) throw()
00056 ;
00057
00059 Exception(
00060 const Exception & ex
00061 ) throw()
00062 : exception()
00063 {
00064 str() = ex.str();
00065 }
00066
00067 virtual
00068 ~Exception() throw()
00069 {}
00070
00071 virtual
00072 const char* what() const throw()
00073 {
00074 return(str().c_str());
00075 }
00076 }
00077 ;
00078
00079
00083 class Error
00084 {
00085 public:
00086 enum ErrorNo
00087 {
00088 None
00089 ,BeyondCurrentVersion
00090 ,LateStreamOccured
00091 ,PacketNonContinuation
00092 ,PacketContinuation
00093 ,NonContinuity
00094 ,BadGranulePosition
00095 ,StreamBegin
00096 ,StreamEnd
00097 ,PrematureEnd
00098 };
00099
00100 Error &
00101 operator |=(ErrorNo);
00102
00103 Error &
00104 operator |=(Error &);
00105
00106 bool
00107 operator[](ErrorNo);
00108
00109 const char *
00110 operator()(ErrorNo);
00111 }
00112 ;
00113 }
00114 #endif