/home/et/GnuTopia/liboggpp/libogg++0-1.1/packaging/libogg++0-1.1/Ogg/Exception.H

Go to the documentation of this file.
00001 /*===========================================================================*/
00002 /*
00003  * This file is part of libogg++ - a c++ library for the Ogg transport format
00004  *
00005  * Copyright (C) 2006, 2007  Elaine Tsiang YueLien
00006  *
00007  * libogg++ is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2.1 of the License, or (at your option) any later version.
00011  * 
00012  * This library is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Lesser General Public License for more details.
00016  * 
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with this library; if not, write to the
00019  * Free Software Foundation, Inc.
00020  * 51 Franklin Street, Fifth Floor
00021  * Boston, MA  02110-1301, USA
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

Generated on Tue May 1 16:35:34 2007 for libogg++ by  doxygen 1.5.1