Marble

GeoDataTimeStamp.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2010 Harshit Jain <hjain.itbhu@gmail.com>
4//
5
6// Own
7#include "GeoDataTimeStamp.h"
8
9// Private
10#include "GeoDataTimeStamp_p.h"
11
12// Qt
13#include <QDataStream>
14
15// GeoData
16#include "GeoDataTypes.h"
17
18namespace Marble
19{
20
21GeoDataTimeStamp::GeoDataTimeStamp()
22 : GeoDataTimePrimitive()
23 , d(new GeoDataTimeStampPrivate)
24{
25}
26
27GeoDataTimeStamp::GeoDataTimeStamp(const GeoDataTimeStamp &other)
28 : GeoDataTimePrimitive(other)
29 , d(new GeoDataTimeStampPrivate(*other.d))
30{
31}
32
33GeoDataTimeStamp::~GeoDataTimeStamp()
34{
35 delete d;
36}
37
38GeoDataTimeStamp &GeoDataTimeStamp::operator=(const GeoDataTimeStamp &other)
39{
40 GeoDataTimePrimitive::operator=(other);
41 *d = *other.d;
42 return *this;
43}
44
45bool GeoDataTimeStamp::operator==(const GeoDataTimeStamp &other) const
46{
47 return equals(other) && d->m_resolution == other.d->m_resolution && d->m_when == other.d->m_when;
48}
49
50bool GeoDataTimeStamp::operator!=(const GeoDataTimeStamp &other) const
51{
52 return !this->operator==(other);
53}
54
55const char *GeoDataTimeStamp::nodeType() const
56{
57 return GeoDataTypes::GeoDataTimeStampType;
58}
59
60QDateTime GeoDataTimeStamp::when() const
61{
62 return d->m_when;
63}
64
65void GeoDataTimeStamp::setWhen(const QDateTime &when)
66{
67 d->m_when = when;
68}
69
70void GeoDataTimeStamp::setResolution(GeoDataTimeStamp::TimeResolution resolution)
71{
72 d->m_resolution = resolution;
73}
74
75GeoDataTimeStamp::TimeResolution GeoDataTimeStamp::resolution() const
76{
77 return d->m_resolution;
78}
79
80void GeoDataTimeStamp::pack(QDataStream &stream) const
81{
82 GeoDataTimePrimitive::pack(stream);
83
84 stream << d->m_when;
85}
86
87void GeoDataTimeStamp::unpack(QDataStream &stream)
88{
89 GeoDataTimePrimitive::unpack(stream);
90
91 stream >> d->m_when;
92}
93
94}
bool equals(const QVariant &lhs, const QVariant &rhs)
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 Fri Nov 8 2024 12:02:43 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.