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(), d( new GeoDataTimeStampPrivate )
23{
24}
25
26GeoDataTimeStamp::GeoDataTimeStamp( const GeoDataTimeStamp& other )
27 : GeoDataTimePrimitive( other ) , d( new GeoDataTimeStampPrivate( *other.d ) )
28{
29}
30
31GeoDataTimeStamp::~GeoDataTimeStamp()
32{
33 delete d;
34}
35
36GeoDataTimeStamp& GeoDataTimeStamp::operator=( const GeoDataTimeStamp& other )
37{
38 GeoDataTimePrimitive::operator=( other );
39 *d = *other.d;
40 return *this;
41}
42
43bool GeoDataTimeStamp::operator==( const GeoDataTimeStamp& other ) const
44{
45 return equals(other) &&
46 d->m_resolution == other.d->m_resolution &&
47 d->m_when == other.d->m_when;
48}
49
50bool GeoDataTimeStamp::operator!=( const GeoDataTimeStamp& other ) const
51{
52 return !this->operator==( other );
53}
54
55
56const char* GeoDataTimeStamp::nodeType() const
57{
58 return GeoDataTypes::GeoDataTimeStampType;
59}
60
61QDateTime GeoDataTimeStamp::when() const
62{
63 return d->m_when;
64}
65
66void GeoDataTimeStamp::setWhen( const QDateTime& when )
67{
68 d->m_when = when;
69}
70
71void GeoDataTimeStamp::setResolution( GeoDataTimeStamp::TimeResolution resolution )
72{
73 d->m_resolution = resolution;
74}
75
76GeoDataTimeStamp::TimeResolution GeoDataTimeStamp::resolution() const
77{
78 return d->m_resolution;
79}
80
81void GeoDataTimeStamp::pack( QDataStream& stream ) const
82{
83 GeoDataTimePrimitive::pack( stream );
84
85 stream << d->m_when;
86}
87
88void GeoDataTimeStamp::unpack( QDataStream& stream )
89{
90 GeoDataTimePrimitive::unpack( stream );
91
92 stream >> d->m_when;
93}
94
95}
bool equals(const QVariant &lhs, const QVariant &rhs)
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 Tue Mar 26 2024 11:18:17 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.