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   private:
00086     Error &
00087     operator=(const Error &);
00088 
00089   public:
00090     enum ErrorNo
00091       {
00092         None
00093         ,BeyondCurrentVersion
00094         ,SomeStreamsIgnored
00095         ,PacketNonContinuation
00096         ,PacketContinuation
00097         ,NonContinuity
00098         ,BadGranulePosition
00099         ,StreamBegin
00100         ,StreamEnd
00101         ,PrematureEnd
00102       };
00103 
00104     Error &
00105     operator |=(ErrorNo);
00106 
00107     Error &
00108     operator |=(Error &);
00109 
00110     bool
00111     operator [](ErrorNo);
00112 
00113     const char *
00114     operator ()(ErrorNo);
00115 
00116   }
00117   ;
00118 }
00119 #endif