Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
GlooxConversion.h
Go to the documentation of this file.
1/* Copyright (C) 2026 Wildfire Games.
2 * This file is part of 0 A.D.
3 *
4 * 0 A.D. is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * 0 A.D. is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef GLOOX_CONVERSION_H
19#define GLOOX_CONVERSION_H
20
22
23#include <string>
24
25/**
26 * Convert a gloox presence type to an untranslated string literal to be used
27 * as an identifier by the scripts.
28 */
29const char* GetPresenceString(const gloox::Presence::PresenceType presenceType);
30
31/**
32 * Convert a gloox role type to an untranslated string literal to be used as an
33 * identifier by the scripts.
34 */
35const char* GetRoleString(const gloox::MUCRoomRole role);
36
37/**
38 * Convert a gloox stanza error type to string.
39 * Keep in sync with Gloox documentation
40 *
41 * @param err Error to be converted
42 * @return Converted error string
43 */
44std::string StanzaErrorToString(gloox::StanzaError err);
45
46/**
47 * Convert a gloox connection error enum to string
48 * Keep in sync with Gloox documentation
49 *
50 * @param err Error to be converted
51 * @return Converted error string
52 */
53std::string ConnectionErrorToString(gloox::ConnectionError err);
54
55/**
56 * Convert a gloox registration result enum to string
57 * Keep in sync with Gloox documentation
58 *
59 * @param err Enum to be converted
60 * @return Converted string
61 */
62std::string RegistrationResultToString(gloox::RegistrationResult res);
63
64/**
65 * Translates a gloox certificate error codes, i.e. gloox certificate statuses except CertOk.
66 * Keep in sync with specifications.
67 */
68std::string CertificateErrorToString(gloox::CertStatus status);
69
70#endif // GLOOX_CONVERSION_H
std::string StanzaErrorToString(gloox::StanzaError err)
Convert a gloox stanza error type to string.
Definition: GlooxConversion.cpp:65
const char * GetRoleString(const gloox::MUCRoomRole role)
Convert a gloox role type to an untranslated string literal to be used as an identifier by the script...
Definition: GlooxConversion.cpp:48
std::string ConnectionErrorToString(gloox::ConnectionError err)
Convert a gloox connection error enum to string Keep in sync with Gloox documentation.
Definition: GlooxConversion.cpp:103
std::string RegistrationResultToString(gloox::RegistrationResult res)
Convert a gloox registration result enum to string Keep in sync with Gloox documentation.
Definition: GlooxConversion.cpp:139
const char * GetPresenceString(const gloox::Presence::PresenceType presenceType)
Convert a gloox presence type to an untranslated string literal to be used as an identifier by the sc...
Definition: GlooxConversion.cpp:27
std::string CertificateErrorToString(gloox::CertStatus status)
Translates a gloox certificate error codes, i.e.
Definition: GlooxConversion.cpp:161