FDO API Reference Feature Data Objects
Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

FdoXmlFeatureWriter Class Reference

#include <FeatureWriter.h>

Inherits FdoIDisposable.

Inheritance diagram for FdoXmlFeatureWriter:

[legend]
List of all members.

Detailed Description

FdoXmlFeatureWriter writes features to an XML document. The features are written in GML format. Each feature is written in 3 steps:
  1. call SetClassDefintion() to define the feature's class name, schema name, and list of valid properties.
  2. call SetProperty() for each feature property value to set.
  3. call WriteFeature() to write the feature with the current property values. The feature's element name is derived from the class and schema name.
WriteFeature() ensures that the properties are written in their proper order. This may have slight performance implications since this writer has to accumulate the property values before writing them. If performance is a concern then FdoXmlFeaturePropertyWriter should be used instead.

Definition at line 46 of file FeatureWriter.h.


Public Member Functions

FDO_API FdoXmlFeatureWriterGetAssociationWriter (FdoString *propertyName)
 Gets a reference to an FdoXmlFeatureWriter to write the data contained in an association property. If the property is not an association property, an exception is thrown.
FDO_API FdoClassDefinitionGetClassDefinition ()
 Gets the class definition for the current feature being written.
FDO_API FdoXmlFeaturePropertyWriterGetFeaturePropertyWriter ()
 Gets the feature property writer that was passed to this object.
FDO_API FdoXmlFeatureWriterGetObjectWriter (FdoString *propertyName)
 Gets a reference to an FdoXmlFeatureWriter to write the data contained in a collection object property. If the property is not an object property, an exception is thrown.
FDO_API void SetClassDefinition (FdoClassDefinition *classDefinition)
 Sets the class definition for the current feature being written.
FDO_API void SetProperty (FdoPropertyValue *propertyValue)
 Sets a feature property.
virtual FDO_API void WriteFeature (FdoString *elementTag=NULL)
 Writes the current feature to the XML document. If all features being written are of the same class then SetClassDefinition() can be called once and the WriteFeature() can be call repeatedly. In other words, the current class definition persists across WriteFeature() calls. Similarly, Property Values also persist across WriteFeature() calls. If the next feature to write has a property with different value from current feature, then SetProperty() must be called, to change the value, before next call to WriteFeature().

Static Public Member Functions

FDO_API FdoXmlFeatureWriterCreate (FdoXmlWriter *writer, FdoXmlFeatureFlags *flags=NULL)
 Creates a Feature Writer for writing FDO features to XML.
FDO_API FdoXmlFeatureWriterCreate (FdoXmlFeaturePropertyWriter *writer, FdoXmlFeatureFlags *flags=NULL)
 Creates a Feature Writer for writing FDO features to XML.

Protected Member Functions

void _writeFeature (FdoString *elementTag, FdoClassDefinition *classDef, FdoPropertyValueCollection *propertyValues, FdoStringCollection *objectPropertyNames, FdoXmlFeatureWriterCollection *objectPropertyWriters, FdoStringCollection *associationPropertyNames, FdoXmlFeatureWriterCollection *associationPropertyWriters)
virtual void Dispose ()
 Dispose this object.
 FdoXmlFeatureWriter (FdoXmlFeaturePropertyWriter *writer, FdoXmlFeatureFlags *flags)
 FdoXmlFeatureWriter ()
virtual ~FdoXmlFeatureWriter ()

Protected Attributes

FdoPtr< FdoStringCollectionmAssociationPropertyNames
FdoPtr< FdoXmlFeatureWriterCollection > mAssociationPropertyWriters
FdoPtr< FdoClassDefinitionmClassDef
FdoPtr< FdoXmlFeatureFlagsmFlags
FdoPtr< FdoStringCollectionmObjectPropertyNames
FdoPtr< FdoXmlFeatureWriterCollection > mObjectPropertyWriters
FdoPtr< FdoPropertyValueCollectionmPropertyValues
FdoPtr< FdoXmlFeaturePropertyWritermPropertyWriter

Constructor & Destructor Documentation

FdoXmlFeatureWriter::FdoXmlFeatureWriter  )  [protected]
 

FdoXmlFeatureWriter::FdoXmlFeatureWriter FdoXmlFeaturePropertyWriter writer,
FdoXmlFeatureFlags flags
[protected]
 

virtual FdoXmlFeatureWriter::~FdoXmlFeatureWriter  )  [protected, virtual]
 


Member Function Documentation

void FdoXmlFeatureWriter::_writeFeature FdoString elementTag,
FdoClassDefinition classDef,
FdoPropertyValueCollection propertyValues,
FdoStringCollection objectPropertyNames,
FdoXmlFeatureWriterCollection *  objectPropertyWriters,
FdoStringCollection associationPropertyNames,
FdoXmlFeatureWriterCollection *  associationPropertyWriters
[protected]
 

FDO_API FdoXmlFeatureWriter* FdoXmlFeatureWriter::Create FdoXmlWriter writer,
FdoXmlFeatureFlags flags = NULL
[static]
 

Creates a Feature Writer for writing FDO features to XML.

Parameters:
writer Input XML document writer. Specifies the XML document that the features will be written to . An FdoXmlFeaturePropertyWriter is automatically wrapped around this writer. This Feature Property Writer can be retrieved by calling GetFeaturePropertyWriter().
flags Input options for controlling the writing of the features. If NULL then the flags passed to the document writer are used.
Returns:
Returns FdoXmlFeatureWriter

FDO_API FdoXmlFeatureWriter* FdoXmlFeatureWriter::Create FdoXmlFeaturePropertyWriter writer,
FdoXmlFeatureFlags flags = NULL
[static]
 

Creates a Feature Writer for writing FDO features to XML.

Parameters:
writer Input Feature Property Writer. Specifies the XML document that the features will be written to.
flags Input options for controlling the writing of the features. If NULL then the flags passed to the document writer are used.
Returns:
Returns FdoXmlFeatureWriter

virtual void FdoXmlFeatureWriter::Dispose  )  [protected, virtual]
 

Dispose this object.

Returns:
Returns nothing

Implements FdoIDisposable.

FDO_API FdoXmlFeatureWriter* FdoXmlFeatureWriter::GetAssociationWriter FdoString propertyName  ) 
 

Gets a reference to an FdoXmlFeatureWriter to write the data contained in an association property. If the property is not an association property, an exception is thrown.

Parameters:
propertyName Input the association property name.
Returns:
Returns the nested XML feature writer

FDO_API FdoClassDefinition* FdoXmlFeatureWriter::GetClassDefinition  ) 
 

Gets the class definition for the current feature being written.

Returns:
Returns FdoClassDefinition

FDO_API FdoXmlFeaturePropertyWriter* FdoXmlFeatureWriter::GetFeaturePropertyWriter  ) 
 

Gets the feature property writer that was passed to this object.

Returns:
Returns FdoXmlFeaturePropertyWriter

FDO_API FdoXmlFeatureWriter* FdoXmlFeatureWriter::GetObjectWriter FdoString propertyName  ) 
 

Gets a reference to an FdoXmlFeatureWriter to write the data contained in a collection object property. If the property is not an object property, an exception is thrown.

Parameters:
propertyName Input the object property name.
Returns:
Returns the nested XML feature writer

FDO_API void FdoXmlFeatureWriter::SetClassDefinition FdoClassDefinition classDefinition  ) 
 

Sets the class definition for the current feature being written.

Parameters:
classDefinition Input the class definition
Returns:
Returns nothing

FDO_API void FdoXmlFeatureWriter::SetProperty FdoPropertyValue propertyValue  ) 
 

Sets a feature property.

Parameters:
propertyValue Input the property name and value
Returns:
Returns nothing

virtual FDO_API void FdoXmlFeatureWriter::WriteFeature FdoString elementTag = NULL  )  [virtual]
 

Writes the current feature to the XML document. If all features being written are of the same class then SetClassDefinition() can be called once and the WriteFeature() can be call repeatedly. In other words, the current class definition persists across WriteFeature() calls. Similarly, Property Values also persist across WriteFeature() calls. If the next feature to write has a property with different value from current feature, then SetProperty() must be called, to change the value, before next call to WriteFeature().

Parameters:
elementTag The tag for the output feature/object. If elementTag is null, the class name will be used as the element tag.

Member Data Documentation

FdoPtr<FdoStringCollection> FdoXmlFeatureWriter::mAssociationPropertyNames [protected]
 

Definition at line 191 of file FeatureWriter.h.

FdoPtr<FdoXmlFeatureWriterCollection> FdoXmlFeatureWriter::mAssociationPropertyWriters [protected]
 

Definition at line 192 of file FeatureWriter.h.

FdoPtr<FdoClassDefinition> FdoXmlFeatureWriter::mClassDef [protected]
 

Definition at line 184 of file FeatureWriter.h.

FdoPtr<FdoXmlFeatureFlags> FdoXmlFeatureWriter::mFlags [protected]
 

Definition at line 183 of file FeatureWriter.h.

FdoPtr<FdoStringCollection> FdoXmlFeatureWriter::mObjectPropertyNames [protected]
 

Definition at line 188 of file FeatureWriter.h.

FdoPtr<FdoXmlFeatureWriterCollection> FdoXmlFeatureWriter::mObjectPropertyWriters [protected]
 

Definition at line 189 of file FeatureWriter.h.

FdoPtr<FdoPropertyValueCollection> FdoXmlFeatureWriter::mPropertyValues [protected]
 

Definition at line 186 of file FeatureWriter.h.

FdoPtr<FdoXmlFeaturePropertyWriter> FdoXmlFeatureWriter::mPropertyWriter [protected]
 

Definition at line 182 of file FeatureWriter.h.


The documentation for this class was generated from the following file:
Comments or suggestions? Send us feedback.