FDO .NET API Reference Feature Data Objects

mgXmlFeaturePropertyReader.h

Go to the documentation of this file.
00001 /*
00002 * Copyright (C) 2004-2006  Autodesk, Inc.
00003 * 
00004 * This library is free software; you can redistribute it and/or
00005 * modify it under the terms of version 2.1 of the GNU Lesser
00006 * General Public License as published by the Free Software Foundation.
00007 * 
00008 * This library is distributed in the hope that it will be useful,
00009 * but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 * Lesser General Public License for more details.
00012 * 
00013 * You should have received a copy of the GNU Lesser General Public
00014 * License along with this library; if not, write to the Free Software
00015 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00016 *
00017 */
00018 
00019 #pragma  once
00020 
00021 class FdoXmlFeaturePropertyReader;
00022 
00023 BEGIN_NAMESPACE_OSGEO_COMMON_XML
00024 public __gc class XmlReader;
00025 END_NAMESPACE_OSGEO_COMMON_XML
00026 
00027 BEGIN_NAMESPACE_OSGEO_FDO_SCHEMA
00028 public __gc class FeatureSchemaCollection;
00029 END_NAMESPACE_OSGEO_FDO_SCHEMA
00030 
00031 BEGIN_NAMESPACE_OSGEO_FDO_XML
00032 public __gc class XmlFeatureContext;
00033 public __gc class XmlFeatureHandler;
00034 public __gc class XmlFeatureFlags;
00035 
00036 /// \ingroup (OSGeoFDOXml)
00037 /// \brief
00038 /// XmlFeaturePropertyReader reads features from an XML document. The reading
00039 /// is event driven. As features and properties within features are encountered, the 
00040 /// invoker is notified through the XmlFeatureHandler interface. This class is 
00041 /// similar to XmlFeatureReader except that it provides better performance.
00042 public __gc class XmlFeaturePropertyReader : public NAMESPACE_OSGEO_COMMON_XML::XmlSaxHandler
00043 {
00044 public:
00045     /// \brief
00046     /// creates a Feature Property Reader.
00047     /// 
00048     /// \remarks
00049     /// The XML element, at the document reader's current position, is recognized as a feature 
00050     /// collection if it is one or more of the following: 
00051     /// <ul>
00052     ///     <li> GML FeatureCollection element
00053     ///     <li> the element specified by flags->collectionUri and flags->collectionName
00054     ///     <li> it has a corresponding class definition, in the given schemas, that 
00055     ///   derives from the GML AbstractFeatureCollectionType.
00056     /// </ul>
00057     /// 
00058     /// \param reader 
00059     /// Input XML document reader.
00060     /// If this reader is currently positioned at a feature 
00061     /// collection type element then all features in this element are read. Otherwise, 
00062     /// it processes all Feature Collection type sub-elements of the current element 
00063     /// and reads their features. Therefore, if the reader is at the start of the XML 
00064     /// document, all top-level feature collections in the document are read.
00065     /// 
00066     XmlFeaturePropertyReader(NAMESPACE_OSGEO_COMMON_XML::XmlReader* reader);
00067 
00068     /// \brief
00069     /// creates a Feature Property Reader.
00070     /// 
00071     /// \remarks
00072     /// The XML element, at the document reader's current position, is recognized as a feature 
00073     /// collection if it is one or more of the following: 
00074     /// <ul>
00075     ///     <li> GML FeatureCollection element
00076     ///     <li> the element specified by flags->collectionUri and flags->collectionName
00077     ///     <li> it has a corresponding class definition, in the given schemas, that 
00078     ///   derives from the GML AbstractFeatureCollectionType.
00079     /// </ul>
00080     /// 
00081     /// \param reader 
00082     /// Input XML document reader.
00083     /// If this reader is currently positioned at a feature 
00084     /// collection type element then all features in this element are read. Otherwise, 
00085     /// it processes all Feature Collection type sub-elements of the current element 
00086     /// and reads their features. Therefore, if the reader is at the start of the XML 
00087     /// document, all top-level feature collections in the document are read.
00088     /// \param flags 
00089     /// Input options for controlling the deserializing of the features. If NULL then 
00090     /// the default flags are used.
00091     /// 
00092     XmlFeaturePropertyReader(NAMESPACE_OSGEO_COMMON_XML::XmlReader* reader, NAMESPACE_OSGEO_FDO_XML::XmlFeatureFlags* flags);
00093 
00094     /// \brief
00095     /// Gets the Xml document reader that was passed to this object.
00096     /// 
00097     /// \return
00098     /// Returns XmlReader.
00099     /// 
00100     NAMESPACE_OSGEO_COMMON_XML::XmlReader* GetXmlReader();
00101 
00102     /// \brief
00103     /// Gets the feature schemas describing the features being read.
00104     /// 
00105     /// \return
00106     /// Returns FeatureSchemaCollection
00107     /// 
00108     __property NAMESPACE_OSGEO_FDO_SCHEMA::FeatureSchemaCollection* get_FeatureSchemas();
00109 
00110     /// \brief
00111     /// Sets the feature schemas describing the features being read.
00112     /// 
00113     /// \remarks
00114     /// The feature schemas provide directions to this class on how to deserialize the 
00115     /// features and convert their property values from the strings in the XML document
00116     /// to their proper types. If any feature, whose class definition is not present 
00117     /// in these schemas, is encountered then one of the following is done:
00118     /// <ul>
00119     ///     <li> an exception is thrown when flags->errorLevel is Normal or higher. The 
00120     ///   exception reports all such features.
00121     ///     <li> the feature is read according to a best default translation when the 
00122     ///   flags->errorLevel is below Normal.
00123     /// </ul>
00124     /// 
00125     /// \param schemas 
00126     /// Input the feature schemas
00127     /// 
00128     /// \return
00129     /// Returns nothing
00130     /// 
00131     __property System::Void set_FeatureSchemas(NAMESPACE_OSGEO_FDO_SCHEMA::FeatureSchemaCollection* schemas);
00132 
00133     /// \brief
00134     /// Parses the XML document.
00135     /// 
00136     /// \return
00137     /// Returns false if no feature(s) were read.
00138     /// 
00139     System::Boolean Parse();
00140 
00141     /// \brief
00142     /// Parses the XML document.
00143     /// 
00144     /// \param featureHandler 
00145     /// Input handler to receive events. Parse() fires various events as features and
00146     /// properties are encountered.
00147     /// 
00148     /// \return
00149     /// Returns false if no feature(s) were read.
00150     /// 
00151     System::Boolean Parse(NAMESPACE_OSGEO_FDO_XML::XmlFeatureHandler* featureHandler);
00152 
00153     /// \brief
00154     /// Parses the XML document.
00155     /// 
00156     /// \param featureHandler 
00157     /// Input handler to receive events. Parse() fires various events as features and
00158     /// properties are encountered.
00159     /// \param featureContext 
00160     /// Input Caller-specific contextual information that is pass to the feature 
00161     /// handler event callbacks.
00162     /// 
00163     /// \return
00164     /// Returns false if no feature(s) were read.
00165     /// 
00166     System::Boolean Parse(NAMESPACE_OSGEO_FDO_XML::XmlFeatureHandler* featureHandler, NAMESPACE_OSGEO_FDO_XML::XmlFeatureContext* featureContext);
00167 
00168     /// \brief
00169     /// Parses the XML document.
00170     /// 
00171     /// \param featureHandler 
00172     /// Input handler to receive events. Parse() fires various events as features and
00173     /// properties are encountered.
00174     /// \param featureContext 
00175     /// Input Caller-specific contextual information that is pass to the feature 
00176     /// handler event callbacks.
00177     /// \param incremental 
00178     /// Input 
00179     /// true: an incremental (progressive) parse is performed. This function returns after the 
00180     /// next feature is read. 
00181     /// false: this function keeps going until all features have been read.
00182     /// 
00183     /// \return
00184     /// Returns false if no feature(s) were read.
00185     /// 
00186     System::Boolean Parse(NAMESPACE_OSGEO_FDO_XML::XmlFeatureHandler* featureHandler, NAMESPACE_OSGEO_FDO_XML::XmlFeatureContext* featureContext, System::Boolean incremental);
00187 
00188     /// \brief
00189     /// Indicates whether all features have been read
00190     /// 
00191     /// \return
00192     /// Returns true if there are no more features to read , false otherwise
00193     /// 
00194     System::Boolean GetEOF();
00195 
00196 public private:
00197     XmlFeaturePropertyReader(System::IntPtr unmanaged, System::Boolean autoDelete) : NAMESPACE_OSGEO_COMMON_XML::XmlSaxHandler(unmanaged, autoDelete)
00198     {
00199         
00200     }
00201 
00202     inline FdoXmlFeaturePropertyReader* GetImpObj();
00203 
00204 /// \cond DOXYGEN-IGNORE
00205 protected:
00206     System::Void ReleaseUnmanagedObject();
00207 /// \endcond
00208 };
00209 
00210 END_NAMESPACE_OSGEO_FDO_XML
00211 
00212 

Comments or suggestions? Send us feedback.