1 
2 #ifndef AO_UTILS_H_INCLUDED
3 #define AO_UTILS_H_INCLUDED
4 
5 #include "ogr_ao.h"
6 #include <iostream>
7 
8 // ArcObjects to OGR Geometry Mapping
9 bool AOToOGRGeometry(IGeometryDef* pGeoDef, OGRwkbGeometryType* outOGRType);
10 bool AOGeometryToOGRGeometry(bool forceMulti, esriGeometry::IGeometry* pInAOGeo, OGRSpatialReference* pOGRSR, unsigned char* & pInWorkingBuffer, long & inOutBufferSize, OGRGeometry** ppOutGeometry); //working buffer is an optimization to avoid reallocating mem
11 bool AOToOGRSpatialReference(esriGeometry::ISpatialReference* pSR, OGRSpatialReference** ppSR);
12 bool OGRGeometryToAOGeometry(OGRGeometry* pOGRGeom, esriGeometry::IGeometry** ppGeometry);
13 
14 // ArcObjects to OGR Field Mapping
15 bool AOToOGRFields(IFields* pFields, OGRFeatureDefn* pOGRFeatureDef, std::vector<long> & ogrToESRIFieldMapping);
16 bool AOToOGRFieldType(esriFieldType aoType, OGRFieldType* ogrType);
17 
18 // COM error to OGR
19 bool AOErr(HRESULT hr, std::string desc);
20 
21 // Init driver and check out license
22 bool InitializeDriver(esriLicenseExtensionCode license =
23                    (esriLicenseExtensionCode)0);
24 
25 // Exit app and check in license
26 HRESULT ShutdownDriver(esriLicenseExtensionCode license =
27                     (esriLicenseExtensionCode)0);
28 
29 // Helper functions to initialize
30 bool InitAttemptWithoutExtension(esriLicenseProductCode product);
31 bool InitAttemptWithExtension(esriLicenseProductCode product,
32                               esriLicenseExtensionCode extension);
33 int GetInitedProductCode();
34 
35 #endif
36