File indexing completed on 2024-05-12 03:50:08

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2013 Sanjiban Bairagya <sanjiban22393@gmail.com>
0004 //
0005 
0006 #include "GeoDataAlias.h"
0007 #include "GeoDataTypes.h"
0008 
0009 namespace Marble {
0010 
0011 class GeoDataAliasPrivate
0012 {
0013 public:
0014     QString m_sourceHref;
0015     QString m_targetHref;
0016 
0017     GeoDataAliasPrivate();
0018 };
0019 
0020 GeoDataAliasPrivate::GeoDataAliasPrivate() :
0021     m_sourceHref(), m_targetHref()
0022 {
0023     // nothing to do
0024 }
0025 
0026 GeoDataAlias::GeoDataAlias() : d( new GeoDataAliasPrivate )
0027 {
0028     // nothing to do
0029 }
0030 
0031 GeoDataAlias::GeoDataAlias( const Marble::GeoDataAlias &other ) :
0032    GeoNode( other ), d( new GeoDataAliasPrivate( *other.d ) )
0033 {
0034     // nothing to do
0035 }
0036 
0037 GeoDataAlias &GeoDataAlias::operator=( const GeoDataAlias &other )
0038 {
0039     *d = *other.d;
0040     return *this;
0041 }
0042 
0043 bool GeoDataAlias::operator==( const GeoDataAlias &other ) const
0044 {
0045     return ( d->m_sourceHref == other.d->m_sourceHref ) && ( d->m_targetHref == other.d->m_targetHref );
0046 }
0047 
0048 bool GeoDataAlias::operator!=( const GeoDataAlias &other ) const
0049 {
0050     return !this->operator==(other);
0051 }
0052 
0053 GeoDataAlias::~GeoDataAlias()
0054 {
0055     delete d;
0056 }
0057 
0058 const char *GeoDataAlias::nodeType() const
0059 {
0060     return GeoDataTypes::GeoDataAliasType;
0061 }
0062 
0063 QString GeoDataAlias::sourceHref() const
0064 {
0065     return d->m_sourceHref;
0066 }
0067 
0068 QString GeoDataAlias::targetHref() const
0069 {
0070     return d->m_targetHref;
0071 }
0072 
0073 void GeoDataAlias::setSourceHref( const QString& sourceHref )
0074 {
0075     d->m_sourceHref = sourceHref;
0076 }
0077 
0078 void GeoDataAlias::setTargetHref( const QString& targetHref )
0079 {
0080     d->m_targetHref = targetHref;
0081 }
0082 
0083 }