Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

qwavexceptions.h

00001 /***************************************************************************
00002                           Exceptions.h  -  description
00003                              -------------------
00004     begin                : Tue Dec 17 2002
00005     copyright            : (C) 2002 by Peter Eschler
00006     email                : eschler@users.sourceforge.net
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef QwavEXCEPTIONS_H_
00019 #define QwavEXCEPTIONS_H_
00020 
00021 
00022 #include <exception>
00023 #include <string>
00024 
00025 using namespace std;
00026 
00027 Qwav_BEGIN_NAMESPACE
00028 
00029 
00030 //---------------------------------------------------------------------------
00031 // Exception: QwavException
00032 //---------------------------------------------------------------------------
00033 
00037 class QWAV_EXPORTIMPORT QwavException : public std::exception
00038 {
00039 
00040 };
00041 
00042 
00043 
00044 //---------------------------------------------------------------------------
00045 // Exception: InvalidNrOfChannels
00046 //---------------------------------------------------------------------------
00047 
00048 class QWAV_EXPORTIMPORT InvalidNrOfChannels : public QwavException
00049 {
00050     public:
00051         InvalidNrOfChannels(int _nrOfChannels)
00052             : nrOfChannels(_nrOfChannels) {}
00053 
00054         virtual const char* what() const throw() {
00055             return "invalid nr of channels.";
00056         }
00057 
00058         int nrOfChannels;
00059 };
00060 
00061 
00062 
00063 //---------------------------------------------------------------------------
00064 // Exception: FileOpenError
00065 //---------------------------------------------------------------------------
00066 
00067 class QWAV_EXPORTIMPORT FileOpenError : public QwavException
00068 {
00069     public:
00070         FileOpenError(const std::string& f) : filename(f) {}
00071     virtual ~FileOpenError() throw() {}
00072         virtual const char* what() const throw() {
00073             return "error opening file";
00074         }
00075     
00076     std::string filename;
00077 };
00078 
00079 
00080 
00081 //---------------------------------------------------------------------------
00082 // Exception: FileReadError
00083 //---------------------------------------------------------------------------
00084 
00085 class QWAV_EXPORTIMPORT FileReadError : public QwavException
00086 {
00087     public:
00088         FileReadError() {}
00089         virtual const char* what() const throw() {
00090             return "error reading file.";
00091         }
00092 };
00093 
00094 Qwav_END_NAMESPACE
00095 
00096 #endif // QwavEXCEPTIONS_H_
00097 
00098 

Generated on Mon Jan 20 00:24:54 2003 for Qwav by doxygen1.2.16