invalidsramfileexception.hh

Go to the documentation of this file.
00001 /*
00002  * Secret of Evermore SRAM Editor
00003  * Copyright (C) 2006 emuWorks
00004  * http://games.technoplaza.net/
00005  *
00006  * This file is part of Secret of Evermore SRAM Editor.
00007  *
00008  * Secret of Evermore SRAM Editor is free software; you can redistribute it
00009  * and/or modify it under the terms of the GNU General Public License as
00010  * published by the Free Software Foundation; either version 2 of the License,
00011  * or (at your option) any later version.
00012  *
00013  * Secret of Evermore SRAM Editor is distributed in the hope that it will be
00014  * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with Secret of Evermore SRAM Editor; if not, write to the Free Software
00020  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00021  */
00022  
00023 // $Id: invalidsramfileexception.hh,v 1.3 2006/09/02 16:24:45 technoplaza Exp $
00024 
00025 #ifndef _SOESRAME_INVALIDSRAMFILEEXCEPTION_HH_
00026 #define _SOESRAME_INVALIDSRAMFILEEXCEPTION_HH_
00027 
00028 #include <stdexcept>
00029 
00030 namespace soesrame {
00031     /// The possible InvalidSRAMFileException error codes
00032     enum isfe_error {
00033         ISFE_FILENOTFOUND, ISFE_INVALIDSIZE, ISFE_NOVALIDGAMES
00034     };
00035     
00036     class InvalidSRAMFileException : public std::runtime_error {
00037     private:
00038         enum isfe_error error;
00039         
00040     public:
00041         /**
00042          * Creates a new InvalidSRAMFileException.
00043          *
00044          * @param error The error code that triggered this exception.
00045          */
00046         InvalidSRAMFileException(enum isfe_error error);
00047         
00048         /**
00049          * Gets the error code for this InvalidSRAMFileException.
00050          *
00051          * @return The error code.
00052          */
00053         enum isfe_error getError() const;
00054     };
00055     
00056     inline InvalidSRAMFileException::
00057         InvalidSRAMFileException(enum isfe_error error) :
00058         std::runtime_error("InvalidSRAMFileException"), error(error) {}
00059         
00060     inline enum isfe_error InvalidSRAMFileException::getError() const
00061         { return error; }
00062 }
00063 
00064 #endif
00065 

Generated on Sun Sep 10 01:49:26 2006 for Secret of Evermore SRAM Editor by  doxygen 1.4.7