KPublicTransport

load.cpp
1/*
2 SPDX-FileCopyrightText: 2020 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "load.h"
8#include "datatypes_p.h"
9#include "json_p.h"
10
11using namespace KPublicTransport;
12
13namespace KPublicTransport {
14class LoadInfoPrivate : public QSharedData
15{
16public:
18 QString seatingClass;
19};
20}
21
22KPUBLICTRANSPORT_MAKE_GADGET(LoadInfo)
23KPUBLICTRANSPORT_MAKE_PROPERTY(LoadInfo, Load::Category, load, setLoad)
24KPUBLICTRANSPORT_MAKE_PROPERTY(LoadInfo, QString, seatingClass, setSeatingClass)
25
26QJsonObject LoadInfo::toJson(const LoadInfo &info)
27{
28 return Json::toJson(info);
29}
30
31QJsonArray LoadInfo::toJson(const std::vector<LoadInfo> &loadInfos)
32{
33 return Json::toJson(loadInfos);
34}
35
37{
38 return Json::fromJson<LoadInfo>(obj);
39}
40
41std::vector<LoadInfo> LoadInfo::fromJson(const QJsonArray &array)
42{
43 return Json::fromJson<LoadInfo>(array);
44}
45
46#include "moc_load.cpp"
Vehicle load information.
Definition load.h:38
static QJsonObject toJson(const LoadInfo &info)
Serializes one load information object to JSON.
Definition load.cpp:26
static LoadInfo fromJson(const QJsonObject &obj)
Deserialize an object from JSON.
Definition load.cpp:36
Category
Vehicle load categories.
Definition load.h:20
@ Unknown
no load information are available
Definition load.h:21
Query operations and data types for accessing realtime public transport information from online servi...
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:07:52 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.