Marble

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

KDE's Doxygen guidelines are available online.