7#include "GeoDataExtendedData.h"
8#include "GeoDataExtendedData_p.h"
11#include "GeoDataTypes.h"
16GeoDataExtendedData::GeoDataExtendedData() :
19 d(new GeoDataExtendedDataPrivate)
23GeoDataExtendedData::GeoDataExtendedData(
const GeoDataExtendedData &other) :
26 d(new GeoDataExtendedDataPrivate(*other.d))
30bool GeoDataExtendedData::operator==(
const GeoDataExtendedData& other )
const
32 return d->hash == other.d->hash &&
33 d->arrayHash == other.d->arrayHash;
36GeoDataExtendedData::~GeoDataExtendedData()
38 qDeleteAll( d->arrayHash );
44 GeoNode::operator=(other);
51 return !this->operator==(other);
54const char* GeoDataExtendedData::nodeType()
const
56 return GeoDataTypes::GeoDataExtendedDataType;
59GeoDataData& GeoDataExtendedData::valueRef(
const QString& key )
const
61 return d->hash[ key ];
64GeoDataData GeoDataExtendedData::value(
const QString& key )
const
66 return d->hash.value( key );
69void GeoDataExtendedData::addValue(
const GeoDataData& data )
71 d->hash.insert( data.name(), data );
74void GeoDataExtendedData::removeKey(
const QString &key)
81 return d->hash.constBegin();
86 return d->hash.constEnd();
89int GeoDataExtendedData::size()
const
91 return d->hash.size();
94bool GeoDataExtendedData::isEmpty( )
const
96 return d->hash.empty() && d->schemaDataHash.empty();
99bool GeoDataExtendedData::contains(
const QString &key )
const
101 return d->hash.contains( key );
104void GeoDataExtendedData::setSimpleArrayData(
const QString& key, GeoDataSimpleArrayData *values )
106 d->arrayHash[ key ] = values;
109GeoDataSimpleArrayData* GeoDataExtendedData::simpleArrayData(
const QString& key )
const
111 if ( !d->arrayHash.contains( key ) )
return nullptr;
112 return d->arrayHash[ key ];
115GeoDataSchemaData& GeoDataExtendedData::schemaData(
const QString& schemaUrl )
const
117 return d->schemaDataHash[ schemaUrl ];
120void GeoDataExtendedData::addSchemaData(
const GeoDataSchemaData& schemaData )
122 d->schemaDataHash.insert( schemaData.schemaUrl(), schemaData );
123 d->schemaDataHash[schemaData.schemaUrl()].
setParent(
this );
126void GeoDataExtendedData::removeSchemaData(
const QString& schemaUrl )
128 GeoDataSchemaData schemaData = d->schemaDataHash.take( schemaUrl );
129 schemaData.setParent(
nullptr );
134 return d->schemaDataHash.values();
a class which allows to add custom data to KML Feature.
void setParent(GeoDataObject *parent)
Sets the parent of the object.
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 Sep 13 2024 11:52:59 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.