6 #include "GeoDataSchema.h"
12 #include "GeoDataTypes.h"
13 #include "GeoDataSimpleField.h"
18 class GeoDataSchemaPrivate
25 GeoDataSchema::GeoDataSchema()
26 : d( new GeoDataSchemaPrivate )
31 : d( new GeoDataSchemaPrivate )
33 d->m_simpleField = simplefields;
36 GeoDataSchema::GeoDataSchema(
const GeoDataSchema& other )
37 : GeoDataObject( other ),
38 d( new GeoDataSchemaPrivate( *other.d ) )
42 GeoDataSchema &GeoDataSchema::operator=(
const GeoDataSchema &other)
44 GeoDataObject::operator=( other );
49 bool GeoDataSchema::operator==(
const GeoDataSchema& other)
const
51 return equals(other) &&
52 d->m_name == other.d->m_name &&
53 d->m_simpleField == other.d->m_simpleField;
56 bool GeoDataSchema::operator!=(
const GeoDataSchema& other)
const
61 GeoDataSchema::~GeoDataSchema()
66 QString GeoDataSchema::schemaName()
const
71 void GeoDataSchema::setSchemaName(
const QString& name )
76 GeoDataSimpleField& GeoDataSchema::simpleField(
const QString& name )
const
78 return d->m_simpleField[
name ];
81 void GeoDataSchema::addSimpleField(
const GeoDataSimpleField &value )
83 d->m_simpleField.insert( value.name(), value );
88 return d->m_simpleField.values();
91 const char* GeoDataSchema::nodeType()
const
93 return GeoDataTypes::GeoDataSchemaType;
96 void GeoDataSchema::pack(
QDataStream& stream )
const
98 stream << d->m_simpleField.size();
104 begin.value().pack( stream );
112 for(
int i = 0; i < size; ++i ) {
113 GeoDataSimpleField simpleField;
114 simpleField.unpack( stream );
115 d->m_simpleField.insert( simpleField.name(), simpleField );