FDO .NET API Reference | Feature Data Objects |
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 FdoXmlFeatureWriter; 00022 00023 BEGIN_NAMESPACE_OSGEO_COMMON_XML 00024 public __gc class XmlWriter; 00025 END_NAMESPACE_OSGEO_COMMON_XML 00026 00027 BEGIN_NAMESPACE_OSGEO_FDO_SCHEMA 00028 public __gc class ClassDefinition; 00029 END_NAMESPACE_OSGEO_FDO_SCHEMA 00030 00031 BEGIN_NAMESPACE_OSGEO_FDO_COMMANDS 00032 public __gc class PropertyValue; 00033 END_NAMESPACE_OSGEO_FDO_COMMANDS 00034 00035 BEGIN_NAMESPACE_OSGEO_FDO_XML 00036 public __gc class XmlFeaturePropertyWriter; 00037 public __gc class XmlFeatureFlags; 00038 00039 /// \ingroup (OSGeoFDOXml) 00040 /// \brief 00041 /// XmlFeatureWriter writes features to an XML document. The features are 00042 /// written in GML format. Each feature is written in 3 steps: 00043 /// <ol> 00044 /// <li> call SetClassDefintion() to define the feature's class name, 00045 /// schema name, and list of valid properties. 00046 /// <li> call SetProperty() for each feature property value to set. 00047 /// <li> call WriteFeature() to write the feature with the current 00048 /// property values. The feature's element name is derived from the 00049 /// class and schema name. 00050 /// </ol> 00051 /// WriteFeature() ensures that the properties are written in their proper order. This 00052 /// may have slight performance implications since this writer has to accumulate the 00053 /// property values before writing them. If performance is a concern then 00054 /// XmlFeaturePropertyWriter should be used instead. 00055 public __gc class XmlFeatureWriter : public NAMESPACE_OSGEO_RUNTIME::Disposable 00056 { 00057 public: 00058 /// \brief 00059 /// Creates a Feature Writer for writing FDO features to XML. 00060 /// 00061 /// \param writer 00062 /// Input Feature Property Writer. Specifies the XML 00063 /// document that the features will be written to. 00064 /// \param flags 00065 /// Input options for controlling the writing of the features. If NULL then the 00066 /// flags passed to the document writer are used. 00067 /// 00068 /// \return 00069 /// Returns XmlFeatureWriter 00070 /// 00071 XmlFeatureWriter(NAMESPACE_OSGEO_FDO_XML::XmlFeaturePropertyWriter* writer, NAMESPACE_OSGEO_FDO_XML::XmlFeatureFlags* flags); 00072 XmlFeatureWriter(NAMESPACE_OSGEO_FDO_XML::XmlFeaturePropertyWriter* writer); 00073 00074 /// \brief 00075 /// Creates a Feature Writer for writing FDO features to XML. 00076 /// 00077 /// \param writer 00078 /// Input XML document writer. Specifies the XML document that the features will be written 00079 /// to . An XmlFeaturePropertyWriter is automatically wrapped 00080 /// around this writer. This Feature Property Writer can be retrieved by calling 00081 /// GetFeaturePropertyWriter(). 00082 /// \param flags 00083 /// Input options for controlling the writing of the features. If NULL then the 00084 /// flags passed to the document writer are used. 00085 /// 00086 /// \return 00087 /// Returns XmlFeatureWriter 00088 /// 00089 XmlFeatureWriter(NAMESPACE_OSGEO_COMMON_XML::XmlWriter* writer, NAMESPACE_OSGEO_FDO_XML::XmlFeatureFlags* flags); 00090 XmlFeatureWriter(NAMESPACE_OSGEO_COMMON_XML::XmlWriter* writer); 00091 00092 /// \brief 00093 /// Gets the feature property writer that was passed to this object. 00094 /// 00095 /// \return 00096 /// Returns XmlFeaturePropertyWriter 00097 /// 00098 __property NAMESPACE_OSGEO_FDO_XML::XmlFeaturePropertyWriter* get_FeaturePropertyWriter(); 00099 00100 /// \brief 00101 /// Gets the class definition for the current feature being written. 00102 /// 00103 /// \return 00104 /// Returns ClassDefinition 00105 /// 00106 __property NAMESPACE_OSGEO_FDO_SCHEMA::ClassDefinition* get_ClassDefinition(); 00107 00108 /// \brief 00109 /// Sets the class definition for the current feature being written. 00110 /// 00111 /// \param classDefinition 00112 /// Input the class definition 00113 /// 00114 /// \return 00115 /// Returns nothing 00116 /// 00117 __property System::Void set_ClassDefinition(NAMESPACE_OSGEO_FDO_SCHEMA::ClassDefinition* classDefinition); 00118 00119 /// \brief 00120 /// Sets a feature property. 00121 /// 00122 /// \param propertyValue 00123 /// Input the property name and value 00124 /// 00125 /// \return 00126 /// Returns nothing 00127 /// 00128 __property System::Void set_Property(NAMESPACE_OSGEO_FDO_COMMANDS::PropertyValue* propertyValue); 00129 00130 /// \brief 00131 /// Gets a reference to an XmlFeatureWriter to write the data contained 00132 /// in a collection object property. If the property is not an object property, an 00133 /// exception is thrown. 00134 /// 00135 /// \param propertyName 00136 /// Input the object property name. 00137 /// 00138 /// \return 00139 /// Returns the nested XML feature writer 00140 /// 00141 __property NAMESPACE_OSGEO_FDO_XML::XmlFeatureWriter* get_ObjectWriter(System::String* propertyName); 00142 00143 /// \brief 00144 /// Gets a reference to an XmlFeatureWriter to write the data contained 00145 /// in an association property. If the property is not an association property, an 00146 /// exception is thrown. 00147 /// 00148 /// \param propertyName 00149 /// Input the association property name. 00150 /// 00151 /// \return 00152 /// Returns the nested XML feature writer 00153 /// 00154 __property NAMESPACE_OSGEO_FDO_XML::XmlFeatureWriter* get_AssociationWriter(System::String* propertyName); 00155 00156 /// \brief 00157 /// Writes the current feature to the XML document. 00158 /// If all features being written are of the same class then SetClassDefinition() 00159 /// can be called once and the WriteFeature() can be call repeatedly. In other words, 00160 /// the current class definition persists across WriteFeature() calls. Similarly, 00161 /// Property Values also persist across WriteFeature() calls. If the next feature 00162 /// to write has a property with different value from current feature, then 00163 /// SetProperty() must be called, to change the value, before next call to 00164 /// WriteFeature(). 00165 /// 00166 /// \param elementTag 00167 /// The tag for the output feature/object. If elementTag is null, the class name 00168 /// will be used as the element tag. 00169 /// 00170 System::Void WriteFeature(System::String* elementTag); 00171 System::Void WriteFeature(); 00172 00173 public private: 00174 XmlFeatureWriter(System::IntPtr unmanaged, System::Boolean autoDelete); 00175 00176 inline FdoXmlFeatureWriter* GetImpObj(); 00177 00178 /// \cond DOXYGEN-IGNORE 00179 protected: 00180 System::Void ReleaseUnmanagedObject(); 00181 /// \endcond 00182 }; 00183 00184 END_NAMESPACE_OSGEO_FDO_XML 00185 00186
Comments or suggestions? Send us feedback. |