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 &&
65 d->m_data == other.d->m_data;
66}
67
68bool GeoDataSimpleData::operator!=( const GeoDataSimpleData &other ) const
69{
70 return !this->operator==( other );
71}
72
73const char* GeoDataSimpleData::nodeType() const
74{
75 return GeoDataTypes::GeoDataSimpleDataType;
76}
77
78void GeoDataSimpleData::pack( QDataStream &stream ) const
79{
80 stream << d->m_name;
81 stream << d->m_data;
82}
83
84void GeoDataSimpleData::unpack( QDataStream &stream )
85{
86 stream >> d->m_name;
87 stream >> d->m_data;
88}
89
90}
QString name(StandardAction id)
Binds a QML item to a specific geodetic location in screen coordinates.
bool operator==(const QGraphicsApiFilter &reference, const QGraphicsApiFilter &sample)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jun 21 2024 12:00:06 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.