[Liblas-commits] hg-main-tree: rearrange oci driver to fit new
layout
liblas-commits at liblas.org
liblas-commits at liblas.org
Wed Mar 16 10:43:58 EDT 2011
details: http://hg.libpc.orghg-main-tree/rev/1d218d135e1d
changeset: 269:1d218d135e1d
user: Howard Butler <hobu.inc at gmail.com>
date: Wed Mar 16 09:42:59 2011 -0500
description:
rearrange oci driver to fit new layout
diffstat:
include/libpc/drivers/oci/Common.hpp | 92 +++++++
include/libpc/drivers/oci/Header.hpp | 64 ++++
include/libpc/drivers/oci/Reader.hpp | 2 +-
include/libpc/drivers/oci/Writer.hpp | 4 +-
include/libpc/drivers/oci/oci_wrapper.h | 417 ++++++++++++++++++++++++++++++++
src/CMakeLists.txt | 3 +
src/drivers/oci/Reader.cpp | 7 +-
src/drivers/oci/Writer.cpp | 6 +-
src/drivers/oci/common.cpp | 4 +-
src/drivers/oci/common.hpp | 92 -------
src/drivers/oci/header.cpp | 2 +-
src/drivers/oci/header.hpp | 64 ----
src/drivers/oci/oci_wrapper.cpp | 3 +-
src/drivers/oci/oci_wrapper.h | 417 --------------------------------
14 files changed, 591 insertions(+), 586 deletions(-)
diffs (truncated from 1309 to 300 lines):
diff -r 723ae6a7e16b -r 1d218d135e1d include/libpc/drivers/oci/Common.hpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/include/libpc/drivers/oci/Common.hpp Wed Mar 16 09:42:59 2011 -0500
@@ -0,0 +1,92 @@
+/******************************************************************************
+* Copyright (c) 2011, Howard Butler, hobu.inc at gmail.com
+*
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following
+* conditions are met:
+*
+* * Redistributions of source code must retain the above copyright
+* notice, this list of conditions and the following disclaimer.
+* * Redistributions in binary form must reproduce the above copyright
+* notice, this list of conditions and the following disclaimer in
+* the documentation and/or other materials provided
+* with the distribution.
+* * Neither the name of Hobu, Inc. or Flaxen Geo Consulting nor the
+* names of its contributors may be used to endorse or promote
+* products derived from this software without specific prior
+* written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
+* OF SUCH DAMAGE.
+****************************************************************************/
+
+#ifndef INCLUDED_DRIVER_OCI_COMMON_HPP
+#define INCLUDED_DRIVER_OCI_COMMON_HPP
+
+#include <libpc/export.hpp>
+#include <libpc/Bounds.hpp>
+#include <libpc/exceptions.hpp>
+
+#include "oci_wrapper.h"
+
+#include <boost/shared_ptr.hpp>
+#include <boost/property_tree/ptree.hpp>
+
+#include <cpl_port.h>
+
+
+
+void CPL_STDCALL OCIGDALErrorHandler(CPLErr eErrClass, int err_no, const char *msg);
+void CPL_STDCALL OCIGDALDebugErrorHandler(CPLErr eErrClass, int err_no, const char *msg);
+
+
+namespace libpc { namespace driver { namespace oci {
+
+typedef boost::shared_ptr<OWConnection> Connection ;
+typedef boost::shared_ptr<OWStatement> Statement ;
+
+
+
+#ifdef _WIN32
+#define compare_no_case(a,b,n) _strnicmp( (a), (b), (n) )
+#else
+#define compare_no_case(a,b,n) strncasecmp( (a), (b), (n) )
+#endif
+
+class LIBPC_DLL Options
+{
+
+private:
+ boost::property_tree::ptree m_tree;
+
+public:
+
+ Options();
+ bool IsDebug() const;
+ bool Is3d() const;
+ bool IsSolid() const;
+ boost::property_tree::ptree& GetPTree() {return m_tree; }
+
+};
+
+std::string to_upper(std::string const& input);
+
+
+
+
+}}} // namespace libpc::driver::oci
+
+
+#endif
diff -r 723ae6a7e16b -r 1d218d135e1d include/libpc/drivers/oci/Header.hpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/include/libpc/drivers/oci/Header.hpp Wed Mar 16 09:42:59 2011 -0500
@@ -0,0 +1,64 @@
+/******************************************************************************
+* Copyright (c) 2011, Howard Butler, hobu.inc at gmail.com
+*
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following
+* conditions are met:
+*
+* * Redistributions of source code must retain the above copyright
+* notice, this list of conditions and the following disclaimer.
+* * Redistributions in binary form must reproduce the above copyright
+* notice, this list of conditions and the following disclaimer in
+* the documentation and/or other materials provided
+* with the distribution.
+* * Neither the name of Hobu, Inc. or Flaxen Geo Consulting nor the
+* names of its contributors may be used to endorse or promote
+* products derived from this software without specific prior
+* written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
+* OF SUCH DAMAGE.
+****************************************************************************/
+
+#ifndef INCLUDED_DRIVER_OCI_HEADER_HPP
+#define INCLUDED_DRIVER_OCI_HEADER_HPP
+
+#include <iostream>
+#include <string>
+
+#include <boost/cstdint.hpp>
+#include <boost/uuid/uuid.hpp>
+
+#include "libpc/Header.hpp"
+
+namespace libpc { namespace driver { namespace oci {
+
+
+class LIBPC_DLL Header : public libpc::Header
+{
+public:
+ Header();
+
+private:
+ Header& operator=(const Header&); // nope
+ Header(const Header&); // nope
+};
+
+}}} // namespace libpc::driver::oci
+
+LIBPC_DLL std::ostream& operator<<(std::ostream& ostr, const libpc::driver::oci::Header&);
+
+
+#endif
diff -r 723ae6a7e16b -r 1d218d135e1d include/libpc/drivers/oci/Reader.hpp
--- a/include/libpc/drivers/oci/Reader.hpp Wed Mar 16 09:33:19 2011 -0500
+++ b/include/libpc/drivers/oci/Reader.hpp Wed Mar 16 09:42:59 2011 -0500
@@ -49,7 +49,7 @@
-class LIBPC_DLL Reader : public Reader
+class LIBPC_DLL Reader : public libpc::Reader
{
public:
diff -r 723ae6a7e16b -r 1d218d135e1d include/libpc/drivers/oci/Writer.hpp
--- a/include/libpc/drivers/oci/Writer.hpp Wed Mar 16 09:33:19 2011 -0500
+++ b/include/libpc/drivers/oci/Writer.hpp Wed Mar 16 09:42:59 2011 -0500
@@ -38,7 +38,7 @@
#include <libpc/Writer.hpp>
#include <libpc/chipper.hpp>
-#include "common.hpp"
+#include "Common.hpp"
#include <vector>
@@ -49,7 +49,7 @@
-class LIBPC_DLL Writer : public Writer
+class LIBPC_DLL Writer
{
public:
diff -r 723ae6a7e16b -r 1d218d135e1d include/libpc/drivers/oci/oci_wrapper.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/include/libpc/drivers/oci/oci_wrapper.h Wed Mar 16 09:42:59 2011 -0500
@@ -0,0 +1,417 @@
+/******************************************************************************
+ * $Id: $
+ *
+ * Name: oci_wrapper.h
+ * Project: Oracle Spatial GeoRaster Driver
+ * Purpose: Limited wrapper for OCI (Oracle Call Interfaces)
+ * Author: Ivan Lucena [ivan.lucena at pmldnet.com]
+ *
+ ******************************************************************************
+ * Copyright (c) 2008, Ivan Lucena
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ ****************************************************************************/
+
+#ifndef _OCI_WRAPPER_H_INCLUDED
+#define _OCI_WRAPPER_H_INCLUDED
+
+// GDAL supporting types
+
+#include "gdal.h"
+#include "gdal_priv.h"
+
+// Oracle Class Interface
+
+#include <oci.h>
+
+/***************************************************************************/
+/* Data type conversion table record type */
+/***************************************************************************/
+
+struct OW_CellDepth {
+ const char* pszValue;
+ GDALDataType eDataType;
+};
+
+/***************************************************************************/
+/* OCI Error check */
+/***************************************************************************/
+
+bool CheckError( sword nStatus, OCIError* hError );
+
+/***************************************************************************/
+/* Auxiliar functions */
+/***************************************************************************/
+
+const GDALDataType OWGetDataType( const char* pszCellDepth );
+const char* OWSetDataType( const GDALDataType eType );
+int OWParseServerVersion( const char* pszText );
+int OWParseEPSG( const char* pszText );
+bool OWIsNumeric( const char *pszText );
+const char* OWParseSDO_GEOR_INIT( const char* pszInsert, int nField );
+const char* OWReplaceString( const char* pszBaseString,
+ const char* pszToken,
+ const char* pszStopToken,
+ const char* pszOWReplaceToken );
+
+/***************************************************************************/
+/* Arbitrary limits */
+/***************************************************************************/
+
+#define OWCODE 64
+#define OWNAME 512
+#define OWTEXT 1024
+
+/***************************************************************************/
+/* TYPES */
+/***************************************************************************/
+
+#define TYPE_OWNER "MDSYS"
+#define SDO_GEOMETRY TYPE_OWNER".SDO_GEOMETRY"
+#define SDO_GEORASTER TYPE_OWNER".SDO_GEORASTER"
+#define SDO_PC TYPE_OWNER".SDO_PC"
+#define SDO_NUMBER_ARRAY TYPE_OWNER".SDO_NUMBER_ARRAY"
+#define SDO_ORDINATE_ARRAY TYPE_OWNER".SDO_ORDINATE_ARRAY"
+#define SDO_ELEM_INFO_ARRAY TYPE_OWNER".SDO_ELEM_INFO_ARRAY"
+
+#define OW_XMLNS "xmlns=\"http://xmlns.oracle.com/spatial/georaster\""
+
+/***************************************************************************/
+/* USER DEFINED (actualy Oracle's) types */
+/***************************************************************************/
+
+typedef OCIRef SDO_GEORASTER_ref;
More information about the Liblas-commits
mailing list