kgameerror.h
00001 /* 00002 This file is part of the KDE games library 00003 Copyright (C) 2001 Andreas Beckermann (b_mann@gmx.de) 00004 Copyright (C) 2001 Martin Heni (martin@heni-online.de) 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License version 2 as published by the Free Software Foundation. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to 00017 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 Boston, MA 02110-1301, USA. 00019 */ 00020 /* 00021 $Id: kgameerror.h 465369 2005-09-29 14:33:08Z mueller $ 00022 */ 00023 #ifndef __KGAMEERROR_H_ 00024 #define __KGAMEERROR_H_ 00025 00026 #include <qstring.h> 00027 00028 00029 class KGameError 00030 { 00031 public: 00032 KGameError() { } 00033 ~KGameError() { } 00034 00035 enum ErrorCodes { 00036 Cookie = 0, // Cookie mismatch 00037 Version = 1 // Version mismatch 00038 }; 00039 00043 static QByteArray errCookie(int localCookie, int remoteCookie); 00044 static QByteArray errVersion(int remoteVersion); 00045 00054 static QString errorText(int errorCode, QDataStream& message); 00055 static QString errorText(int errorCode, const QByteArray& message); 00056 00057 }; 00058 00059 #endif