00001 /*************************************************************************** 00002 * QGame++ * 00003 * ======= * 00004 * A Quantum Gate And Measurement Emulator. * 00005 * * 00006 * Copyright (C) 2003/04 by Manuel Nickschas * 00007 * <qgame-devel@nickschas.de> * 00008 * * 00009 * This program is free software; you can redistribute it and/or modify * 00010 * it under the terms of the GNU General Public License as published by * 00011 * the Free Software Foundation; either version 2 of the License, or * 00012 * (at your option) any later version. * 00013 * * 00014 * This program is distributed in the hope that it will be useful, * 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00017 * GNU General Public License for more details. * 00018 * * 00019 * You should have received a copy of the GNU General Public License * 00020 * along with this program; if not, write to the * 00021 * Free Software Foundation, Inc., * 00022 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00023 ***************************************************************************/ 00024 00025 #include "qgerror.h" 00026 #include <string> 00027 00028 using namespace qgame; 00029 using namespace std; 00030 00031 Error::Error(int code) { 00032 string str; 00033 switch(code) { 00034 case E_OK: 00035 str = "No error"; break; 00036 case E_OUTOFBOUNDS: 00037 str = "Index out of bounds"; break; 00038 case E_SYNTAX: 00039 str = "Syntax error"; break; 00040 case E_IO: 00041 str = "I/O error"; break; 00042 case E_NOORACLE: 00043 str = "Undefined oracle truth table"; break; 00044 default: 00045 str = "No error message given"; break; 00046 } 00047 s = str; 00048 }