playererror.h
00001 /* 00002 * Player - One Hell of a Robot Server 00003 * Copyright (C) 2000-2003 00004 * Brian Gerkey, Kasper Stoy, Richard Vaughan, & Andrew Howard 00005 * 00006 * 00007 * This program is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 2 of the License, or 00010 * (at your option) any later version. 00011 * 00012 * This program 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 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00020 * 00021 */ 00022 /******************************************************************** 00023 * 00024 * This library is free software; you can redistribute it and/or 00025 * modify it under the terms of the GNU Lesser General Public 00026 * License as published by the Free Software Foundation; either 00027 * version 2.1 of the License, or (at your option) any later version. 00028 * 00029 * This library is distributed in the hope that it will be useful, 00030 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00031 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00032 * Lesser General Public License for more details. 00033 * 00034 * You should have received a copy of the GNU Lesser General Public 00035 * License along with this library; if not, write to the Free Software 00036 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00037 * 00038 ********************************************************************/ 00039 00040 #ifndef PLAYERERROR_H 00041 #define PLAYERERROR_H 00042 00043 #include <string> 00044 #include <iostream> 00045 00046 namespace PlayerCc 00047 { 00048 00054 class PlayerError 00055 { 00056 private: 00057 00058 // a string describing the error 00059 std::string mStr; 00060 // a string describing the location of the error in the source 00061 std::string mFun; 00062 // error code returned by playerc 00063 int mCode; 00064 00065 public: 00067 std::string GetErrorStr() const { return(mStr); }; 00069 std::string GetErrorFun() const { return(mFun); }; 00071 int GetErrorCode() const { return(mCode); }; 00072 00074 PlayerError(const std::string aFun="", 00075 const std::string aStr="", 00076 const int aCode=-1); 00078 ~PlayerError(); 00079 }; 00080 00081 } 00082 00083 namespace std 00084 { 00085 std::ostream& operator << (std::ostream& os, const PlayerCc::PlayerError& e); 00086 } 00087 00088 #endif