FDO .NET API Reference Feature Data Objects
Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

OSGeo::FDO::Xml::XmlFeatureReader Class Reference

Inherits OSGeo::FDO::Xml::XmlFeatureHandler.

Inheritance diagram for OSGeo::FDO::Xml::XmlFeatureReader:

[legend]
List of all members.

Detailed Description

XmlFeatureReader reads GML format features from a XML document. The reading is done procedurally, rather than through events.

Remarks:
Each feature can be read in 3 steps:
  1. call ReadNext() to get the next feature.
  2. call GetClassDefinition() to get the current feature's property list.
  3. call GetProperty() for each feature property to retrieve.
This class allows random access to the properties of the current feature, meaning that ReadNext() accumulates a list of these properties. This may have slight performance implications. If performance is a concern then XmlFeaturePropertyReader should be used instead.


Public Member Functions

System::Void Close ()
 Closes the IFeatureReader object, freeing any resources it may be holding.
__property OSGeo::FDO::Schema::FeatureSchemaCollectionget_FeatureSchemas ()
 Gets the feature schemas describing the features being read.
System::Boolean GetBoolean (System::String *name)
 Gets the Boolean value of the specified property. No conversion is performed, thus the property must be DataType_Boolean or an exception is thrown.
System::Byte GetByte (System::String *name)
 Gets the byte value of the specified property. No conversion is performed, thus the property must be DataType_Byte or an exception is thrown.
OSGeo::FDO::Schema::ClassDefinitionGetClassDefinition ()
 Gets the definition of the object currently being read. If the user has requested only a subset of the class properties, the class definition reflects what the user has asked, rather than the full class definition.
System::DateTime GetDateTime (System::String *name)
 Gets the date and time value of the specified property. No conversion is performed, thus the property must be DataType_DateTime or an exception is thrown.
System::Int32 GetDepth ()
 Gets a value indicating the depth of nesting for the current reader. The depth value increases each time GetFeatureObject is called and a new reader is returned. The outermost reader has a depth of 0.
System::Double GetDouble (System::String *name)
 Gets the double-precision floating point value of the specified property. No conversion is performed, thus the property must be DataType_Double or an exception is thrown.
OSGeo::FDO::Commands::Feature::IFeatureReaderGetFeatureObject (System::String *propertyName)
 Gets a reference to an IFeatureReader to read the data contained in the object or object collection property. If the property is not an object property, an exception is thrown.
OSGeo::FDO::Xml::XmlFeaturePropertyReaderGetFeaturePropertyReader ()
 Gets the feature property reader that was passed to this object.
System::Byte GetGeometry (System::String *name)[]
 Gets the geometry value of the specified property as a byte array in FGF format. Because no conversion is performed, the property must be of Geometric type; otherwise, an exception is thrown.
System::Int16 GetInt16 (System::String *name)
 Gets the 16-bit integer value of the specified property. No conversion is performed, thus the property must be DataType_Int16 or an exception is thrown.
System::Int32 GetInt32 (System::String *name)
 Gets the 32-bit integer value of the specified property. No conversion is performed, thus the property must be DataType_Int32 or an exception is thrown.
System::Int64 GetInt64 (System::String *name)
 Gets the 64-bit integer value of the specified property. No conversion is performed, thus the property must be DataType_Int64 or an exception is thrown.
OSGeo::FDO::Expression::LOBValueGetLOB (System::String *name)
 Gets a LOBValue reference. The LOB is fully read in and data available. Because no conversion is performed, the property must be DataType_BLOB or DataType_CLOB etc. (a LOB type).
OSGeo::FDO::Common::IStreamReaderGetLOBStreamReader (System::String *name)
 Gets a reference of the specified LOB property as a BLOBStreamReader or CLOBStreamReader etc. to allow reading in blocks of data. Because no conversion is performed, the property must be DataType_BLOB or DataType_CLOB etc. (a LOB type) Cast the IStreamReader to the appropiate LOB Stream Reader.
OSGeo::FDO::Raster::IRasterGetRaster (System::String *name)
 Gets the raster object of the specified property. Because no conversion is performed, the property must be of Raster type; otherwise, an exception is thrown.
System::Single GetSingle (System::String *name)
 Gets the Single floating point value of the specified property. No conversion is performed, thus the property must be DataType_Single or an exception is thrown.
System::String * GetString (System::String *name)
 Gets the string value of the specified property. No conversion is performed, thus the property must be DataType_String or an exception is thrown.
System::Boolean IsNull (System::String *name)
 Returns true if the value of the specified property is null.
System::Boolean ReadNext ()
 Advances the reader to the next item and returns true if there is another object to read or false if reading is complete. The default position of the reader is prior to the first item. Thus you must call ReadNext to begin accessing any data.
__property System::Void set_FeatureSchemas (OSGeo::FDO::Schema::FeatureSchemaCollection *schemas)
 Sets the feature schemas describing the features being read.
 XmlFeatureReader (OSGeo::FDO::Common::Xml::XmlReader *reader, OSGeo::FDO::Xml::XmlFeatureFlags *flags)
 creates a Feature Reader for reading features from XML.
 XmlFeatureReader (OSGeo::FDO::Common::Xml::XmlReader *reader)
 creates a Feature Reader for reading features from XML.

Constructor & Destructor Documentation

OSGeo::FDO::Xml::XmlFeatureReader::XmlFeatureReader OSGeo::FDO::Common::Xml::XmlReader reader  ) 
 

creates a Feature Reader for reading features from XML.

Parameters:
reader Input XML document reader. Please refer to the reader parameter of XmlFeaturePropertyReader::Create() for a description of how the features are read from the document. An XmlFeaturePropertyReader is automatically wrapped around this reader. This Feature Property Reader can be retrieved by calling GetFeaturePropertyReader().

OSGeo::FDO::Xml::XmlFeatureReader::XmlFeatureReader OSGeo::FDO::Common::Xml::XmlReader reader,
OSGeo::FDO::Xml::XmlFeatureFlags flags
 

creates a Feature Reader for reading features from XML.

Parameters:
reader Input XML document reader. Please refer to the reader parameter of XmlFeaturePropertyReader::Create() for a description of how the features are read from the document. An XmlFeaturePropertyReader is automatically wrapped around this reader. This Feature Property Reader can be retrieved by calling GetFeaturePropertyReader().
flags Input options for controlling the deserializing of the features. If NULL then the default flags are used.

Member Function Documentation

System::Void OSGeo::FDO::Xml::XmlFeatureReader::Close  ) 
 

Closes the IFeatureReader object, freeing any resources it may be holding.

__property OSGeo ::FDO ::Schema ::FeatureSchemaCollection* OSGeo::FDO::Xml::XmlFeatureReader::get_FeatureSchemas  ) 
 

Gets the feature schemas describing the features being read.

Returns:
Returns FeatureSchemaCollection

System::Boolean OSGeo::FDO::Xml::XmlFeatureReader::GetBoolean System::String *  name  ) 
 

Gets the Boolean value of the specified property. No conversion is performed, thus the property must be DataType_Boolean or an exception is thrown.

Parameters:
name Input the property name.
Returns:
Returns the Boolean value.

System::Byte OSGeo::FDO::Xml::XmlFeatureReader::GetByte System::String *  name  ) 
 

Gets the byte value of the specified property. No conversion is performed, thus the property must be DataType_Byte or an exception is thrown.

Parameters:
name Input the property name.
Returns:
Returns the byte value.

OSGeo ::FDO ::Schema ::ClassDefinition* OSGeo::FDO::Xml::XmlFeatureReader::GetClassDefinition  ) 
 

Gets the definition of the object currently being read. If the user has requested only a subset of the class properties, the class definition reflects what the user has asked, rather than the full class definition.

Returns:
Returns the class definition object.

System::DateTime OSGeo::FDO::Xml::XmlFeatureReader::GetDateTime System::String *  name  ) 
 

Gets the date and time value of the specified property. No conversion is performed, thus the property must be DataType_DateTime or an exception is thrown.

Parameters:
name Input the property name.
Returns:
Returns the date and time value.

System::Int32 OSGeo::FDO::Xml::XmlFeatureReader::GetDepth  ) 
 

Gets a value indicating the depth of nesting for the current reader. The depth value increases each time GetFeatureObject is called and a new reader is returned. The outermost reader has a depth of 0.

Returns:
Returns the depth

System::Double OSGeo::FDO::Xml::XmlFeatureReader::GetDouble System::String *  name  ) 
 

Gets the double-precision floating point value of the specified property. No conversion is performed, thus the property must be DataType_Double or an exception is thrown.

Parameters:
name Input the property name.
Returns:
Returns the double floating point value

OSGeo ::FDO ::Commands ::Feature ::IFeatureReader* OSGeo::FDO::Xml::XmlFeatureReader::GetFeatureObject System::String *  propertyName  ) 
 

Gets a reference to an IFeatureReader to read the data contained in the object or object collection property. If the property is not an object property, an exception is thrown.

Parameters:
propertyName Input the property name.
Returns:
Returns the nested feature reader

OSGeo ::FDO ::Xml ::XmlFeaturePropertyReader* OSGeo::FDO::Xml::XmlFeatureReader::GetFeaturePropertyReader  ) 
 

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

Returns:
Returns XmlFeaturePropertyReader

System::Byte OSGeo::FDO::Xml::XmlFeatureReader::GetGeometry System::String *  name  ) 
 

Gets the geometry value of the specified property as a byte array in FGF format. Because no conversion is performed, the property must be of Geometric type; otherwise, an exception is thrown.

Parameters:
name Input the property name.
Returns:
Returns the byte array in FGF format.

System::Int16 OSGeo::FDO::Xml::XmlFeatureReader::GetInt16 System::String *  name  ) 
 

Gets the 16-bit integer value of the specified property. No conversion is performed, thus the property must be DataType_Int16 or an exception is thrown.

Parameters:
name Input the property name.
Returns:
Returns the System::Int16 value.

System::Int32 OSGeo::FDO::Xml::XmlFeatureReader::GetInt32 System::String *  name  ) 
 

Gets the 32-bit integer value of the specified property. No conversion is performed, thus the property must be DataType_Int32 or an exception is thrown.

Parameters:
name Input the property name.
Returns:
Returns the System::Int32 value

System::Int64 OSGeo::FDO::Xml::XmlFeatureReader::GetInt64 System::String *  name  ) 
 

Gets the 64-bit integer value of the specified property. No conversion is performed, thus the property must be DataType_Int64 or an exception is thrown.

Parameters:
name Input the property name.
Returns:
Returns the System::Int63 value.

OSGeo ::FDO ::Expression ::LOBValue* OSGeo::FDO::Xml::XmlFeatureReader::GetLOB System::String *  name  ) 
 

Gets a LOBValue reference. The LOB is fully read in and data available. Because no conversion is performed, the property must be DataType_BLOB or DataType_CLOB etc. (a LOB type).

Parameters:
name Input the property name.
Returns:
Returns the reference to LOBValue

OSGeo ::FDO ::Common ::IStreamReader* OSGeo::FDO::Xml::XmlFeatureReader::GetLOBStreamReader System::String *  name  ) 
 

Gets a reference of the specified LOB property as a BLOBStreamReader or CLOBStreamReader etc. to allow reading in blocks of data. Because no conversion is performed, the property must be DataType_BLOB or DataType_CLOB etc. (a LOB type) Cast the IStreamReader to the appropiate LOB Stream Reader.

Parameters:
name Input the property name.
Returns:
Returns a reference to a LOB stream reader

OSGeo ::FDO ::Raster ::IRaster* OSGeo::FDO::Xml::XmlFeatureReader::GetRaster System::String *  name  ) 
 

Gets the raster object of the specified property. Because no conversion is performed, the property must be of Raster type; otherwise, an exception is thrown.

Parameters:
name Input the property name.
Returns:
Returns the raster object.

System::Single OSGeo::FDO::Xml::XmlFeatureReader::GetSingle System::String *  name  ) 
 

Gets the Single floating point value of the specified property. No conversion is performed, thus the property must be DataType_Single or an exception is thrown.

Parameters:
name Input the property name.
Returns:
Returns the single value

System::String* OSGeo::FDO::Xml::XmlFeatureReader::GetString System::String *  name  ) 
 

Gets the string value of the specified property. No conversion is performed, thus the property must be DataType_String or an exception is thrown.

Parameters:
name Input the property name.
Returns:
Returns the string value

System::Boolean OSGeo::FDO::Xml::XmlFeatureReader::IsNull System::String *  name  ) 
 

Returns true if the value of the specified property is null.

Parameters:
name Input the property name.
Returns:
Returns true if the value is null.

System::Boolean OSGeo::FDO::Xml::XmlFeatureReader::ReadNext  ) 
 

Advances the reader to the next item and returns true if there is another object to read or false if reading is complete. The default position of the reader is prior to the first item. Thus you must call ReadNext to begin accessing any data.

Returns:
Returns true if there is a next item.

__property System::Void OSGeo::FDO::Xml::XmlFeatureReader::set_FeatureSchemas OSGeo::FDO::Schema::FeatureSchemaCollection schemas  ) 
 

Sets the feature schemas describing the features being read.

Remarks:
The feature schemas provide directions on how to deserialize the features and convert their property values from the strings in the XML document to their proper types. If any feature, whose class definition is not present in these schemas, is encountered then one of the following is done:
  • an exception is thrown when flags->errorLevel is Normal or higher. The exception reports all such features.
  • these features are silently skipped When the flags->errorLevel is below Normal.
Parameters:
schemas Input the feature schemas

Comments or suggestions? Send us feedback.