FDO API Reference | Feature Data Objects |
00001 #ifndef FDO_XML_SPATIALCONTEXTFLAGS_H 00002 #define FDO_XML_SPATIALCONTEXTFLAGS_H 00003 00004 // 00005 // Copyright (C) 2004-2006 Autodesk, Inc. 00006 // 00007 // This library is free software; you can redistribute it and/or 00008 // modify it under the terms of version 2.1 of the GNU Lesser 00009 // General Public License as published by the Free Software Foundation. 00010 // 00011 // This library is distributed in the hope that it will be useful, 00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 // Lesser General Public License for more details. 00015 // 00016 // You should have received a copy of the GNU Lesser General Public 00017 // License along with this library; if not, write to the Free Software 00018 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00019 // 00020 00021 #ifdef _WIN32 00022 #pragma once 00023 #endif 00024 00025 #include <FdoStd.h> 00026 #include <Fdo/Xml/Flags.h> 00027 00028 /// \brief 00029 /// FdoXmlSpatialContextFlags extends FdoXmlFlags to specify flags 00030 /// specific to Spatial Contexts. 00031 class FdoXmlSpatialContextFlags : public FdoXmlFlags 00032 { 00033 public: 00034 /// \brief 00035 /// The FdoXmlSpatialContextFlags::ConflictOption specifies how 00036 /// to handle Spatial Contexts that are already in the DataStore, 00037 /// when Deserializing: 00038 /// 00039 /// \param ConflictOption_Add 00040 /// just add new spatial contexts to the 00041 /// FDO DataStore. If the Spatial Context already exists, an exception 00042 /// is thrown. 00043 /// \param ConflictOption_Update 00044 /// Update the spatial context if it already 00045 /// exists, add it if it doesn't exist. 00046 /// \param ConflictOption_Skip 00047 /// just add new spatial contexts. 00048 /// Silently skip spatial contexts already in the DataStore. 00049 /// 00050 enum ConflictOption { 00051 ConflictOption_Add, 00052 ConflictOption_Update, 00053 ConflictOption_Skip 00054 }; 00055 00056 /// \brief 00057 /// Constructs an FdoXmlSpatialContextFlags object. 00058 /// 00059 /// \param url 00060 /// Base URL for generating well-known references to 00061 /// GML coordinate systems and transformations 00062 /// \param errorLevel 00063 /// Input The error level for reading spatial contexts. Controls how 00064 /// strict the error reporting is. 00065 /// \param nameAdjust 00066 /// Input true: apply name adjustment to all elements. 00067 /// false: apply name adjustment only to elements with fdo:nameAdjust="true" 00068 /// \param conflictOption 00069 /// Input option for Deserializing Spatial Contexts. 00070 /// Specified how Spatial Contexts, already in the FDO connection, are handled. 00071 /// \param includeDefault 00072 /// Input true: When Serializing Spatial Contexts, serialize 00073 /// all contexts including the default. 00074 /// false: skip the default Spatial Context. 00075 /// 00076 /// \return 00077 /// Returns FdoXmlSpatialContextFlags 00078 /// 00079 FDO_API static FdoXmlSpatialContextFlags* Create( 00080 FdoString* url = L"fdo.osgeo.org/schemas/feature", 00081 ErrorLevel errorLevel = ErrorLevel_Normal, 00082 FdoBoolean nameAdjust = true, 00083 ConflictOption conflictOption = ConflictOption_Add, 00084 FdoBoolean includeDefault = false 00085 ); 00086 00087 /// \brief 00088 /// Sets the current option for handling Spatial Contexts 00089 /// already in the connection. 00090 /// 00091 /// \param conflictOption 00092 /// Input option for Deserializing Spatial Contexts. 00093 /// Specified how Spatial Contexts, already in the FDO connection, are handled. 00094 /// 00095 FDO_API void SetConflictOption( ConflictOption conflictOption ); 00096 00097 /// \brief 00098 /// Get the current option for handling Spatial Contexts 00099 /// already in the connection. 00100 /// 00101 /// \return 00102 /// Returns the current conflict option. 00103 /// 00104 FDO_API ConflictOption GetConflictOption() const; 00105 00106 /// \brief 00107 /// Sets the default Spatial Context inclusion flag. 00108 /// 00109 /// \param includeDefault 00110 /// Input true: When Serializing Spatial Contexts, serialize 00111 /// all contexts including the default. 00112 /// false: skip the default Spatial Context. 00113 /// 00114 FDO_API void SetIncludeDefault( FdoBoolean includeDefault ); 00115 00116 /// \brief 00117 /// Gets the default Spatial Context inclusion flag. 00118 /// 00119 /// \return 00120 /// Returns the default Spatial Context inclusion flag. 00121 /// 00122 FDO_API FdoBoolean GetIncludeDefault() const; 00123 00124 00125 protected: 00126 /// default constructor to keep linux from complaining 00127 FdoXmlSpatialContextFlags() {} 00128 FDO_API FdoXmlSpatialContextFlags( 00129 FdoString* url, 00130 ErrorLevel errorLevel, 00131 FdoBoolean nameAdjust, 00132 ConflictOption conflictOption, 00133 FdoBoolean includeDefault 00134 ); 00135 FDO_API virtual ~FdoXmlSpatialContextFlags(); 00136 00137 private: 00138 ConflictOption mConflictOption; 00139 FdoBoolean mIncludeDefault; 00140 }; 00141 00142 /// \brief 00143 /// FdoXmlSpatialContextFlagsP is a FdoPtr on FdoXmlSpatialContextFlags, provided for convenience. 00144 typedef FdoPtr<FdoXmlSpatialContextFlags> FdoXmlSpatialContextFlagsP; 00145 00146 #endif 00147 00148
Comments or suggestions? Send us feedback. |