KDEGames

kgameerror.h
1/*
2 This file is part of the KDE games library
3 SPDX-FileCopyrightText: 2001 Andreas Beckermann <b_mann@gmx.de>
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 */
18class KGameError
19{
20public:
21 KGameError()
22 {
23 }
24 ~KGameError()
25 {
26 }
27
28 enum ErrorCodes {
29 Cookie = 0, // Cookie mismatch
30 Version = 1 // Version mismatch
31 };
32
33 /**
34 * Generate an error message with Erorr Code = ErrCookie
35 */
36 static QByteArray errCookie(int localCookie, int remoteCookie);
37 static QByteArray errVersion(int remoteVersion);
38
39 /**
40 * Create an erorr text using a QDataStream (QByteArray) which was
41 * created using @ref KGameError. This is the opposite function to all
42 * the errXYZ() function (e.g. @ref errVersion).
43 * You want to use this to generate the message that shall be
44 * displayed to the user.
45 * @return an error message
46 */
47 static QString errorText(int errorCode, QDataStream &message);
48 static QString errorText(int errorCode, const QByteArray &message);
49};
50
51#endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:04 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.