KDEGames

kgameerror.h
1 /*
2  This file is part of the KDE games library
3  SPDX-FileCopyrightText: 2001 Andreas Beckermann <[email protected]>
4  SPDX-FileCopyrightText: 2001 Martin Heni <kde at heni-online.de>
5 
6  SPDX-License-Identifier: LGPL-2.0-only
7 */
8 
9 #ifndef __KGAMEERROR_H_
10 #define __KGAMEERROR_H_
11 
12 // Qt
13 #include <QString>
14 
15 /**
16  * \class KGameError kgameerror.h <KGame/KGameError>
17  */
18 class KGameError
19 {
20 public:
21  KGameError() { }
22  ~KGameError() { }
23 
24  enum ErrorCodes {
25  Cookie = 0, // Cookie mismatch
26  Version = 1 // Version mismatch
27  };
28 
29  /**
30  * Generate an error message with Erorr Code = ErrCookie
31  **/
32  static QByteArray errCookie(int localCookie, int remoteCookie);
33  static QByteArray errVersion(int remoteVersion);
34 
35  /**
36  * Create an erorr text using a QDataStream (QByteArray) which was
37  * created using @ref KGameError. This is the opposite function to all
38  * the errXYZ() function (e.g. @ref errVersion).
39  * You want to use this to generate the message that shall be
40  * displayed to the user.
41  * @return an error message
42  **/
43  static QString errorText(int errorCode, QDataStream& message);
44  static QString errorText(int errorCode, const QByteArray& message);
45 
46 };
47 
48 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Dec 7 2021 22:34:14 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.