gdal_wrap.cpp

来自「支持各种栅格图像和矢量图像读取的库」· C++ 代码 · 共 2,170 行 · 第 1/5 页

CPP
2,170
字号
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 1.3.31 *  * This file is not intended to be easily readable and contains a number of  * coding conventions designed to improve portability and efficiency. Do not make * changes to this file unless you know what you are doing--modify the SWIG  * interface file instead.  * ----------------------------------------------------------------------------- */#ifdef __cplusplustemplate<class T> class SwigValueWrapper {    T *tt;public:    SwigValueWrapper() : tt(0) { }    SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { }    SwigValueWrapper(const T& t) : tt(new T(t)) { }    ~SwigValueWrapper() { delete tt; }     SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; }    operator T&() const { return *tt; }    T *operator&() { return tt; }private:    SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);};#endif/* ----------------------------------------------------------------------------- *  This section contains generic SWIG labels for method/variable *  declarations/attributes, and other compiler dependent labels. * ----------------------------------------------------------------------------- *//* template workaround for compilers that cannot correctly implement the C++ standard */#ifndef SWIGTEMPLATEDISAMBIGUATOR# if defined(__SUNPRO_CC)#   if (__SUNPRO_CC <= 0x560)#     define SWIGTEMPLATEDISAMBIGUATOR template#   else#     define SWIGTEMPLATEDISAMBIGUATOR #   endif# else#   define SWIGTEMPLATEDISAMBIGUATOR # endif#endif/* inline attribute */#ifndef SWIGINLINE# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))#   define SWIGINLINE inline# else#   define SWIGINLINE# endif#endif/* attribute recognised by some compilers to avoid 'unused' warnings */#ifndef SWIGUNUSED# if defined(__GNUC__)#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))#     define SWIGUNUSED __attribute__ ((__unused__)) #   else#     define SWIGUNUSED#   endif# elif defined(__ICC)#   define SWIGUNUSED __attribute__ ((__unused__)) # else#   define SWIGUNUSED # endif#endif#ifndef SWIGUNUSEDPARM# ifdef __cplusplus#   define SWIGUNUSEDPARM(p)# else#   define SWIGUNUSEDPARM(p) p SWIGUNUSED # endif#endif/* internal SWIG method */#ifndef SWIGINTERN# define SWIGINTERN static SWIGUNUSED#endif/* internal inline SWIG method */#ifndef SWIGINTERNINLINE# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE#endif/* exporting methods */#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)#  ifndef GCC_HASCLASSVISIBILITY#    define GCC_HASCLASSVISIBILITY#  endif#endif#ifndef SWIGEXPORT# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)#   if defined(STATIC_LINKED)#     define SWIGEXPORT#   else#     define SWIGEXPORT __declspec(dllexport)#   endif# else#   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)#     define SWIGEXPORT __attribute__ ((visibility("default")))#   else#     define SWIGEXPORT#   endif# endif#endif/* calling conventions for Windows */#ifndef SWIGSTDCALL# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)#   define SWIGSTDCALL __stdcall# else#   define SWIGSTDCALL# endif #endif/* Deal with Microsoft's attempt at deprecating C standard runtime functions */#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)# define _CRT_SECURE_NO_DEPRECATE#endif#include <stdlib.h>#include <string.h>#include <stdio.h>/* Support for throwing C# exceptions from C/C++. There are two types:  * Exceptions that take a message and ArgumentExceptions that take a message and a parameter name. */typedef enum {  SWIG_CSharpApplicationException,  SWIG_CSharpArithmeticException,  SWIG_CSharpDivideByZeroException,  SWIG_CSharpIndexOutOfRangeException,  SWIG_CSharpInvalidCastException,  SWIG_CSharpInvalidOperationException,  SWIG_CSharpIOException,  SWIG_CSharpNullReferenceException,  SWIG_CSharpOutOfMemoryException,  SWIG_CSharpOverflowException,  SWIG_CSharpSystemException} SWIG_CSharpExceptionCodes;typedef enum {  SWIG_CSharpArgumentException,  SWIG_CSharpArgumentNullException,  SWIG_CSharpArgumentOutOfRangeException} SWIG_CSharpExceptionArgumentCodes;typedef void (SWIGSTDCALL* SWIG_CSharpExceptionCallback_t)(const char *);typedef void (SWIGSTDCALL* SWIG_CSharpExceptionArgumentCallback_t)(const char *, const char *);typedef struct {  SWIG_CSharpExceptionCodes code;  SWIG_CSharpExceptionCallback_t callback;} SWIG_CSharpException_t;typedef struct {  SWIG_CSharpExceptionArgumentCodes code;  SWIG_CSharpExceptionArgumentCallback_t callback;} SWIG_CSharpExceptionArgument_t;static SWIG_CSharpException_t SWIG_csharp_exceptions[] = {  { SWIG_CSharpApplicationException, NULL },  { SWIG_CSharpArithmeticException, NULL },  { SWIG_CSharpDivideByZeroException, NULL },  { SWIG_CSharpIndexOutOfRangeException, NULL },  { SWIG_CSharpInvalidCastException, NULL },  { SWIG_CSharpInvalidOperationException, NULL },  { SWIG_CSharpIOException, NULL },  { SWIG_CSharpNullReferenceException, NULL },  { SWIG_CSharpOutOfMemoryException, NULL },  { SWIG_CSharpOverflowException, NULL },  { SWIG_CSharpSystemException, NULL }};static SWIG_CSharpExceptionArgument_t SWIG_csharp_exceptions_argument[] = {  { SWIG_CSharpArgumentException, NULL },  { SWIG_CSharpArgumentNullException, NULL },  { SWIG_CSharpArgumentOutOfRangeException, NULL },};static void SWIGUNUSED SWIG_CSharpSetPendingException(SWIG_CSharpExceptionCodes code, const char *msg) {  SWIG_CSharpExceptionCallback_t callback = SWIG_csharp_exceptions[SWIG_CSharpApplicationException].callback;  if (code >=0 && (size_t)code < sizeof(SWIG_csharp_exceptions)/sizeof(SWIG_CSharpException_t)) {    callback = SWIG_csharp_exceptions[code].callback;  }  callback(msg);}static void SWIGUNUSED SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpExceptionArgumentCodes code, const char *msg, const char *param_name) {  SWIG_CSharpExceptionArgumentCallback_t callback = SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentException].callback;  if (code >=0 && (size_t)code < sizeof(SWIG_csharp_exceptions_argument)/sizeof(SWIG_CSharpExceptionArgument_t)) {    callback = SWIG_csharp_exceptions_argument[code].callback;  }  callback(msg, param_name);}#ifdef __cplusplusextern "C" #endifSWIGEXPORT void SWIGSTDCALL SWIGRegisterExceptionCallbacks_gdal(                                                SWIG_CSharpExceptionCallback_t applicationCallback,                                                SWIG_CSharpExceptionCallback_t arithmeticCallback,                                                SWIG_CSharpExceptionCallback_t divideByZeroCallback,                                                 SWIG_CSharpExceptionCallback_t indexOutOfRangeCallback,                                                 SWIG_CSharpExceptionCallback_t invalidCastCallback,                                                SWIG_CSharpExceptionCallback_t invalidOperationCallback,                                                SWIG_CSharpExceptionCallback_t ioCallback,                                                SWIG_CSharpExceptionCallback_t nullReferenceCallback,                                                SWIG_CSharpExceptionCallback_t outOfMemoryCallback,                                                 SWIG_CSharpExceptionCallback_t overflowCallback,                                                 SWIG_CSharpExceptionCallback_t systemCallback) {  SWIG_csharp_exceptions[SWIG_CSharpApplicationException].callback = applicationCallback;  SWIG_csharp_exceptions[SWIG_CSharpArithmeticException].callback = arithmeticCallback;  SWIG_csharp_exceptions[SWIG_CSharpDivideByZeroException].callback = divideByZeroCallback;  SWIG_csharp_exceptions[SWIG_CSharpIndexOutOfRangeException].callback = indexOutOfRangeCallback;  SWIG_csharp_exceptions[SWIG_CSharpInvalidCastException].callback = invalidCastCallback;  SWIG_csharp_exceptions[SWIG_CSharpInvalidOperationException].callback = invalidOperationCallback;  SWIG_csharp_exceptions[SWIG_CSharpIOException].callback = ioCallback;  SWIG_csharp_exceptions[SWIG_CSharpNullReferenceException].callback = nullReferenceCallback;  SWIG_csharp_exceptions[SWIG_CSharpOutOfMemoryException].callback = outOfMemoryCallback;  SWIG_csharp_exceptions[SWIG_CSharpOverflowException].callback = overflowCallback;  SWIG_csharp_exceptions[SWIG_CSharpSystemException].callback = systemCallback;}#ifdef __cplusplusextern "C" #endifSWIGEXPORT void SWIGSTDCALL SWIGRegisterExceptionArgumentCallbacks_gdal(                                                SWIG_CSharpExceptionArgumentCallback_t argumentCallback,                                                SWIG_CSharpExceptionArgumentCallback_t argumentNullCallback,                                                SWIG_CSharpExceptionArgumentCallback_t argumentOutOfRangeCallback) {  SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentException].callback = argumentCallback;  SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentNullException].callback = argumentNullCallback;  SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentOutOfRangeException].callback = argumentOutOfRangeCallback;}/* Callback for returning strings to C# without leaking memory */typedef char * (SWIGSTDCALL* SWIG_CSharpStringHelperCallback)(const char *);static SWIG_CSharpStringHelperCallback SWIG_csharp_string_callback = NULL;#ifdef __cplusplusextern "C" #endifSWIGEXPORT void SWIGSTDCALL SWIGRegisterStringCallback_gdal(SWIG_CSharpStringHelperCallback callback) {  SWIG_csharp_string_callback = callback;}/* Contract support */#define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, msg, ""); return nullreturn; } else/*  Errors in SWIG */#define  SWIG_UnknownError    	   -1 #define  SWIG_IOError        	   -2 #define  SWIG_RuntimeError   	   -3 #define  SWIG_IndexError     	   -4 #define  SWIG_TypeError      	   -5 #define  SWIG_DivisionByZero 	   -6 #define  SWIG_OverflowError  	   -7 #define  SWIG_SyntaxError    	   -8 #define  SWIG_ValueError     	   -9 #define  SWIG_SystemError    	   -10#define  SWIG_AttributeError 	   -11#define  SWIG_MemoryError    	   -12 #define  SWIG_NullReferenceError   -13#include <iostream>using namespace std;#include "cpl_port.h"#include "cpl_string.h"#include "gdal.h"#include "gdal_priv.h"#include "gdal_alg.h"#include "gdalwarper.h"typedef void GDALMajorObjectShadow;typedef void GDALDriverShadow;typedef void GDALDatasetShadow;typedef void GDALRasterBandShadow;typedef int FALSE_IS_ERR;void VeryQuiteErrorHandler(CPLErr eclass, int code, const char *msg ) {  /* If the error class is CE_Fatal, we want to have a message issued     because the CPL support code does an abort() before any exception     can be generated */  if (eclass == CE_Fatal ) {    CPLDefaultErrorHandler(eclass, code, msg );  }}void UseExceptions() {  CPLSetErrorHandler( (CPLErrorHandler) VeryQuiteErrorHandler );}void DontUseExceptions() {  CPLSetErrorHandler( CPLDefaultErrorHandler );}SWIGINTERN void SWIG_CSharpException(int code, const char *msg) {  if (code == SWIG_ValueError) {    SWIG_CSharpExceptionArgumentCodes exception_code = SWIG_CSharpArgumentOutOfRangeException;    SWIG_CSharpSetPendingExceptionArgument(exception_code, msg, 0);  } else {    SWIG_CSharpExceptionCodes exception_code = SWIG_CSharpApplicationException;    switch(code) {    case SWIG_MemoryError:      exception_code = SWIG_CSharpOutOfMemoryException;      break;    case SWIG_IndexError:      exception_code = SWIG_CSharpIndexOutOfRangeException;      break;    case SWIG_DivisionByZero:      exception_code = SWIG_CSharpDivideByZeroException;      break;    case SWIG_IOError:      exception_code = SWIG_CSharpIOException;      break;    case SWIG_OverflowError:      exception_code = SWIG_CSharpOverflowException;      break;    case SWIG_RuntimeError:    case SWIG_TypeError:    case SWIG_SyntaxError:    case SWIG_SystemError:    case SWIG_UnknownError:    default:      exception_code = SWIG_CSharpApplicationException;      break;    }    SWIG_CSharpSetPendingException(exception_code, msg);  }}#include <stdexcept>GDALDataType GDALRasterBandShadow_get_DataType( GDALRasterBandShadow *h ) {  return GDALGetRasterDataType( h );}int GDALRasterBandShadow_get_XSize( GDALRasterBandShadow *h ) {  return GDALGetRasterBandXSize( h );}int GDALRasterBandShadow_get_YSize( GDALRasterBandShadow *h ) {  return GDALGetRasterBandYSize( h );}int GDALDatasetShadow_get_RasterXSize( GDALDatasetShadow *h ) {  return GDALGetRasterXSize( h );}int GDALDatasetShadow_get_RasterYSize( GDALDatasetShadow *h ) {  return GDALGetRasterYSize( h );}int GDALDatasetShadow_get_RasterCount( GDALDatasetShadow *h ) {  return GDALGetRasterCount( h );}char const *GDALDriverShadow_get_ShortName( GDALDriverShadow *h ) {  return GDALGetDriverShortName( h );}char const *GDALDriverShadow_get_LongName( GDALDriverShadow *h ) {  return GDALGetDriverLongName( h );}char const *GDALDriverShadow_get_HelpTopic( GDALDriverShadow *h ) {  return GDALGetDriverHelpTopic( h );}  void Debug( const char *msg_class, const char *message ) {    CPLDebug( msg_class, message );  }  void Error( CPLErr msg_class = CE_Failure, int err_code = 0, const char* msg = "error" ) {    CPLError( msg_class, err_code, msg );  }  CPLErr PushErrorHandler( char const * pszCallbackName = "CPLQuietErrorHandler" ) {    CPLErrorHandler pfnHandler = NULL;    if( EQUAL(pszCallbackName,"CPLQuietErrorHandler") )      pfnHandler = CPLQuietErrorHandler;    else if( EQUAL(pszCallbackName,"CPLDefaultErrorHandler") )      pfnHandler = CPLDefaultErrorHandler;    else if( EQUAL(pszCallbackName,"CPLLoggingErrorHandler") )      pfnHandler = CPLLoggingErrorHandler;    if ( pfnHandler == NULL )      return CE_Fatal;    CPLPushErrorHandler( pfnHandler );    return CE_None;  }SWIGINTERN CPLXMLNode *new_CPLXMLNode(char const *pszString){        return CPLParseXMLString( pszString );         }SWIGINTERN void delete_CPLXMLNode(CPLXMLNode *self){        CPLDestroyXMLNode( self );    }SWIGINTERN char *CPLXMLNode_SerializeXMLTree(CPLXMLNode *self){        return CPLSerializeXMLTree( self );    }SWIGINTERN CPLXMLNode *CPLXMLNode_SearchXMLNode(CPLXMLNode *self,char const *pszElement){        return CPLSearchXMLNode(self, pszElement);    }SWIGINTERN CPLXMLNode *CPLXMLNode_GetXMLNode(CPLXMLNode *self,char const *pszPath){        return CPLGetXMLNode( self, pszPath );    }SWIGINTERN char const *CPLXMLNode_GetXMLValue(CPLXMLNode *self,char const *pszPath,char const *pszDefault){        return CPLGetXMLValue( self, pszPath, pszDefault );                        }SWIGINTERN void CPLXMLNode_AddXMLChild(CPLXMLNode *self,CPLXMLNode *psChild){        return CPLAddXMLChild( self, psChild );    }SWIGINTERN int CPLXMLNode_RemoveXMLChild(CPLXMLNode *self,CPLXMLNode *psChild){        return CPLRemoveXMLChild( self, psChild );    }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?