src/types.h

changeset 44
d0bf58f3560f
parent 43
1394901b557a
child 45
f5b526a3423a
equal deleted inserted replaced
43:1394901b557a 44:d0bf58f3560f
1 /*
2 * ZCinema: Zandronum demo launcher
3 * Copyright (C) 2013-2015 Teemu Piippo
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 #pragma once
20 #include "main.h"
21 #include <QString>
22 #include <QList>
23 #include <QVariant>
24
25 template<class T> using list = QList<T>;
26 template<class T> using initlist = std::initializer_list<T>;
27 using std::size_t;
28
29 typedef qint8 int8;
30 typedef qint16 int16;
31 typedef qint32 int32;
32 typedef qint64 int64;
33 typedef quint8 uint8;
34 typedef quint16 uint16;
35 typedef quint32 uint32;
36 typedef quint64 uint64;
37
38 struct ZandronumVersion
39 {
40 ZandronumVersion (QString name, bool isRelease, QString binaryPath) :
41 name (name),
42 binaryPath (binaryPath),
43 isRelease (isRelease) {}
44
45 ZandronumVersion() :
46 isRelease (false) {}
47
48 QString name;
49 QString binaryPath;
50 bool isRelease;
51 };
52
53 inline QDataStream& operator<< (QDataStream& out, const ZandronumVersion& version)
54 {
55 return (out << version.name << version.binaryPath << version.isRelease);
56 }
57
58 inline QDataStream& operator>> (QDataStream& in, ZandronumVersion& version)
59 {
60 return (in >> version.name >> version.binaryPath >> version.isRelease);
61 }
62
63 Q_DECLARE_METATYPE (ZandronumVersion)

mercurial