• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

src/Exception.cpp

00001 /*
00002  *   This file is part of the Standard Portable Library (SPL).
00003  *
00004  *   SPL is free software: you can redistribute it and/or modify
00005  *   it under the terms of the GNU General Public License as published by
00006  *   the Free Software Foundation, either version 3 of the License, or
00007  *   (at your option) any later version.
00008  *
00009  *   SPL is distributed in the hope that it will be useful,
00010  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *   GNU General Public License for more details.
00013  *
00014  *   You should have received a copy of the GNU General Public License
00015  *   along with SPL.  If not, see <http://www.gnu.org/licenses/>.
00016  */
00017 #include <stdio.h>
00018 #include <spl/Memory.h>
00019 #include <spl/Exception.h>
00020 #include <spl/collection/CircularArray.h>
00021 
00022 Exception::Exception( )
00023 {
00024         m_msg[0] = '\0';
00025 }
00026 
00027 Exception::Exception( const char *msg )
00028 {
00029         char *to = &m_msg[0];
00030         while ( '\0' != *msg )
00031         {
00032                 *to++ = *msg++;
00033         }
00034         *to = '\0';
00035 }
00036 
00037 Exception::~Exception()
00038 {
00039 }
00040 
00041 OutOfMemoryException::OutOfMemoryException() : Exception("Out of memory")
00042 {
00043 }
00044 
00045 SqlException::SqlException(const char *msg) : Exception(msg)
00046 {
00047 }
00048 
00049 IndexOutOfBoundsException::IndexOutOfBoundsException() : Exception("Index out of bounds")
00050 {
00051 }
00052 
00053 InvalidArgumentException::InvalidArgumentException(const char *msg) : Exception(msg)
00054 {
00055 }
00056 
00057 IOException::IOException(const char *msg) : Exception(msg)
00058 {
00059 }
00060 
00061 AssertionFailedException::AssertionFailedException(const char *msg) : Exception(msg) 
00062 {
00063 }
00064 
00065 CircularArrayException::CircularArrayException(const char *msg) : Exception(msg)
00066 {
00067 }
00068 
00069 NotImplementedException::NotImplementedException(const char *msg) : Exception(msg)
00070 {
00071 }
00072 
00073 NotImplementedException::NotImplementedException() : Exception()
00074 {
00075 }
00076 
00077 SocketException::SocketException( const char *msg ) : Exception( msg )
00078 {
00079 }
00080 
00081 ThreadStartException::ThreadStartException() : Exception()
00082 {
00083 }
00084 
00085 FileNotFoundException::FileNotFoundException(const char *filename) : Exception(filename)
00086 {
00087 }
00088 
00089 PacketUnderflowException::PacketUnderflowException() : Exception() 
00090 {
00091 }
00092 
00093 PacketReadTypeMismatchException::PacketReadTypeMismatchException(const char *msg) : Exception(msg) 
00094 {
00095 }
00096 
00097 PacketNotReadyException::PacketNotReadyException(const char *msg) : Exception(msg) 
00098 {
00099 }
00100 
00101 InvalidTypeConversionException::InvalidTypeConversionException() : Exception()
00102 {
00103 }
00104 
00105 InvalidTypeConversionException::InvalidTypeConversionException(const char *msg) : Exception(msg)
00106 {
00107 }
00108 
00109 StateException::StateException(const char *msg) : Exception(msg) 
00110 {
00111 }
00112 
00113 SecurityException::SecurityException(const char *msg) : Exception(msg) 
00114 {
00115 }
00116 
00117 ConfigurationException::ConfigurationException(const char *msg) : Exception(msg)
00118 {
00119 }
00120 
00121 XmlException::XmlException(const char *msg, int row, int col) 
00122 : Exception(msg), m_row(row+1), m_col(col+1)
00123 {
00124 }