Marble

GeoDataSimpleData.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2014 Abhinav Gangwar <abhgang@gmail.com>
4//
5
6#include "GeoDataSimpleData.h"
7
8// Marble
9#include "GeoDataTypes.h"
10
11namespace Marble
12{
13
14class GeoDataSimpleDataPrivate
15{
16public:
17 QString m_name;
18 QString m_data;
19};
20
21GeoDataSimpleData::GeoDataSimpleData()
22 : d(new GeoDataSimpleDataPrivate)
23{
24}
25
26GeoDataSimpleData::GeoDataSimpleData(const GeoDataSimpleData &other)
27 : d(new GeoDataSimpleDataPrivate(*other.d))
28{
29}
30
31GeoDataSimpleData::~GeoDataSimpleData()
32{
33 delete d;
34}
35
36QString GeoDataSimpleData::name() const
37{
38 return d->m_name;
39}
40
41void GeoDataSimpleData::setName(const QString &name)
42{
43 d->m_name = name;
44}
45
46QString GeoDataSimpleData::data() const
47{
48 return d->m_data;
49}
50
51void GeoDataSimpleData::setData(const QString &data)
52{
53 d->m_data = data;
54}
55
56GeoDataSimpleData &GeoDataSimpleData::operator=(const GeoDataSimpleData &rhs)
57{
58 *d = *rhs.d;
59 return *this;
60}
61
62bool GeoDataSimpleData::operator==(const GeoDataSimpleData &other) const
63{
64 return d->m_name == other.d->m_name && d->m_data == other.d->m_data;
65}
66
67bool GeoDataSimpleData::operator!=(const GeoDataSimpleData &other) const
68{
69 return !this->operator==(other);
70}
71
72const char *GeoDataSimpleData::nodeType() const
73{
74 return GeoDataTypes::GeoDataSimpleDataType;
75}
76
77void GeoDataSimpleData::pack(QDataStream &stream) const
78{
79 stream << d->m_name;
80 stream << d->m_data;
81}
82
83void GeoDataSimpleData::unpack(QDataStream &stream)
84{
85 stream >> d->m_name;
86 stream >> d->m_data;
87}
88
89}
QString name(StandardAction id)
bool operator==(const StyleDelim &l, const StyleDelim &r)
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:15:45 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.