diff --git a/src/interface/basicio.i b/src/interface/basicio.i index e7ac03f..e355ace 100644 --- a/src/interface/basicio.i +++ b/src/interface/basicio.i @@ -29,6 +29,7 @@ %include "shared/enum.i" %include "shared/exception.i" %include "shared/keep_reference.i" +%include "shared/remoteio_derived.i" %include "shared/unique_ptr.i" %include "shared/windows_path.i" @@ -94,6 +95,10 @@ static swig_type_info* basicio_subtype(Exiv2::BasicIo* ptr) { else if (dynamic_cast(ptr)) { if (dynamic_cast(ptr)) return $descriptor(Exiv2::HttpIo*); +#ifdef EXV_USE_CURL + else if (dynamic_cast(ptr)) + return $descriptor(Exiv2::CurlIo*); +#endif else return $descriptor(Exiv2::RemoteIo*); } @@ -109,6 +114,16 @@ static swig_type_info* basicio_subtype(Exiv2::BasicIo* ptr) { ptr, basicio_subtype(ptr), SWIG_POINTER_OWN); } +// CurlIo destructor isn't seen by SWIG in v0.27.x +#if EXIV2_VERSION_HEX < 0x001c0000 +#ifdef EXV_USE_CURL +%extend Exiv2::CurlIo { + ~CurlIo() {}; +} +%ignore Exiv2::CurlIo::~CurlIo; +#endif +#endif + // readOrThrow & seekOrThrow use ErrorCode internally without Exiv2:: prefix // as if SWIG doesn't realise ErrorCode is in the Exiv2 namespace %{ @@ -198,6 +213,7 @@ DEPRECATED_ENUM(BasicIo, Position, "Seek starting positions.", %ignore Exiv2::BasicIo::~BasicIo; %ignore Exiv2::BasicIo::bigBlock_; %ignore Exiv2::BasicIo::populateFakeData; +%ignore Exiv2::curlWriter; %ignore Exiv2::IoCloser; %ignore Exiv2::ReplaceStringInPlace; %ignore Exiv2::readFile; diff --git a/src/interface/image.i b/src/interface/image.i index 10daeb4..f287e44 100644 --- a/src/interface/image.i +++ b/src/interface/image.i @@ -29,6 +29,7 @@ %include "shared/enum.i" %include "shared/exception.i" %include "shared/keep_reference.i" +%include "shared/remoteio_derived.i" %include "shared/windows_path.i" %include "std_string.i" diff --git a/src/interface/preview.i b/src/interface/preview.i index 05f0ffa..8306442 100644 --- a/src/interface/preview.i +++ b/src/interface/preview.i @@ -30,6 +30,7 @@ For Exif thumbnail images see the :py:class:`ExifThumb` class."; %include "shared/buffers.i" %include "shared/exception.i" %include "shared/keep_reference.i" +%include "shared/remoteio_derived.i" %include "shared/struct_dict.i" %include "shared/windows_path.i" diff --git a/src/interface/shared/remoteio_derived.i b/src/interface/shared/remoteio_derived.i new file mode 100644 index 0000000..20cfbc7 --- /dev/null +++ b/src/interface/shared/remoteio_derived.i @@ -0,0 +1,37 @@ +// python-exiv2 - Python interface to libexiv2 +// http://github.com/jim-easterbrook/python-exiv2 +// Copyright (C) 2024 Jim Easterbrook jim@jim-easterbrook.me.uk +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + + +// Replacement for CurlIo missing from linked libexiv2 +// First ifdef EXV_USE_CURL detects SWIGging with EXV_USE_CURL set +// Second ifndef EXV_USE_CURL detects compiling with EXV_USE_CURL unset +#ifdef EXV_USE_CURL +%{ +#ifndef EXV_USE_CURL +namespace Exiv2 { + class CurlIo : public RemoteIo { + public: + CurlIo(const std::string& url, size_t blockSize=0) { + throw std::runtime_error( + "CurlIo not enabled in linked libexiv2"); + }; + }; +} +#endif +%} +#endif + diff --git a/src/interface/version.i b/src/interface/version.i index 2673b71..7240af3 100644 --- a/src/interface/version.i +++ b/src/interface/version.i @@ -39,6 +39,11 @@ EXCEPTION() // Function to report build options used %feature("docstring") versionInfo "Return a dict of libexiv2 build options." +#ifndef EXV_USE_CURL +%{ +#undef EXV_USE_CURL +%} +#endif %inline %{ static PyObject* versionInfo() { bool nls = false; @@ -46,6 +51,7 @@ static PyObject* versionInfo() { bool video = false; bool unicode = false; bool webready = false; + bool curl = false; #ifdef EXV_ENABLE_NLS nls = true; #endif @@ -58,13 +64,17 @@ static PyObject* versionInfo() { #ifdef EXV_ENABLE_WEBREADY webready = true; #endif - return Py_BuildValue("{ss,sN,sN,sN,sN,sN}", +#ifdef EXV_USE_CURL + curl = true; +#endif + return Py_BuildValue("{ss,sN,sN,sN,sN,sN,sN}", "version", Exiv2::version(), "EXV_ENABLE_NLS", PyBool_FromLong(nls), "EXV_ENABLE_BMFF", PyBool_FromLong(bmff), "EXV_ENABLE_VIDEO", PyBool_FromLong(video), "EXV_UNICODE_PATH", PyBool_FromLong(unicode), - "EXV_ENABLE_WEBREADY", PyBool_FromLong(webready)); + "EXV_ENABLE_WEBREADY", PyBool_FromLong(webready), + "EXV_USE_CURL", PyBool_FromLong(curl)); }; %} diff --git a/src/swig-0_27_3/basicio_wrap.cxx b/src/swig-0_27_3/basicio_wrap.cxx index 2b76c2f..eb80575 100644 --- a/src/swig-0_27_3/basicio_wrap.cxx +++ b/src/swig-0_27_3/basicio_wrap.cxx @@ -3926,28 +3926,29 @@ SwigPyBuiltin_iternextfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) { /* -------- TYPES TABLE (BEGIN) -------- */ #define SWIGTYPE_p_Exiv2__BasicIo swig_types[0] -#define SWIGTYPE_p_Exiv2__DataBuf swig_types[1] -#define SWIGTYPE_p_Exiv2__FileIo swig_types[2] -#define SWIGTYPE_p_Exiv2__HttpIo swig_types[3] -#define SWIGTYPE_p_Exiv2__MemIo swig_types[4] -#define SWIGTYPE_p_Exiv2__RemoteIo swig_types[5] -#define SWIGTYPE_p_Exiv2__XPathIo swig_types[6] -#define SWIGTYPE_p_SwigPyObject swig_types[7] -#define SWIGTYPE_p_char swig_types[8] -#define SWIGTYPE_p_first_type swig_types[9] -#define SWIGTYPE_p_int swig_types[10] -#define SWIGTYPE_p_long_long swig_types[11] -#define SWIGTYPE_p_second_type swig_types[12] -#define SWIGTYPE_p_short swig_types[13] -#define SWIGTYPE_p_signed_char swig_types[14] -#define SWIGTYPE_p_std__pairT_int32_t_int32_t_t swig_types[15] -#define SWIGTYPE_p_std__pairT_uint32_t_uint32_t_t swig_types[16] -#define SWIGTYPE_p_unsigned_char swig_types[17] -#define SWIGTYPE_p_unsigned_int swig_types[18] -#define SWIGTYPE_p_unsigned_long_long swig_types[19] -#define SWIGTYPE_p_unsigned_short swig_types[20] -static swig_type_info *swig_types[22]; -static swig_module_info swig_module = {swig_types, 21, 0, 0, 0, 0}; +#define SWIGTYPE_p_Exiv2__CurlIo swig_types[1] +#define SWIGTYPE_p_Exiv2__DataBuf swig_types[2] +#define SWIGTYPE_p_Exiv2__FileIo swig_types[3] +#define SWIGTYPE_p_Exiv2__HttpIo swig_types[4] +#define SWIGTYPE_p_Exiv2__MemIo swig_types[5] +#define SWIGTYPE_p_Exiv2__RemoteIo swig_types[6] +#define SWIGTYPE_p_Exiv2__XPathIo swig_types[7] +#define SWIGTYPE_p_SwigPyObject swig_types[8] +#define SWIGTYPE_p_char swig_types[9] +#define SWIGTYPE_p_first_type swig_types[10] +#define SWIGTYPE_p_int swig_types[11] +#define SWIGTYPE_p_long_long swig_types[12] +#define SWIGTYPE_p_second_type swig_types[13] +#define SWIGTYPE_p_short swig_types[14] +#define SWIGTYPE_p_signed_char swig_types[15] +#define SWIGTYPE_p_std__pairT_int32_t_int32_t_t swig_types[16] +#define SWIGTYPE_p_std__pairT_uint32_t_uint32_t_t swig_types[17] +#define SWIGTYPE_p_unsigned_char swig_types[18] +#define SWIGTYPE_p_unsigned_int swig_types[19] +#define SWIGTYPE_p_unsigned_long_long swig_types[20] +#define SWIGTYPE_p_unsigned_short swig_types[21] +static swig_type_info *swig_types[23]; +static swig_module_info swig_module = {swig_types, 22, 0, 0, 0, 0}; #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) @@ -4146,6 +4147,19 @@ SWIG_FromCharPtr(const char *cptr) #include "exiv2/exiv2.hpp" +#ifndef EXV_USE_CURL +namespace Exiv2 { + class CurlIo : public RemoteIo { + public: + CurlIo(const std::string& url, size_t blockSize=0) { + throw std::runtime_error( + "CurlIo not enabled in linked libexiv2"); + }; + }; +} +#endif + + #include @@ -4975,6 +4989,7 @@ SWIG_AsVal_size_t (PyObject * obj, size_t *val) return res; } +SWIGINTERN void delete_Exiv2_CurlIo(Exiv2::CurlIo *self){} #ifdef __cplusplus extern "C" { #endif @@ -8553,6 +8568,310 @@ SWIGINTERN int _wrap_new_HttpIo(PyObject *self, PyObject *args, PyObject *kwargs } +SWIGINTERN int _wrap_new_CurlIo__SWIG_0(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + std::string *arg1 = 0 ; + size_t arg2 ; + int res1 = SWIG_OLDOBJ ; + size_t val2 ; + int ecode2 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + Exiv2::CurlIo *result = 0 ; + + if (!SWIG_Python_CheckNoKeywords(kwargs, "new_CurlIo")) SWIG_fail; + if (!PyArg_UnpackTuple(args, "new_CurlIo", 2, 2, &obj1, &obj2)) SWIG_fail; + { + std::string *ptr = (std::string *)0; + res1 = SWIG_AsPtr_std_string(obj1, &ptr); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CurlIo" "', argument " "1"" of type '" "std::string const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_CurlIo" "', argument " "1"" of type '" "std::string const &""'"); + } + arg1 = ptr; + } + ecode2 = SWIG_AsVal_size_t(obj2, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CurlIo" "', argument " "2"" of type '" "size_t""'"); + } + arg2 = static_cast< size_t >(val2); + { +#ifdef _WIN32 + if (utf8_to_wcp(arg1, true) < 0) { + SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); + } +#endif + } + { + try { + result = (Exiv2::CurlIo *)new Exiv2::CurlIo((std::string const &)*arg1,arg2); + } + catch(std::exception const& e) { + _set_python_exception(); + SWIG_fail; + } + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Exiv2__CurlIo, SWIG_BUILTIN_INIT | 0 ); + if (SWIG_IsNewObj(res1)) delete arg1; + return resultobj == Py_None ? -1 : 0; +fail: + if (SWIG_IsNewObj(res1)) delete arg1; + return -1; +} + + +SWIGINTERN int _wrap_new_CurlIo__SWIG_1(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + std::string *arg1 = 0 ; + int res1 = SWIG_OLDOBJ ; + PyObject * obj1 = 0 ; + Exiv2::CurlIo *result = 0 ; + + if (!SWIG_Python_CheckNoKeywords(kwargs, "new_CurlIo")) SWIG_fail; + if (!PyArg_UnpackTuple(args, "new_CurlIo", 1, 1, &obj1)) SWIG_fail; + { + std::string *ptr = (std::string *)0; + res1 = SWIG_AsPtr_std_string(obj1, &ptr); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CurlIo" "', argument " "1"" of type '" "std::string const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_CurlIo" "', argument " "1"" of type '" "std::string const &""'"); + } + arg1 = ptr; + } + { +#ifdef _WIN32 + if (utf8_to_wcp(arg1, true) < 0) { + SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); + } +#endif + } + { + try { + result = (Exiv2::CurlIo *)new Exiv2::CurlIo((std::string const &)*arg1); + } + catch(std::exception const& e) { + _set_python_exception(); + SWIG_fail; + } + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Exiv2__CurlIo, SWIG_BUILTIN_INIT | 0 ); + if (SWIG_IsNewObj(res1)) delete arg1; + return resultobj == Py_None ? -1 : 0; +fail: + if (SWIG_IsNewObj(res1)) delete arg1; + return -1; +} + + +SWIGINTERN int _wrap_new_CurlIo(PyObject *self, PyObject *args, PyObject *kwargs) { + Py_ssize_t argc; + PyObject *argv[3] = { + 0 + }; + Py_ssize_t ii; + + (void)self; + if (!SWIG_Python_CheckNoKeywords(kwargs, "new_CurlIo")) SWIG_fail; + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < 2) && (ii < argc); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 1) { + int retval = _wrap_new_CurlIo__SWIG_1(self, args, NULL); + if (retval == 0 || !SWIG_Python_TypeErrorOccurred(NULL)) return retval; + SWIG_fail; + } + if (argc == 2) { + int retval = _wrap_new_CurlIo__SWIG_0(self, args, NULL); + if (retval == 0 || !SWIG_Python_TypeErrorOccurred(NULL)) return retval; + SWIG_fail; + } + +fail: + SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'new_CurlIo'.\n" + " Possible C/C++ prototypes are:\n" + " Exiv2::CurlIo::CurlIo(std::string const &,size_t)\n" + " Exiv2::CurlIo::CurlIo(std::string const &)\n"); + return -1; +} + + +SWIGINTERN PyObject *_wrap_CurlIo_write__SWIG_0(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + Exiv2::CurlIo *arg1 = (Exiv2::CurlIo *) 0 ; + Exiv2::byte *arg2 = (Exiv2::byte *) 0 ; + long arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *_global_view = NULL ; + PyObject * obj1 = 0 ; + long result; + + if (!PyArg_UnpackTuple(args, "CurlIo_write", 1, 1, &obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Exiv2__CurlIo, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CurlIo_write" "', argument " "1"" of type '" "Exiv2::CurlIo *""'"); + } + arg1 = reinterpret_cast< Exiv2::CurlIo * >(argp1); + { + _global_view = PyMemoryView_GetContiguous(obj1, PyBUF_READ, 'A'); + if (!_global_view) { + PyErr_Clear(); + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "CurlIo_write" "', argument " "2"" of type '" "bytes-like object""'") + ; + } + Py_buffer* buff = PyMemoryView_GET_BUFFER(_global_view); + arg2 = (Exiv2::byte *) buff->buf; + arg3 = (long) buff->len; + } + { + try { + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (long)(arg1)->write((Exiv2::byte const *)arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + } + catch(std::exception const& e) { + _set_python_exception(); + SWIG_fail; + } + } + resultobj = SWIG_From_long(static_cast< long >(result)); + + Py_XDECREF(_global_view); + + return resultobj; +fail: + + Py_XDECREF(_global_view); + + return NULL; +} + + +SWIGINTERN PyObject *_wrap_CurlIo_write__SWIG_1(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + Exiv2::CurlIo *arg1 = (Exiv2::CurlIo *) 0 ; + Exiv2::BasicIo *arg2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj1 = 0 ; + long result; + + if (!PyArg_UnpackTuple(args, "CurlIo_write", 1, 1, &obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Exiv2__CurlIo, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CurlIo_write" "', argument " "1"" of type '" "Exiv2::CurlIo *""'"); + } + arg1 = reinterpret_cast< Exiv2::CurlIo * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_Exiv2__BasicIo, 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CurlIo_write" "', argument " "2"" of type '" "Exiv2::BasicIo &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CurlIo_write" "', argument " "2"" of type '" "Exiv2::BasicIo &""'"); + } + arg2 = reinterpret_cast< Exiv2::BasicIo * >(argp2); + { + try { + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (long)(arg1)->write(*arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + } + catch(std::exception const& e) { + _set_python_exception(); + SWIG_fail; + } + } + resultobj = SWIG_From_long(static_cast< long >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_CurlIo_write(PyObject *self, PyObject *args) { + Py_ssize_t argc; + PyObject *argv[3] = { + 0 + }; + Py_ssize_t ii; + + (void)self; + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + argv[0] = self; + for (ii = 0; (ii < 1) && (ii < argc); ii++) { + argv[ii + 1] = PyTuple_GET_ITEM(args,ii); + } + argc++; + if (argc == 2) { + int _v = 0; + { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Exiv2__BasicIo, SWIG_POINTER_NO_NULL); + _v = SWIG_CheckState(res); + } + if (!_v) goto check_1; + return _wrap_CurlIo_write__SWIG_1(self, args); + } +check_1: + + if (argc == 2) { + PyObject *retobj = _wrap_CurlIo_write__SWIG_0(self, args); + if (!SWIG_Python_TypeErrorOccurred(retobj)) return retobj; + SWIG_fail; + } + +fail: + SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'CurlIo_write'.\n" + " Possible C/C++ prototypes are:\n" + " Exiv2::CurlIo::write(Exiv2::byte const *,long)\n" + " Exiv2::CurlIo::write(Exiv2::BasicIo &)\n"); + return 0; +} + + +SWIGINTERN PyObject *_wrap_delete_CurlIo(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + Exiv2::CurlIo *arg1 = (Exiv2::CurlIo *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + + if (args && PyTuple_Check(args) && PyTuple_GET_SIZE(args) > 0) SWIG_exception_fail(SWIG_TypeError, "delete_CurlIo takes no arguments"); + res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Exiv2__CurlIo, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CurlIo" "', argument " "1"" of type '" "Exiv2::CurlIo *""'"); + } + arg1 = reinterpret_cast< Exiv2::CurlIo * >(argp1); + { + try { + delete_Exiv2_CurlIo(arg1); + } + catch(std::exception const& e) { + _set_python_exception(); + SWIG_fail; + } + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGPY_DESTRUCTOR_CLOSURE(_wrap_delete_CurlIo) /* defines _wrap_delete_CurlIo_destructor_closure */ + static PyMethodDef SwigMethods[] = { { "_enum_list_Position", _wrap__enum_list_Position, METH_VARARGS, NULL}, { NULL, NULL, 0, NULL } @@ -10721,9 +11040,279 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__HttpIo_type = { SWIGINTERN SwigPyClientData SwigPyBuiltin__Exiv2__HttpIo_clientdata = {0, 0, 0, 0, 0, 0, (PyTypeObject *)&SwigPyBuiltin__Exiv2__HttpIo_type}; +static SwigPyGetSet CurlIo___dict___getset = { SwigPyObject_get___dict__, 0 }; +SWIGINTERN PyGetSetDef SwigPyBuiltin__Exiv2__CurlIo_getset[] = { + { (char *)"__dict__", SwigPyBuiltin_GetterClosure, 0, (char *)"\n" + "Constructor that accepts the URL on which IO will be\n" + " performed.\n" + ":type url: str\n" + ":param url: The full path of url\n" + ":type blockSize: int, optional\n" + ":param blockSize: the size of the memory block. The file content is\n" + " divided into the memory blocks. These blocks are populated\n" + " on demand from the server, so it avoids copying the complete file.\n" + ":raises: Error if it is unable to init curl pointer.\n" + "", &CurlIo___dict___getset }, + { NULL, NULL, NULL, NULL, NULL } /* Sentinel */ +}; + +SWIGINTERN PyObject * +SwigPyBuiltin__Exiv2__CurlIo_richcompare(PyObject *self, PyObject *other, int op) { + PyObject *result = NULL; + PyObject *tuple = PyTuple_New(1); + assert(tuple); + PyTuple_SET_ITEM(tuple, 0, other); + Py_XINCREF(other); + if (!result && !PyErr_Occurred()) { + if (SwigPyObject_Check(self) && SwigPyObject_Check(other)) { + result = SwigPyObject_richcompare((SwigPyObject *)self, (SwigPyObject *)other, op); + } else { + result = Py_NotImplemented; + Py_INCREF(result); + } + } + Py_DECREF(tuple); + return result; +} + +SWIGINTERN PyMethodDef SwigPyBuiltin__Exiv2__CurlIo_methods[] = { + { "write", _wrap_CurlIo_write, METH_VARARGS, "\n" + "*Overload 1:*\n" + "\n" + "Write access is only available for some protocols. This method\n" + " will call RemoteIo::write(const byte* data, long wcount) if the write\n" + " access is available for the protocol. Otherwise, it throws the Error.\n" + "\n" + "|\n" + "\n" + "*Overload 2:*\n" + "\n" + "Write access is only available for some protocols. This method\n" + " will call RemoteIo::write(BasicIo& src) if the write access is available\n" + " for the protocol. Otherwise, it throws the Error.\n" + "" }, + { NULL, NULL, 0, NULL } /* Sentinel */ +}; + +static PyHeapTypeObject SwigPyBuiltin__Exiv2__CurlIo_type = { + { +#if PY_VERSION_HEX >= 0x03000000 + PyVarObject_HEAD_INIT(NULL, 0) +#else + PyObject_HEAD_INIT(NULL) + 0, /* ob_size */ +#endif + "exiv2.basicio.CurlIo", /* tp_name */ + sizeof(SwigPyObject), /* tp_basicsize */ + 0, /* tp_itemsize */ + _wrap_delete_CurlIo_destructor_closure, /* tp_dealloc */ +#if PY_VERSION_HEX < 0x030800b4 + (printfunc) 0, /* tp_print */ +#else + (Py_ssize_t) 0, /* tp_vectorcall_offset */ +#endif + (getattrfunc) 0, /* tp_getattr */ + (setattrfunc) 0, /* tp_setattr */ +#if PY_VERSION_HEX >= 0x03000000 + 0, /* tp_compare */ +#else + (cmpfunc) 0, /* tp_compare */ +#endif + (reprfunc) 0, /* tp_repr */ + &SwigPyBuiltin__Exiv2__CurlIo_type.as_number, /* tp_as_number */ + &SwigPyBuiltin__Exiv2__CurlIo_type.as_sequence, /* tp_as_sequence */ + &SwigPyBuiltin__Exiv2__CurlIo_type.as_mapping, /* tp_as_mapping */ + SwigPyObject_hash, /* tp_hash */ + (ternaryfunc) 0, /* tp_call */ + (reprfunc) 0, /* tp_str */ + (getattrofunc) 0, /* tp_getattro */ + (setattrofunc) 0, /* tp_setattro */ + &SwigPyBuiltin__Exiv2__CurlIo_type.as_buffer, /* tp_as_buffer */ +#if PY_VERSION_HEX >= 0x03000000 + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */ +#else + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES, /* tp_flags */ +#endif + "\n" + "Provides the http, https read/write access and ftp read access for the RemoteIo.\n" + " This class is based on libcurl.\n" + "",/* tp_doc */ + (traverseproc) 0, /* tp_traverse */ + (inquiry) 0, /* tp_clear */ + SwigPyBuiltin__Exiv2__CurlIo_richcompare, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + (getiterfunc) 0, /* tp_iter */ + (iternextfunc) 0, /* tp_iternext */ + SwigPyBuiltin__Exiv2__CurlIo_methods, /* tp_methods */ + 0, /* tp_members */ + SwigPyBuiltin__Exiv2__CurlIo_getset, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + (descrgetfunc) 0, /* tp_descr_get */ + (descrsetfunc) 0, /* tp_descr_set */ + offsetof(SwigPyObject, dict), /* tp_dictoffset */ + _wrap_new_CurlIo, /* tp_init */ + (allocfunc) 0, /* tp_alloc */ + (newfunc) 0, /* tp_new */ + (freefunc) 0, /* tp_free */ + (inquiry) 0, /* tp_is_gc */ + (PyObject *) 0, /* tp_bases */ + (PyObject *) 0, /* tp_mro */ + (PyObject *) 0, /* tp_cache */ + (PyObject *) 0, /* tp_subclasses */ + (PyObject *) 0, /* tp_weaklist */ + (destructor) 0, /* tp_del */ + (int) 0, /* tp_version_tag */ +#if PY_VERSION_HEX >= 0x03040000 + (destructor) 0, /* tp_finalize */ +#endif +#if PY_VERSION_HEX >= 0x03080000 + (vectorcallfunc) 0, /* tp_vectorcall */ +#endif +#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) + 0, /* tp_print */ +#endif +#if PY_VERSION_HEX >= 0x030c0000 + (char) 0, /* tp_watched */ +#endif +#ifdef COUNT_ALLOCS + (Py_ssize_t) 0, /* tp_allocs */ + (Py_ssize_t) 0, /* tp_frees */ + (Py_ssize_t) 0, /* tp_maxalloc */ + 0, /* tp_prev */ + 0, /* tp_next */ +#endif + }, +#if PY_VERSION_HEX >= 0x03050000 + { + (unaryfunc) 0, /* am_await */ + (unaryfunc) 0, /* am_aiter */ + (unaryfunc) 0, /* am_anext */ +# if PY_VERSION_HEX >= 0x030a0000 + (sendfunc) 0, /* am_send */ +# endif + }, +#endif + { + (binaryfunc) 0, /* nb_add */ + (binaryfunc) 0, /* nb_subtract */ + (binaryfunc) 0, /* nb_multiply */ +#if PY_VERSION_HEX < 0x03000000 + (binaryfunc) 0, /* nb_divide */ +#endif + (binaryfunc) 0, /* nb_remainder */ + (binaryfunc) 0, /* nb_divmod */ + (ternaryfunc) 0, /* nb_power */ + (unaryfunc) 0, /* nb_negative */ + (unaryfunc) 0, /* nb_positive */ + (unaryfunc) 0, /* nb_absolute */ + (inquiry) 0, /* nb_nonzero */ + (unaryfunc) 0, /* nb_invert */ + (binaryfunc) 0, /* nb_lshift */ + (binaryfunc) 0, /* nb_rshift */ + (binaryfunc) 0, /* nb_and */ + (binaryfunc) 0, /* nb_xor */ + (binaryfunc) 0, /* nb_or */ +#if PY_VERSION_HEX < 0x03000000 + (coercion) 0, /* nb_coerce */ +#endif + (unaryfunc) 0, /* nb_int */ +#if PY_VERSION_HEX >= 0x03000000 + (void *) 0, /* nb_reserved */ +#else + (unaryfunc) 0, /* nb_long */ +#endif + (unaryfunc) 0, /* nb_float */ +#if PY_VERSION_HEX < 0x03000000 + (unaryfunc) 0, /* nb_oct */ + (unaryfunc) 0, /* nb_hex */ +#endif + (binaryfunc) 0, /* nb_inplace_add */ + (binaryfunc) 0, /* nb_inplace_subtract */ + (binaryfunc) 0, /* nb_inplace_multiply */ +#if PY_VERSION_HEX < 0x03000000 + (binaryfunc) 0, /* nb_inplace_divide */ +#endif + (binaryfunc) 0, /* nb_inplace_remainder */ + (ternaryfunc) 0, /* nb_inplace_power */ + (binaryfunc) 0, /* nb_inplace_lshift */ + (binaryfunc) 0, /* nb_inplace_rshift */ + (binaryfunc) 0, /* nb_inplace_and */ + (binaryfunc) 0, /* nb_inplace_xor */ + (binaryfunc) 0, /* nb_inplace_or */ + (binaryfunc) 0, /* nb_floor_divide */ + (binaryfunc) 0, /* nb_true_divide */ + (binaryfunc) 0, /* nb_inplace_floor_divide */ + (binaryfunc) 0, /* nb_inplace_true_divide */ + (unaryfunc) 0, /* nb_index */ +#if PY_VERSION_HEX >= 0x03050000 + (binaryfunc) 0, /* nb_matrix_multiply */ + (binaryfunc) 0, /* nb_inplace_matrix_multiply */ +#endif + }, + { + (lenfunc) 0, /* mp_length */ + (binaryfunc) 0, /* mp_subscript */ + (objobjargproc) 0, /* mp_ass_subscript */ + }, + { + (lenfunc) 0, /* sq_length */ + (binaryfunc) 0, /* sq_concat */ + (ssizeargfunc) 0, /* sq_repeat */ + (ssizeargfunc) 0, /* sq_item */ +#if PY_VERSION_HEX >= 0x03000000 + (void *) 0, /* was_sq_slice */ +#else + (ssizessizeargfunc) 0, /* sq_slice */ +#endif + (ssizeobjargproc) 0, /* sq_ass_item */ +#if PY_VERSION_HEX >= 0x03000000 + (void *) 0, /* was_sq_ass_slice */ +#else + (ssizessizeobjargproc) 0, /* sq_ass_slice */ +#endif + (objobjproc) 0, /* sq_contains */ + (binaryfunc) 0, /* sq_inplace_concat */ + (ssizeargfunc) 0, /* sq_inplace_repeat */ + }, + { +#if PY_VERSION_HEX < 0x03000000 + (readbufferproc) 0, /* bf_getreadbuffer */ + (writebufferproc) 0, /* bf_getwritebuffer */ + (segcountproc) 0, /* bf_getsegcount */ + (charbufferproc) 0, /* bf_getcharbuffer */ +#endif + (getbufferproc) 0, /* bf_getbuffer */ + (releasebufferproc) 0, /* bf_releasebuffer */ + }, + (PyObject *) 0, /* ht_name */ + (PyObject *) 0, /* ht_slots */ +#if PY_VERSION_HEX >= 0x03030000 + (PyObject *) 0, /* ht_qualname */ + 0, /* ht_cached_keys */ +#endif +#if PY_VERSION_HEX >= 0x03090000 + (PyObject *) 0, /* ht_module */ +#endif +#if PY_VERSION_HEX >= 0x030b0000 + (char *) 0, /* _ht_tpname */ + { + (PyObject *) 0, /* getitem */ +#if PY_VERSION_HEX >= 0x030c0000 + (uint32_t) 0, /* getitem_version */ +#endif + } +#endif +}; + +SWIGINTERN SwigPyClientData SwigPyBuiltin__Exiv2__CurlIo_clientdata = {0, 0, 0, 0, 0, 0, (PyTypeObject *)&SwigPyBuiltin__Exiv2__CurlIo_type}; + /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ +static void *_p_Exiv2__CurlIoTo_p_Exiv2__BasicIo(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((Exiv2::BasicIo *) (Exiv2::RemoteIo *) ((Exiv2::CurlIo *) x)); +} static void *_p_Exiv2__FileIoTo_p_Exiv2__BasicIo(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((Exiv2::BasicIo *) ((Exiv2::FileIo *) x)); } @@ -10742,10 +11331,14 @@ static void *_p_Exiv2__XPathIoTo_p_Exiv2__BasicIo(void *x, int *SWIGUNUSEDPARM(n static void *_p_Exiv2__XPathIoTo_p_Exiv2__FileIo(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((Exiv2::FileIo *) ((Exiv2::XPathIo *) x)); } +static void *_p_Exiv2__CurlIoTo_p_Exiv2__RemoteIo(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((Exiv2::RemoteIo *) ((Exiv2::CurlIo *) x)); +} static void *_p_Exiv2__HttpIoTo_p_Exiv2__RemoteIo(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((Exiv2::RemoteIo *) ((Exiv2::HttpIo *) x)); } static swig_type_info _swigt__p_Exiv2__BasicIo = {"_p_Exiv2__BasicIo", "Exiv2::BasicIo *", 0, 0, (void*)&SwigPyBuiltin__Exiv2__BasicIo_clientdata, 0}; +static swig_type_info _swigt__p_Exiv2__CurlIo = {"_p_Exiv2__CurlIo", "Exiv2::CurlIo *", 0, 0, (void*)&SwigPyBuiltin__Exiv2__CurlIo_clientdata, 0}; static swig_type_info _swigt__p_Exiv2__DataBuf = {"_p_Exiv2__DataBuf", "Exiv2::DataBuf *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Exiv2__FileIo = {"_p_Exiv2__FileIo", "Exiv2::FileIo *", 0, 0, (void*)&SwigPyBuiltin__Exiv2__FileIo_clientdata, 0}; static swig_type_info _swigt__p_Exiv2__HttpIo = {"_p_Exiv2__HttpIo", "Exiv2::HttpIo *", 0, 0, (void*)&SwigPyBuiltin__Exiv2__HttpIo_clientdata, 0}; @@ -10769,6 +11362,7 @@ static swig_type_info _swigt__p_unsigned_short = {"_p_unsigned_short", "uint16_t static swig_type_info *swig_type_initial[] = { &_swigt__p_Exiv2__BasicIo, + &_swigt__p_Exiv2__CurlIo, &_swigt__p_Exiv2__DataBuf, &_swigt__p_Exiv2__FileIo, &_swigt__p_Exiv2__HttpIo, @@ -10791,12 +11385,13 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_unsigned_short, }; -static swig_cast_info _swigc__p_Exiv2__BasicIo[] = { {&_swigt__p_Exiv2__BasicIo, 0, 0, 0}, {&_swigt__p_Exiv2__FileIo, _p_Exiv2__FileIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__HttpIo, _p_Exiv2__HttpIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__MemIo, _p_Exiv2__MemIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__RemoteIo, _p_Exiv2__RemoteIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__XPathIo, _p_Exiv2__XPathIoTo_p_Exiv2__BasicIo, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Exiv2__BasicIo[] = { {&_swigt__p_Exiv2__BasicIo, 0, 0, 0}, {&_swigt__p_Exiv2__CurlIo, _p_Exiv2__CurlIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__FileIo, _p_Exiv2__FileIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__HttpIo, _p_Exiv2__HttpIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__MemIo, _p_Exiv2__MemIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__RemoteIo, _p_Exiv2__RemoteIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__XPathIo, _p_Exiv2__XPathIoTo_p_Exiv2__BasicIo, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Exiv2__CurlIo[] = { {&_swigt__p_Exiv2__CurlIo, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__DataBuf[] = { {&_swigt__p_Exiv2__DataBuf, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__FileIo[] = { {&_swigt__p_Exiv2__FileIo, 0, 0, 0}, {&_swigt__p_Exiv2__XPathIo, _p_Exiv2__XPathIoTo_p_Exiv2__FileIo, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__HttpIo[] = { {&_swigt__p_Exiv2__HttpIo, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__MemIo[] = { {&_swigt__p_Exiv2__MemIo, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_Exiv2__RemoteIo[] = { {&_swigt__p_Exiv2__RemoteIo, 0, 0, 0}, {&_swigt__p_Exiv2__HttpIo, _p_Exiv2__HttpIoTo_p_Exiv2__RemoteIo, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Exiv2__RemoteIo[] = { {&_swigt__p_Exiv2__RemoteIo, 0, 0, 0}, {&_swigt__p_Exiv2__CurlIo, _p_Exiv2__CurlIoTo_p_Exiv2__RemoteIo, 0, 0}, {&_swigt__p_Exiv2__HttpIo, _p_Exiv2__HttpIoTo_p_Exiv2__RemoteIo, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__XPathIo[] = { {&_swigt__p_Exiv2__XPathIo, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_SwigPyObject[] = { {&_swigt__p_SwigPyObject, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; @@ -10815,6 +11410,7 @@ static swig_cast_info _swigc__p_unsigned_short[] = { {&_swigt__p_unsigned_short static swig_cast_info *swig_cast_initial[] = { _swigc__p_Exiv2__BasicIo, + _swigc__p_Exiv2__CurlIo, _swigc__p_Exiv2__DataBuf, _swigc__p_Exiv2__FileIo, _swigc__p_Exiv2__HttpIo, @@ -11525,6 +12121,40 @@ SWIG_init(void) { SwigPyBuiltin_AddPublicSymbol(public_interface, "HttpIo"); d = md; + /* type 'Exiv2::CurlIo' */ + builtin_pytype = (PyTypeObject *)&SwigPyBuiltin__Exiv2__CurlIo_type; + builtin_pytype->tp_dict = d = PyDict_New(); + SwigPyBuiltin_SetMetaType(builtin_pytype, metatype); + builtin_pytype->tp_new = PyType_GenericNew; + builtin_base_count = 0; + builtin_basetype = SWIG_MangledTypeQuery("_p_Exiv2__RemoteIo"); + if (builtin_basetype && builtin_basetype->clientdata && ((SwigPyClientData *) builtin_basetype->clientdata)->pytype) { + builtin_bases[builtin_base_count++] = ((SwigPyClientData *) builtin_basetype->clientdata)->pytype; + } else { + PyErr_SetString(PyExc_TypeError, "Could not create type 'CurlIo' as base 'Exiv2::RemoteIo' has not been initialized.\n"); +#if PY_VERSION_HEX >= 0x03000000 + return NULL; +#else + return; +#endif + } + builtin_bases[builtin_base_count] = NULL; + SwigPyBuiltin_InitBases(builtin_pytype, builtin_bases); + PyDict_SetItemString(d, "this", this_descr); + PyDict_SetItemString(d, "thisown", thisown_descr); + if (PyType_Ready(builtin_pytype) < 0) { + PyErr_SetString(PyExc_TypeError, "Could not create type 'CurlIo'."); +#if PY_VERSION_HEX >= 0x03000000 + return NULL; +#else + return; +#endif + } + Py_INCREF(builtin_pytype); + PyModule_AddObject(m, "CurlIo", (PyObject *)builtin_pytype); + SwigPyBuiltin_AddPublicSymbol(public_interface, "CurlIo"); + d = md; + /* Initialize threading */ SWIG_PYTHON_INITIALIZE_THREADS; #if PY_VERSION_HEX >= 0x03000000 diff --git a/src/swig-0_27_3/image_wrap.cxx b/src/swig-0_27_3/image_wrap.cxx index ec82656..3b28b29 100644 --- a/src/swig-0_27_3/image_wrap.cxx +++ b/src/swig-0_27_3/image_wrap.cxx @@ -3930,75 +3930,76 @@ SwigPyBuiltin_iternextfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) { #define SWIGTYPE_p_Exiv2__AsciiValue swig_types[2] #define SWIGTYPE_p_Exiv2__BasicIo swig_types[3] #define SWIGTYPE_p_Exiv2__CommentValue swig_types[4] -#define SWIGTYPE_p_Exiv2__DataBuf swig_types[5] -#define SWIGTYPE_p_Exiv2__DataSet swig_types[6] -#define SWIGTYPE_p_Exiv2__DataValue swig_types[7] -#define SWIGTYPE_p_Exiv2__DateValue swig_types[8] -#define SWIGTYPE_p_Exiv2__ExifData swig_types[9] -#define SWIGTYPE_p_Exiv2__ExifKey swig_types[10] -#define SWIGTYPE_p_Exiv2__FileIo swig_types[11] -#define SWIGTYPE_p_Exiv2__GroupInfo swig_types[12] -#define SWIGTYPE_p_Exiv2__HttpIo swig_types[13] -#define SWIGTYPE_p_Exiv2__Image swig_types[14] -#define SWIGTYPE_p_Exiv2__ImageFactory swig_types[15] -#define SWIGTYPE_p_Exiv2__IptcData swig_types[16] -#define SWIGTYPE_p_Exiv2__IptcKey swig_types[17] -#define SWIGTYPE_p_Exiv2__Key swig_types[18] -#define SWIGTYPE_p_Exiv2__LangAltValue swig_types[19] -#define SWIGTYPE_p_Exiv2__MemIo swig_types[20] -#define SWIGTYPE_p_Exiv2__RemoteIo swig_types[21] -#define SWIGTYPE_p_Exiv2__StringValue swig_types[22] -#define SWIGTYPE_p_Exiv2__StringValueBase swig_types[23] -#define SWIGTYPE_p_Exiv2__TagInfo swig_types[24] -#define SWIGTYPE_p_Exiv2__TimeValue swig_types[25] -#define SWIGTYPE_p_Exiv2__Value swig_types[26] -#define SWIGTYPE_p_Exiv2__ValueTypeT_double_t swig_types[27] -#define SWIGTYPE_p_Exiv2__ValueTypeT_float_t swig_types[28] -#define SWIGTYPE_p_Exiv2__ValueTypeT_int16_t_t swig_types[29] -#define SWIGTYPE_p_Exiv2__ValueTypeT_int32_t_t swig_types[30] -#define SWIGTYPE_p_Exiv2__ValueTypeT_std__pairT_int32_t_int32_t_t_t swig_types[31] -#define SWIGTYPE_p_Exiv2__ValueTypeT_std__pairT_uint32_t_uint32_t_t_t swig_types[32] -#define SWIGTYPE_p_Exiv2__ValueTypeT_uint16_t_t swig_types[33] -#define SWIGTYPE_p_Exiv2__ValueTypeT_uint32_t_t swig_types[34] -#define SWIGTYPE_p_Exiv2__XPathIo swig_types[35] -#define SWIGTYPE_p_Exiv2__XmpArrayValue swig_types[36] -#define SWIGTYPE_p_Exiv2__XmpData swig_types[37] -#define SWIGTYPE_p_Exiv2__XmpKey swig_types[38] -#define SWIGTYPE_p_Exiv2__XmpPropertyInfo swig_types[39] -#define SWIGTYPE_p_Exiv2__XmpTextValue swig_types[40] -#define SWIGTYPE_p_Exiv2__XmpValue swig_types[41] -#define SWIGTYPE_p_IptcData_iterator swig_types[42] -#define SWIGTYPE_p_IptcData_iterator_base swig_types[43] -#define SWIGTYPE_p_SwigPyObject swig_types[44] -#define SWIGTYPE_p_ValueType swig_types[45] -#define SWIGTYPE_p_XmpData_iterator swig_types[46] -#define SWIGTYPE_p_XmpData_iterator_base swig_types[47] -#define SWIGTYPE_p_allocator_type swig_types[48] -#define SWIGTYPE_p_char swig_types[49] -#define SWIGTYPE_p_const_iterator swig_types[50] -#define SWIGTYPE_p_difference_type swig_types[51] -#define SWIGTYPE_p_first_type swig_types[52] -#define SWIGTYPE_p_int swig_types[53] -#define SWIGTYPE_p_iterator swig_types[54] -#define SWIGTYPE_p_key_type swig_types[55] -#define SWIGTYPE_p_long_long swig_types[56] -#define SWIGTYPE_p_mapped_type swig_types[57] -#define SWIGTYPE_p_second_type swig_types[58] -#define SWIGTYPE_p_short swig_types[59] -#define SWIGTYPE_p_signed_char swig_types[60] -#define SWIGTYPE_p_size_type swig_types[61] -#define SWIGTYPE_p_std__listT_Exiv2__Exifdatum_t swig_types[62] -#define SWIGTYPE_p_std__pairT_int32_t_int32_t_t swig_types[63] -#define SWIGTYPE_p_std__pairT_uint32_t_uint32_t_t swig_types[64] -#define SWIGTYPE_p_std__vectorT_Exiv2__Iptcdatum_std__allocatorT_Exiv2__Iptcdatum_t_t swig_types[65] -#define SWIGTYPE_p_std__vectorT_Exiv2__Xmpdatum_std__allocatorT_Exiv2__Xmpdatum_t_t swig_types[66] -#define SWIGTYPE_p_unsigned_char swig_types[67] -#define SWIGTYPE_p_unsigned_int swig_types[68] -#define SWIGTYPE_p_unsigned_long_long swig_types[69] -#define SWIGTYPE_p_unsigned_short swig_types[70] -#define SWIGTYPE_p_value_type swig_types[71] -static swig_type_info *swig_types[73]; -static swig_module_info swig_module = {swig_types, 72, 0, 0, 0, 0}; +#define SWIGTYPE_p_Exiv2__CurlIo swig_types[5] +#define SWIGTYPE_p_Exiv2__DataBuf swig_types[6] +#define SWIGTYPE_p_Exiv2__DataSet swig_types[7] +#define SWIGTYPE_p_Exiv2__DataValue swig_types[8] +#define SWIGTYPE_p_Exiv2__DateValue swig_types[9] +#define SWIGTYPE_p_Exiv2__ExifData swig_types[10] +#define SWIGTYPE_p_Exiv2__ExifKey swig_types[11] +#define SWIGTYPE_p_Exiv2__FileIo swig_types[12] +#define SWIGTYPE_p_Exiv2__GroupInfo swig_types[13] +#define SWIGTYPE_p_Exiv2__HttpIo swig_types[14] +#define SWIGTYPE_p_Exiv2__Image swig_types[15] +#define SWIGTYPE_p_Exiv2__ImageFactory swig_types[16] +#define SWIGTYPE_p_Exiv2__IptcData swig_types[17] +#define SWIGTYPE_p_Exiv2__IptcKey swig_types[18] +#define SWIGTYPE_p_Exiv2__Key swig_types[19] +#define SWIGTYPE_p_Exiv2__LangAltValue swig_types[20] +#define SWIGTYPE_p_Exiv2__MemIo swig_types[21] +#define SWIGTYPE_p_Exiv2__RemoteIo swig_types[22] +#define SWIGTYPE_p_Exiv2__StringValue swig_types[23] +#define SWIGTYPE_p_Exiv2__StringValueBase swig_types[24] +#define SWIGTYPE_p_Exiv2__TagInfo swig_types[25] +#define SWIGTYPE_p_Exiv2__TimeValue swig_types[26] +#define SWIGTYPE_p_Exiv2__Value swig_types[27] +#define SWIGTYPE_p_Exiv2__ValueTypeT_double_t swig_types[28] +#define SWIGTYPE_p_Exiv2__ValueTypeT_float_t swig_types[29] +#define SWIGTYPE_p_Exiv2__ValueTypeT_int16_t_t swig_types[30] +#define SWIGTYPE_p_Exiv2__ValueTypeT_int32_t_t swig_types[31] +#define SWIGTYPE_p_Exiv2__ValueTypeT_std__pairT_int32_t_int32_t_t_t swig_types[32] +#define SWIGTYPE_p_Exiv2__ValueTypeT_std__pairT_uint32_t_uint32_t_t_t swig_types[33] +#define SWIGTYPE_p_Exiv2__ValueTypeT_uint16_t_t swig_types[34] +#define SWIGTYPE_p_Exiv2__ValueTypeT_uint32_t_t swig_types[35] +#define SWIGTYPE_p_Exiv2__XPathIo swig_types[36] +#define SWIGTYPE_p_Exiv2__XmpArrayValue swig_types[37] +#define SWIGTYPE_p_Exiv2__XmpData swig_types[38] +#define SWIGTYPE_p_Exiv2__XmpKey swig_types[39] +#define SWIGTYPE_p_Exiv2__XmpPropertyInfo swig_types[40] +#define SWIGTYPE_p_Exiv2__XmpTextValue swig_types[41] +#define SWIGTYPE_p_Exiv2__XmpValue swig_types[42] +#define SWIGTYPE_p_IptcData_iterator swig_types[43] +#define SWIGTYPE_p_IptcData_iterator_base swig_types[44] +#define SWIGTYPE_p_SwigPyObject swig_types[45] +#define SWIGTYPE_p_ValueType swig_types[46] +#define SWIGTYPE_p_XmpData_iterator swig_types[47] +#define SWIGTYPE_p_XmpData_iterator_base swig_types[48] +#define SWIGTYPE_p_allocator_type swig_types[49] +#define SWIGTYPE_p_char swig_types[50] +#define SWIGTYPE_p_const_iterator swig_types[51] +#define SWIGTYPE_p_difference_type swig_types[52] +#define SWIGTYPE_p_first_type swig_types[53] +#define SWIGTYPE_p_int swig_types[54] +#define SWIGTYPE_p_iterator swig_types[55] +#define SWIGTYPE_p_key_type swig_types[56] +#define SWIGTYPE_p_long_long swig_types[57] +#define SWIGTYPE_p_mapped_type swig_types[58] +#define SWIGTYPE_p_second_type swig_types[59] +#define SWIGTYPE_p_short swig_types[60] +#define SWIGTYPE_p_signed_char swig_types[61] +#define SWIGTYPE_p_size_type swig_types[62] +#define SWIGTYPE_p_std__listT_Exiv2__Exifdatum_t swig_types[63] +#define SWIGTYPE_p_std__pairT_int32_t_int32_t_t swig_types[64] +#define SWIGTYPE_p_std__pairT_uint32_t_uint32_t_t swig_types[65] +#define SWIGTYPE_p_std__vectorT_Exiv2__Iptcdatum_std__allocatorT_Exiv2__Iptcdatum_t_t swig_types[66] +#define SWIGTYPE_p_std__vectorT_Exiv2__Xmpdatum_std__allocatorT_Exiv2__Xmpdatum_t_t swig_types[67] +#define SWIGTYPE_p_unsigned_char swig_types[68] +#define SWIGTYPE_p_unsigned_int swig_types[69] +#define SWIGTYPE_p_unsigned_long_long swig_types[70] +#define SWIGTYPE_p_unsigned_short swig_types[71] +#define SWIGTYPE_p_value_type swig_types[72] +static swig_type_info *swig_types[74]; +static swig_module_info swig_module = {swig_types, 73, 0, 0, 0, 0}; #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) @@ -4197,6 +4198,19 @@ SWIG_FromCharPtr(const char *cptr) #include "exiv2/exiv2.hpp" +#ifndef EXV_USE_CURL +namespace Exiv2 { + class CurlIo : public RemoteIo { + public: + CurlIo(const std::string& url, size_t blockSize=0) { + throw std::runtime_error( + "CurlIo not enabled in linked libexiv2"); + }; + }; +} +#endif + + #include @@ -4697,6 +4711,10 @@ static swig_type_info* basicio_subtype(Exiv2::BasicIo* ptr) { else if (dynamic_cast(ptr)) { if (dynamic_cast(ptr)) return SWIGTYPE_p_Exiv2__HttpIo; + + else if (dynamic_cast(ptr)) + return SWIGTYPE_p_Exiv2__CurlIo; + else return SWIGTYPE_p_Exiv2__RemoteIo; } @@ -7794,6 +7812,9 @@ SWIGINTERN SwigPyClientData SwigPyBuiltin__Exiv2__ImageFactory_clientdata = {0, /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ +static void *_p_Exiv2__CurlIoTo_p_Exiv2__BasicIo(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((Exiv2::BasicIo *) (Exiv2::RemoteIo *) ((Exiv2::CurlIo *) x)); +} static void *_p_Exiv2__FileIoTo_p_Exiv2__BasicIo(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((Exiv2::BasicIo *) ((Exiv2::FileIo *) x)); } @@ -7821,6 +7842,9 @@ static void *_p_Exiv2__IptcKeyTo_p_Exiv2__Key(void *x, int *SWIGUNUSEDPARM(newme static void *_p_Exiv2__XmpKeyTo_p_Exiv2__Key(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((Exiv2::Key *) ((Exiv2::XmpKey *) x)); } +static void *_p_Exiv2__CurlIoTo_p_Exiv2__RemoteIo(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((Exiv2::RemoteIo *) ((Exiv2::CurlIo *) x)); +} static void *_p_Exiv2__HttpIoTo_p_Exiv2__RemoteIo(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((Exiv2::RemoteIo *) ((Exiv2::HttpIo *) x)); } @@ -7904,6 +7928,7 @@ static swig_type_info _swigt__p_ExifData_iterator_base = {"_p_ExifData_iterator_ static swig_type_info _swigt__p_Exiv2__AsciiValue = {"_p_Exiv2__AsciiValue", "Exiv2::AsciiValue *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Exiv2__BasicIo = {"_p_Exiv2__BasicIo", "Exiv2::BasicIo *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Exiv2__CommentValue = {"_p_Exiv2__CommentValue", "Exiv2::CommentValue *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_Exiv2__CurlIo = {"_p_Exiv2__CurlIo", "Exiv2::CurlIo *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Exiv2__DataBuf = {"_p_Exiv2__DataBuf", "Exiv2::DataBuf *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Exiv2__DataSet = {"_p_Exiv2__DataSet", "Exiv2::DataSet *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Exiv2__DataValue = {"_p_Exiv2__DataValue", "Exiv2::DataValue *", 0, 0, (void*)0, 0}; @@ -7978,6 +8003,7 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_Exiv2__AsciiValue, &_swigt__p_Exiv2__BasicIo, &_swigt__p_Exiv2__CommentValue, + &_swigt__p_Exiv2__CurlIo, &_swigt__p_Exiv2__DataBuf, &_swigt__p_Exiv2__DataSet, &_swigt__p_Exiv2__DataValue, @@ -8050,8 +8076,9 @@ static swig_type_info *swig_type_initial[] = { static swig_cast_info _swigc__p_ExifData_iterator[] = { {&_swigt__p_ExifData_iterator, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_ExifData_iterator_base[] = { {&_swigt__p_ExifData_iterator_base, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__AsciiValue[] = { {&_swigt__p_Exiv2__AsciiValue, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_Exiv2__BasicIo[] = { {&_swigt__p_Exiv2__BasicIo, 0, 0, 0}, {&_swigt__p_Exiv2__FileIo, _p_Exiv2__FileIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__HttpIo, _p_Exiv2__HttpIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__MemIo, _p_Exiv2__MemIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__RemoteIo, _p_Exiv2__RemoteIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__XPathIo, _p_Exiv2__XPathIoTo_p_Exiv2__BasicIo, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Exiv2__BasicIo[] = { {&_swigt__p_Exiv2__BasicIo, 0, 0, 0}, {&_swigt__p_Exiv2__CurlIo, _p_Exiv2__CurlIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__FileIo, _p_Exiv2__FileIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__HttpIo, _p_Exiv2__HttpIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__MemIo, _p_Exiv2__MemIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__RemoteIo, _p_Exiv2__RemoteIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__XPathIo, _p_Exiv2__XPathIoTo_p_Exiv2__BasicIo, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__CommentValue[] = { {&_swigt__p_Exiv2__CommentValue, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Exiv2__CurlIo[] = { {&_swigt__p_Exiv2__CurlIo, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__DataBuf[] = { {&_swigt__p_Exiv2__DataBuf, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__DataSet[] = { {&_swigt__p_Exiv2__DataSet, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__DataValue[] = { {&_swigt__p_Exiv2__DataValue, 0, 0, 0},{0, 0, 0, 0}}; @@ -8068,7 +8095,7 @@ static swig_cast_info _swigc__p_Exiv2__IptcKey[] = { {&_swigt__p_Exiv2__IptcKey static swig_cast_info _swigc__p_Exiv2__Key[] = { {&_swigt__p_Exiv2__Key, 0, 0, 0}, {&_swigt__p_Exiv2__ExifKey, _p_Exiv2__ExifKeyTo_p_Exiv2__Key, 0, 0}, {&_swigt__p_Exiv2__IptcKey, _p_Exiv2__IptcKeyTo_p_Exiv2__Key, 0, 0}, {&_swigt__p_Exiv2__XmpKey, _p_Exiv2__XmpKeyTo_p_Exiv2__Key, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__LangAltValue[] = { {&_swigt__p_Exiv2__LangAltValue, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__MemIo[] = { {&_swigt__p_Exiv2__MemIo, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_Exiv2__RemoteIo[] = { {&_swigt__p_Exiv2__RemoteIo, 0, 0, 0}, {&_swigt__p_Exiv2__HttpIo, _p_Exiv2__HttpIoTo_p_Exiv2__RemoteIo, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Exiv2__RemoteIo[] = { {&_swigt__p_Exiv2__RemoteIo, 0, 0, 0}, {&_swigt__p_Exiv2__CurlIo, _p_Exiv2__CurlIoTo_p_Exiv2__RemoteIo, 0, 0}, {&_swigt__p_Exiv2__HttpIo, _p_Exiv2__HttpIoTo_p_Exiv2__RemoteIo, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__StringValue[] = { {&_swigt__p_Exiv2__StringValue, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__StringValueBase[] = { {&_swigt__p_Exiv2__StringValueBase, 0, 0, 0}, {&_swigt__p_Exiv2__AsciiValue, _p_Exiv2__AsciiValueTo_p_Exiv2__StringValueBase, 0, 0}, {&_swigt__p_Exiv2__CommentValue, _p_Exiv2__CommentValueTo_p_Exiv2__StringValueBase, 0, 0}, {&_swigt__p_Exiv2__StringValue, _p_Exiv2__StringValueTo_p_Exiv2__StringValueBase, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__TagInfo[] = { {&_swigt__p_Exiv2__TagInfo, 0, 0, 0},{0, 0, 0, 0}}; @@ -8126,6 +8153,7 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_Exiv2__AsciiValue, _swigc__p_Exiv2__BasicIo, _swigc__p_Exiv2__CommentValue, + _swigc__p_Exiv2__CurlIo, _swigc__p_Exiv2__DataBuf, _swigc__p_Exiv2__DataSet, _swigc__p_Exiv2__DataValue, diff --git a/src/swig-0_27_3/preview_wrap.cxx b/src/swig-0_27_3/preview_wrap.cxx index 65f5c35..2f2b02a 100644 --- a/src/swig-0_27_3/preview_wrap.cxx +++ b/src/swig-0_27_3/preview_wrap.cxx @@ -3932,75 +3932,76 @@ SwigPyBuiltin_iternextfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) { #define SWIGTYPE_p_Exiv2__AsciiValue swig_types[2] #define SWIGTYPE_p_Exiv2__BasicIo swig_types[3] #define SWIGTYPE_p_Exiv2__CommentValue swig_types[4] -#define SWIGTYPE_p_Exiv2__DataBuf swig_types[5] -#define SWIGTYPE_p_Exiv2__DataSet swig_types[6] -#define SWIGTYPE_p_Exiv2__DataValue swig_types[7] -#define SWIGTYPE_p_Exiv2__DateValue swig_types[8] -#define SWIGTYPE_p_Exiv2__ExifKey swig_types[9] -#define SWIGTYPE_p_Exiv2__FileIo swig_types[10] -#define SWIGTYPE_p_Exiv2__GroupInfo swig_types[11] -#define SWIGTYPE_p_Exiv2__HttpIo swig_types[12] -#define SWIGTYPE_p_Exiv2__Image swig_types[13] -#define SWIGTYPE_p_Exiv2__IptcKey swig_types[14] -#define SWIGTYPE_p_Exiv2__Key swig_types[15] -#define SWIGTYPE_p_Exiv2__LangAltValue swig_types[16] -#define SWIGTYPE_p_Exiv2__MemIo swig_types[17] -#define SWIGTYPE_p_Exiv2__PreviewImage swig_types[18] -#define SWIGTYPE_p_Exiv2__PreviewManager swig_types[19] -#define SWIGTYPE_p_Exiv2__PreviewProperties swig_types[20] -#define SWIGTYPE_p_Exiv2__RemoteIo swig_types[21] -#define SWIGTYPE_p_Exiv2__StringValue swig_types[22] -#define SWIGTYPE_p_Exiv2__StringValueBase swig_types[23] -#define SWIGTYPE_p_Exiv2__TagInfo swig_types[24] -#define SWIGTYPE_p_Exiv2__TimeValue swig_types[25] -#define SWIGTYPE_p_Exiv2__Value swig_types[26] -#define SWIGTYPE_p_Exiv2__ValueTypeT_double_t swig_types[27] -#define SWIGTYPE_p_Exiv2__ValueTypeT_float_t swig_types[28] -#define SWIGTYPE_p_Exiv2__ValueTypeT_int16_t_t swig_types[29] -#define SWIGTYPE_p_Exiv2__ValueTypeT_int32_t_t swig_types[30] -#define SWIGTYPE_p_Exiv2__ValueTypeT_std__pairT_int32_t_int32_t_t_t swig_types[31] -#define SWIGTYPE_p_Exiv2__ValueTypeT_std__pairT_uint32_t_uint32_t_t_t swig_types[32] -#define SWIGTYPE_p_Exiv2__ValueTypeT_uint16_t_t swig_types[33] -#define SWIGTYPE_p_Exiv2__ValueTypeT_uint32_t_t swig_types[34] -#define SWIGTYPE_p_Exiv2__XPathIo swig_types[35] -#define SWIGTYPE_p_Exiv2__XmpArrayValue swig_types[36] -#define SWIGTYPE_p_Exiv2__XmpKey swig_types[37] -#define SWIGTYPE_p_Exiv2__XmpPropertyInfo swig_types[38] -#define SWIGTYPE_p_Exiv2__XmpTextValue swig_types[39] -#define SWIGTYPE_p_Exiv2__XmpValue swig_types[40] -#define SWIGTYPE_p_IptcData_iterator swig_types[41] -#define SWIGTYPE_p_IptcData_iterator_base swig_types[42] -#define SWIGTYPE_p_SwigPyObject swig_types[43] -#define SWIGTYPE_p_ValueType swig_types[44] -#define SWIGTYPE_p_XmpData_iterator swig_types[45] -#define SWIGTYPE_p_XmpData_iterator_base swig_types[46] -#define SWIGTYPE_p_allocator_type swig_types[47] -#define SWIGTYPE_p_char swig_types[48] -#define SWIGTYPE_p_const_iterator swig_types[49] -#define SWIGTYPE_p_difference_type swig_types[50] -#define SWIGTYPE_p_first_type swig_types[51] -#define SWIGTYPE_p_int swig_types[52] -#define SWIGTYPE_p_iterator swig_types[53] -#define SWIGTYPE_p_key_type swig_types[54] -#define SWIGTYPE_p_long_long swig_types[55] -#define SWIGTYPE_p_mapped_type swig_types[56] -#define SWIGTYPE_p_second_type swig_types[57] -#define SWIGTYPE_p_short swig_types[58] -#define SWIGTYPE_p_signed_char swig_types[59] -#define SWIGTYPE_p_size_type swig_types[60] -#define SWIGTYPE_p_std__listT_Exiv2__Exifdatum_t swig_types[61] -#define SWIGTYPE_p_std__pairT_int32_t_int32_t_t swig_types[62] -#define SWIGTYPE_p_std__pairT_uint32_t_uint32_t_t swig_types[63] -#define SWIGTYPE_p_std__vectorT_Exiv2__Iptcdatum_std__allocatorT_Exiv2__Iptcdatum_t_t swig_types[64] -#define SWIGTYPE_p_std__vectorT_Exiv2__PreviewProperties_t swig_types[65] -#define SWIGTYPE_p_std__vectorT_Exiv2__Xmpdatum_std__allocatorT_Exiv2__Xmpdatum_t_t swig_types[66] -#define SWIGTYPE_p_unsigned_char swig_types[67] -#define SWIGTYPE_p_unsigned_int swig_types[68] -#define SWIGTYPE_p_unsigned_long_long swig_types[69] -#define SWIGTYPE_p_unsigned_short swig_types[70] -#define SWIGTYPE_p_value_type swig_types[71] -static swig_type_info *swig_types[73]; -static swig_module_info swig_module = {swig_types, 72, 0, 0, 0, 0}; +#define SWIGTYPE_p_Exiv2__CurlIo swig_types[5] +#define SWIGTYPE_p_Exiv2__DataBuf swig_types[6] +#define SWIGTYPE_p_Exiv2__DataSet swig_types[7] +#define SWIGTYPE_p_Exiv2__DataValue swig_types[8] +#define SWIGTYPE_p_Exiv2__DateValue swig_types[9] +#define SWIGTYPE_p_Exiv2__ExifKey swig_types[10] +#define SWIGTYPE_p_Exiv2__FileIo swig_types[11] +#define SWIGTYPE_p_Exiv2__GroupInfo swig_types[12] +#define SWIGTYPE_p_Exiv2__HttpIo swig_types[13] +#define SWIGTYPE_p_Exiv2__Image swig_types[14] +#define SWIGTYPE_p_Exiv2__IptcKey swig_types[15] +#define SWIGTYPE_p_Exiv2__Key swig_types[16] +#define SWIGTYPE_p_Exiv2__LangAltValue swig_types[17] +#define SWIGTYPE_p_Exiv2__MemIo swig_types[18] +#define SWIGTYPE_p_Exiv2__PreviewImage swig_types[19] +#define SWIGTYPE_p_Exiv2__PreviewManager swig_types[20] +#define SWIGTYPE_p_Exiv2__PreviewProperties swig_types[21] +#define SWIGTYPE_p_Exiv2__RemoteIo swig_types[22] +#define SWIGTYPE_p_Exiv2__StringValue swig_types[23] +#define SWIGTYPE_p_Exiv2__StringValueBase swig_types[24] +#define SWIGTYPE_p_Exiv2__TagInfo swig_types[25] +#define SWIGTYPE_p_Exiv2__TimeValue swig_types[26] +#define SWIGTYPE_p_Exiv2__Value swig_types[27] +#define SWIGTYPE_p_Exiv2__ValueTypeT_double_t swig_types[28] +#define SWIGTYPE_p_Exiv2__ValueTypeT_float_t swig_types[29] +#define SWIGTYPE_p_Exiv2__ValueTypeT_int16_t_t swig_types[30] +#define SWIGTYPE_p_Exiv2__ValueTypeT_int32_t_t swig_types[31] +#define SWIGTYPE_p_Exiv2__ValueTypeT_std__pairT_int32_t_int32_t_t_t swig_types[32] +#define SWIGTYPE_p_Exiv2__ValueTypeT_std__pairT_uint32_t_uint32_t_t_t swig_types[33] +#define SWIGTYPE_p_Exiv2__ValueTypeT_uint16_t_t swig_types[34] +#define SWIGTYPE_p_Exiv2__ValueTypeT_uint32_t_t swig_types[35] +#define SWIGTYPE_p_Exiv2__XPathIo swig_types[36] +#define SWIGTYPE_p_Exiv2__XmpArrayValue swig_types[37] +#define SWIGTYPE_p_Exiv2__XmpKey swig_types[38] +#define SWIGTYPE_p_Exiv2__XmpPropertyInfo swig_types[39] +#define SWIGTYPE_p_Exiv2__XmpTextValue swig_types[40] +#define SWIGTYPE_p_Exiv2__XmpValue swig_types[41] +#define SWIGTYPE_p_IptcData_iterator swig_types[42] +#define SWIGTYPE_p_IptcData_iterator_base swig_types[43] +#define SWIGTYPE_p_SwigPyObject swig_types[44] +#define SWIGTYPE_p_ValueType swig_types[45] +#define SWIGTYPE_p_XmpData_iterator swig_types[46] +#define SWIGTYPE_p_XmpData_iterator_base swig_types[47] +#define SWIGTYPE_p_allocator_type swig_types[48] +#define SWIGTYPE_p_char swig_types[49] +#define SWIGTYPE_p_const_iterator swig_types[50] +#define SWIGTYPE_p_difference_type swig_types[51] +#define SWIGTYPE_p_first_type swig_types[52] +#define SWIGTYPE_p_int swig_types[53] +#define SWIGTYPE_p_iterator swig_types[54] +#define SWIGTYPE_p_key_type swig_types[55] +#define SWIGTYPE_p_long_long swig_types[56] +#define SWIGTYPE_p_mapped_type swig_types[57] +#define SWIGTYPE_p_second_type swig_types[58] +#define SWIGTYPE_p_short swig_types[59] +#define SWIGTYPE_p_signed_char swig_types[60] +#define SWIGTYPE_p_size_type swig_types[61] +#define SWIGTYPE_p_std__listT_Exiv2__Exifdatum_t swig_types[62] +#define SWIGTYPE_p_std__pairT_int32_t_int32_t_t swig_types[63] +#define SWIGTYPE_p_std__pairT_uint32_t_uint32_t_t swig_types[64] +#define SWIGTYPE_p_std__vectorT_Exiv2__Iptcdatum_std__allocatorT_Exiv2__Iptcdatum_t_t swig_types[65] +#define SWIGTYPE_p_std__vectorT_Exiv2__PreviewProperties_t swig_types[66] +#define SWIGTYPE_p_std__vectorT_Exiv2__Xmpdatum_std__allocatorT_Exiv2__Xmpdatum_t_t swig_types[67] +#define SWIGTYPE_p_unsigned_char swig_types[68] +#define SWIGTYPE_p_unsigned_int swig_types[69] +#define SWIGTYPE_p_unsigned_long_long swig_types[70] +#define SWIGTYPE_p_unsigned_short swig_types[71] +#define SWIGTYPE_p_value_type swig_types[72] +static swig_type_info *swig_types[74]; +static swig_module_info swig_module = {swig_types, 73, 0, 0, 0, 0}; #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) @@ -4199,6 +4200,19 @@ SWIG_FromCharPtr(const char *cptr) #include "exiv2/exiv2.hpp" +#ifndef EXV_USE_CURL +namespace Exiv2 { + class CurlIo : public RemoteIo { + public: + CurlIo(const std::string& url, size_t blockSize=0) { + throw std::runtime_error( + "CurlIo not enabled in linked libexiv2"); + }; + }; +} +#endif + + #include @@ -7432,6 +7446,9 @@ SWIGINTERN SwigPyClientData SwigPyBuiltin__Exiv2__PreviewManager_clientdata = {0 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ +static void *_p_Exiv2__CurlIoTo_p_Exiv2__BasicIo(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((Exiv2::BasicIo *) (Exiv2::RemoteIo *) ((Exiv2::CurlIo *) x)); +} static void *_p_Exiv2__FileIoTo_p_Exiv2__BasicIo(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((Exiv2::BasicIo *) ((Exiv2::FileIo *) x)); } @@ -7459,6 +7476,9 @@ static void *_p_Exiv2__IptcKeyTo_p_Exiv2__Key(void *x, int *SWIGUNUSEDPARM(newme static void *_p_Exiv2__XmpKeyTo_p_Exiv2__Key(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((Exiv2::Key *) ((Exiv2::XmpKey *) x)); } +static void *_p_Exiv2__CurlIoTo_p_Exiv2__RemoteIo(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((Exiv2::RemoteIo *) ((Exiv2::CurlIo *) x)); +} static void *_p_Exiv2__HttpIoTo_p_Exiv2__RemoteIo(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((Exiv2::RemoteIo *) ((Exiv2::HttpIo *) x)); } @@ -7542,6 +7562,7 @@ static swig_type_info _swigt__p_ExifData_iterator_base = {"_p_ExifData_iterator_ static swig_type_info _swigt__p_Exiv2__AsciiValue = {"_p_Exiv2__AsciiValue", "Exiv2::AsciiValue *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Exiv2__BasicIo = {"_p_Exiv2__BasicIo", "Exiv2::BasicIo *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Exiv2__CommentValue = {"_p_Exiv2__CommentValue", "Exiv2::CommentValue *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_Exiv2__CurlIo = {"_p_Exiv2__CurlIo", "Exiv2::CurlIo *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Exiv2__DataBuf = {"_p_Exiv2__DataBuf", "Exiv2::DataBuf *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Exiv2__DataSet = {"_p_Exiv2__DataSet", "Exiv2::DataSet *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Exiv2__DataValue = {"_p_Exiv2__DataValue", "Exiv2::DataValue *", 0, 0, (void*)0, 0}; @@ -7616,6 +7637,7 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_Exiv2__AsciiValue, &_swigt__p_Exiv2__BasicIo, &_swigt__p_Exiv2__CommentValue, + &_swigt__p_Exiv2__CurlIo, &_swigt__p_Exiv2__DataBuf, &_swigt__p_Exiv2__DataSet, &_swigt__p_Exiv2__DataValue, @@ -7688,8 +7710,9 @@ static swig_type_info *swig_type_initial[] = { static swig_cast_info _swigc__p_ExifData_iterator[] = { {&_swigt__p_ExifData_iterator, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_ExifData_iterator_base[] = { {&_swigt__p_ExifData_iterator_base, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__AsciiValue[] = { {&_swigt__p_Exiv2__AsciiValue, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_Exiv2__BasicIo[] = { {&_swigt__p_Exiv2__BasicIo, 0, 0, 0}, {&_swigt__p_Exiv2__FileIo, _p_Exiv2__FileIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__HttpIo, _p_Exiv2__HttpIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__MemIo, _p_Exiv2__MemIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__RemoteIo, _p_Exiv2__RemoteIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__XPathIo, _p_Exiv2__XPathIoTo_p_Exiv2__BasicIo, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Exiv2__BasicIo[] = { {&_swigt__p_Exiv2__BasicIo, 0, 0, 0}, {&_swigt__p_Exiv2__CurlIo, _p_Exiv2__CurlIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__FileIo, _p_Exiv2__FileIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__HttpIo, _p_Exiv2__HttpIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__MemIo, _p_Exiv2__MemIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__RemoteIo, _p_Exiv2__RemoteIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__XPathIo, _p_Exiv2__XPathIoTo_p_Exiv2__BasicIo, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__CommentValue[] = { {&_swigt__p_Exiv2__CommentValue, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Exiv2__CurlIo[] = { {&_swigt__p_Exiv2__CurlIo, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__DataBuf[] = { {&_swigt__p_Exiv2__DataBuf, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__DataSet[] = { {&_swigt__p_Exiv2__DataSet, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__DataValue[] = { {&_swigt__p_Exiv2__DataValue, 0, 0, 0},{0, 0, 0, 0}}; @@ -7706,7 +7729,7 @@ static swig_cast_info _swigc__p_Exiv2__MemIo[] = { {&_swigt__p_Exiv2__MemIo, 0, static swig_cast_info _swigc__p_Exiv2__PreviewImage[] = { {&_swigt__p_Exiv2__PreviewImage, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__PreviewManager[] = { {&_swigt__p_Exiv2__PreviewManager, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__PreviewProperties[] = { {&_swigt__p_Exiv2__PreviewProperties, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_Exiv2__RemoteIo[] = { {&_swigt__p_Exiv2__RemoteIo, 0, 0, 0}, {&_swigt__p_Exiv2__HttpIo, _p_Exiv2__HttpIoTo_p_Exiv2__RemoteIo, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Exiv2__RemoteIo[] = { {&_swigt__p_Exiv2__RemoteIo, 0, 0, 0}, {&_swigt__p_Exiv2__CurlIo, _p_Exiv2__CurlIoTo_p_Exiv2__RemoteIo, 0, 0}, {&_swigt__p_Exiv2__HttpIo, _p_Exiv2__HttpIoTo_p_Exiv2__RemoteIo, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__StringValue[] = { {&_swigt__p_Exiv2__StringValue, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__StringValueBase[] = { {&_swigt__p_Exiv2__StringValueBase, 0, 0, 0}, {&_swigt__p_Exiv2__AsciiValue, _p_Exiv2__AsciiValueTo_p_Exiv2__StringValueBase, 0, 0}, {&_swigt__p_Exiv2__CommentValue, _p_Exiv2__CommentValueTo_p_Exiv2__StringValueBase, 0, 0}, {&_swigt__p_Exiv2__StringValue, _p_Exiv2__StringValueTo_p_Exiv2__StringValueBase, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__TagInfo[] = { {&_swigt__p_Exiv2__TagInfo, 0, 0, 0},{0, 0, 0, 0}}; @@ -7764,6 +7787,7 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_Exiv2__AsciiValue, _swigc__p_Exiv2__BasicIo, _swigc__p_Exiv2__CommentValue, + _swigc__p_Exiv2__CurlIo, _swigc__p_Exiv2__DataBuf, _swigc__p_Exiv2__DataSet, _swigc__p_Exiv2__DataValue, diff --git a/src/swig-0_27_3/version_wrap.cxx b/src/swig-0_27_3/version_wrap.cxx index 9078c28..3b0d067 100644 --- a/src/swig-0_27_3/version_wrap.cxx +++ b/src/swig-0_27_3/version_wrap.cxx @@ -4263,6 +4263,7 @@ static PyObject* versionInfo() { bool video = false; bool unicode = false; bool webready = false; + bool curl = false; #ifdef EXV_ENABLE_NLS nls = true; #endif @@ -4275,13 +4276,17 @@ static PyObject* versionInfo() { #ifdef EXV_ENABLE_WEBREADY webready = true; #endif - return Py_BuildValue("{ss,sN,sN,sN,sN,sN}", +#ifdef EXV_USE_CURL + curl = true; +#endif + return Py_BuildValue("{ss,sN,sN,sN,sN,sN,sN}", "version", Exiv2::version(), "EXV_ENABLE_NLS", PyBool_FromLong(nls), "EXV_ENABLE_BMFF", PyBool_FromLong(bmff), "EXV_ENABLE_VIDEO", PyBool_FromLong(video), "EXV_UNICODE_PATH", PyBool_FromLong(unicode), - "EXV_ENABLE_WEBREADY", PyBool_FromLong(webready)); + "EXV_ENABLE_WEBREADY", PyBool_FromLong(webready), + "EXV_USE_CURL", PyBool_FromLong(curl)); }; diff --git a/src/swig-0_27_7/basicio_wrap.cxx b/src/swig-0_27_7/basicio_wrap.cxx index 2b76c2f..eb80575 100644 --- a/src/swig-0_27_7/basicio_wrap.cxx +++ b/src/swig-0_27_7/basicio_wrap.cxx @@ -3926,28 +3926,29 @@ SwigPyBuiltin_iternextfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) { /* -------- TYPES TABLE (BEGIN) -------- */ #define SWIGTYPE_p_Exiv2__BasicIo swig_types[0] -#define SWIGTYPE_p_Exiv2__DataBuf swig_types[1] -#define SWIGTYPE_p_Exiv2__FileIo swig_types[2] -#define SWIGTYPE_p_Exiv2__HttpIo swig_types[3] -#define SWIGTYPE_p_Exiv2__MemIo swig_types[4] -#define SWIGTYPE_p_Exiv2__RemoteIo swig_types[5] -#define SWIGTYPE_p_Exiv2__XPathIo swig_types[6] -#define SWIGTYPE_p_SwigPyObject swig_types[7] -#define SWIGTYPE_p_char swig_types[8] -#define SWIGTYPE_p_first_type swig_types[9] -#define SWIGTYPE_p_int swig_types[10] -#define SWIGTYPE_p_long_long swig_types[11] -#define SWIGTYPE_p_second_type swig_types[12] -#define SWIGTYPE_p_short swig_types[13] -#define SWIGTYPE_p_signed_char swig_types[14] -#define SWIGTYPE_p_std__pairT_int32_t_int32_t_t swig_types[15] -#define SWIGTYPE_p_std__pairT_uint32_t_uint32_t_t swig_types[16] -#define SWIGTYPE_p_unsigned_char swig_types[17] -#define SWIGTYPE_p_unsigned_int swig_types[18] -#define SWIGTYPE_p_unsigned_long_long swig_types[19] -#define SWIGTYPE_p_unsigned_short swig_types[20] -static swig_type_info *swig_types[22]; -static swig_module_info swig_module = {swig_types, 21, 0, 0, 0, 0}; +#define SWIGTYPE_p_Exiv2__CurlIo swig_types[1] +#define SWIGTYPE_p_Exiv2__DataBuf swig_types[2] +#define SWIGTYPE_p_Exiv2__FileIo swig_types[3] +#define SWIGTYPE_p_Exiv2__HttpIo swig_types[4] +#define SWIGTYPE_p_Exiv2__MemIo swig_types[5] +#define SWIGTYPE_p_Exiv2__RemoteIo swig_types[6] +#define SWIGTYPE_p_Exiv2__XPathIo swig_types[7] +#define SWIGTYPE_p_SwigPyObject swig_types[8] +#define SWIGTYPE_p_char swig_types[9] +#define SWIGTYPE_p_first_type swig_types[10] +#define SWIGTYPE_p_int swig_types[11] +#define SWIGTYPE_p_long_long swig_types[12] +#define SWIGTYPE_p_second_type swig_types[13] +#define SWIGTYPE_p_short swig_types[14] +#define SWIGTYPE_p_signed_char swig_types[15] +#define SWIGTYPE_p_std__pairT_int32_t_int32_t_t swig_types[16] +#define SWIGTYPE_p_std__pairT_uint32_t_uint32_t_t swig_types[17] +#define SWIGTYPE_p_unsigned_char swig_types[18] +#define SWIGTYPE_p_unsigned_int swig_types[19] +#define SWIGTYPE_p_unsigned_long_long swig_types[20] +#define SWIGTYPE_p_unsigned_short swig_types[21] +static swig_type_info *swig_types[23]; +static swig_module_info swig_module = {swig_types, 22, 0, 0, 0, 0}; #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) @@ -4146,6 +4147,19 @@ SWIG_FromCharPtr(const char *cptr) #include "exiv2/exiv2.hpp" +#ifndef EXV_USE_CURL +namespace Exiv2 { + class CurlIo : public RemoteIo { + public: + CurlIo(const std::string& url, size_t blockSize=0) { + throw std::runtime_error( + "CurlIo not enabled in linked libexiv2"); + }; + }; +} +#endif + + #include @@ -4975,6 +4989,7 @@ SWIG_AsVal_size_t (PyObject * obj, size_t *val) return res; } +SWIGINTERN void delete_Exiv2_CurlIo(Exiv2::CurlIo *self){} #ifdef __cplusplus extern "C" { #endif @@ -8553,6 +8568,310 @@ SWIGINTERN int _wrap_new_HttpIo(PyObject *self, PyObject *args, PyObject *kwargs } +SWIGINTERN int _wrap_new_CurlIo__SWIG_0(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + std::string *arg1 = 0 ; + size_t arg2 ; + int res1 = SWIG_OLDOBJ ; + size_t val2 ; + int ecode2 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + Exiv2::CurlIo *result = 0 ; + + if (!SWIG_Python_CheckNoKeywords(kwargs, "new_CurlIo")) SWIG_fail; + if (!PyArg_UnpackTuple(args, "new_CurlIo", 2, 2, &obj1, &obj2)) SWIG_fail; + { + std::string *ptr = (std::string *)0; + res1 = SWIG_AsPtr_std_string(obj1, &ptr); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CurlIo" "', argument " "1"" of type '" "std::string const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_CurlIo" "', argument " "1"" of type '" "std::string const &""'"); + } + arg1 = ptr; + } + ecode2 = SWIG_AsVal_size_t(obj2, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CurlIo" "', argument " "2"" of type '" "size_t""'"); + } + arg2 = static_cast< size_t >(val2); + { +#ifdef _WIN32 + if (utf8_to_wcp(arg1, true) < 0) { + SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); + } +#endif + } + { + try { + result = (Exiv2::CurlIo *)new Exiv2::CurlIo((std::string const &)*arg1,arg2); + } + catch(std::exception const& e) { + _set_python_exception(); + SWIG_fail; + } + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Exiv2__CurlIo, SWIG_BUILTIN_INIT | 0 ); + if (SWIG_IsNewObj(res1)) delete arg1; + return resultobj == Py_None ? -1 : 0; +fail: + if (SWIG_IsNewObj(res1)) delete arg1; + return -1; +} + + +SWIGINTERN int _wrap_new_CurlIo__SWIG_1(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + std::string *arg1 = 0 ; + int res1 = SWIG_OLDOBJ ; + PyObject * obj1 = 0 ; + Exiv2::CurlIo *result = 0 ; + + if (!SWIG_Python_CheckNoKeywords(kwargs, "new_CurlIo")) SWIG_fail; + if (!PyArg_UnpackTuple(args, "new_CurlIo", 1, 1, &obj1)) SWIG_fail; + { + std::string *ptr = (std::string *)0; + res1 = SWIG_AsPtr_std_string(obj1, &ptr); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CurlIo" "', argument " "1"" of type '" "std::string const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_CurlIo" "', argument " "1"" of type '" "std::string const &""'"); + } + arg1 = ptr; + } + { +#ifdef _WIN32 + if (utf8_to_wcp(arg1, true) < 0) { + SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); + } +#endif + } + { + try { + result = (Exiv2::CurlIo *)new Exiv2::CurlIo((std::string const &)*arg1); + } + catch(std::exception const& e) { + _set_python_exception(); + SWIG_fail; + } + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Exiv2__CurlIo, SWIG_BUILTIN_INIT | 0 ); + if (SWIG_IsNewObj(res1)) delete arg1; + return resultobj == Py_None ? -1 : 0; +fail: + if (SWIG_IsNewObj(res1)) delete arg1; + return -1; +} + + +SWIGINTERN int _wrap_new_CurlIo(PyObject *self, PyObject *args, PyObject *kwargs) { + Py_ssize_t argc; + PyObject *argv[3] = { + 0 + }; + Py_ssize_t ii; + + (void)self; + if (!SWIG_Python_CheckNoKeywords(kwargs, "new_CurlIo")) SWIG_fail; + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < 2) && (ii < argc); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 1) { + int retval = _wrap_new_CurlIo__SWIG_1(self, args, NULL); + if (retval == 0 || !SWIG_Python_TypeErrorOccurred(NULL)) return retval; + SWIG_fail; + } + if (argc == 2) { + int retval = _wrap_new_CurlIo__SWIG_0(self, args, NULL); + if (retval == 0 || !SWIG_Python_TypeErrorOccurred(NULL)) return retval; + SWIG_fail; + } + +fail: + SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'new_CurlIo'.\n" + " Possible C/C++ prototypes are:\n" + " Exiv2::CurlIo::CurlIo(std::string const &,size_t)\n" + " Exiv2::CurlIo::CurlIo(std::string const &)\n"); + return -1; +} + + +SWIGINTERN PyObject *_wrap_CurlIo_write__SWIG_0(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + Exiv2::CurlIo *arg1 = (Exiv2::CurlIo *) 0 ; + Exiv2::byte *arg2 = (Exiv2::byte *) 0 ; + long arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *_global_view = NULL ; + PyObject * obj1 = 0 ; + long result; + + if (!PyArg_UnpackTuple(args, "CurlIo_write", 1, 1, &obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Exiv2__CurlIo, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CurlIo_write" "', argument " "1"" of type '" "Exiv2::CurlIo *""'"); + } + arg1 = reinterpret_cast< Exiv2::CurlIo * >(argp1); + { + _global_view = PyMemoryView_GetContiguous(obj1, PyBUF_READ, 'A'); + if (!_global_view) { + PyErr_Clear(); + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "CurlIo_write" "', argument " "2"" of type '" "bytes-like object""'") + ; + } + Py_buffer* buff = PyMemoryView_GET_BUFFER(_global_view); + arg2 = (Exiv2::byte *) buff->buf; + arg3 = (long) buff->len; + } + { + try { + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (long)(arg1)->write((Exiv2::byte const *)arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + } + catch(std::exception const& e) { + _set_python_exception(); + SWIG_fail; + } + } + resultobj = SWIG_From_long(static_cast< long >(result)); + + Py_XDECREF(_global_view); + + return resultobj; +fail: + + Py_XDECREF(_global_view); + + return NULL; +} + + +SWIGINTERN PyObject *_wrap_CurlIo_write__SWIG_1(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + Exiv2::CurlIo *arg1 = (Exiv2::CurlIo *) 0 ; + Exiv2::BasicIo *arg2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj1 = 0 ; + long result; + + if (!PyArg_UnpackTuple(args, "CurlIo_write", 1, 1, &obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Exiv2__CurlIo, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CurlIo_write" "', argument " "1"" of type '" "Exiv2::CurlIo *""'"); + } + arg1 = reinterpret_cast< Exiv2::CurlIo * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_Exiv2__BasicIo, 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CurlIo_write" "', argument " "2"" of type '" "Exiv2::BasicIo &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CurlIo_write" "', argument " "2"" of type '" "Exiv2::BasicIo &""'"); + } + arg2 = reinterpret_cast< Exiv2::BasicIo * >(argp2); + { + try { + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (long)(arg1)->write(*arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + } + catch(std::exception const& e) { + _set_python_exception(); + SWIG_fail; + } + } + resultobj = SWIG_From_long(static_cast< long >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_CurlIo_write(PyObject *self, PyObject *args) { + Py_ssize_t argc; + PyObject *argv[3] = { + 0 + }; + Py_ssize_t ii; + + (void)self; + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + argv[0] = self; + for (ii = 0; (ii < 1) && (ii < argc); ii++) { + argv[ii + 1] = PyTuple_GET_ITEM(args,ii); + } + argc++; + if (argc == 2) { + int _v = 0; + { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Exiv2__BasicIo, SWIG_POINTER_NO_NULL); + _v = SWIG_CheckState(res); + } + if (!_v) goto check_1; + return _wrap_CurlIo_write__SWIG_1(self, args); + } +check_1: + + if (argc == 2) { + PyObject *retobj = _wrap_CurlIo_write__SWIG_0(self, args); + if (!SWIG_Python_TypeErrorOccurred(retobj)) return retobj; + SWIG_fail; + } + +fail: + SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'CurlIo_write'.\n" + " Possible C/C++ prototypes are:\n" + " Exiv2::CurlIo::write(Exiv2::byte const *,long)\n" + " Exiv2::CurlIo::write(Exiv2::BasicIo &)\n"); + return 0; +} + + +SWIGINTERN PyObject *_wrap_delete_CurlIo(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + Exiv2::CurlIo *arg1 = (Exiv2::CurlIo *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + + if (args && PyTuple_Check(args) && PyTuple_GET_SIZE(args) > 0) SWIG_exception_fail(SWIG_TypeError, "delete_CurlIo takes no arguments"); + res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Exiv2__CurlIo, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CurlIo" "', argument " "1"" of type '" "Exiv2::CurlIo *""'"); + } + arg1 = reinterpret_cast< Exiv2::CurlIo * >(argp1); + { + try { + delete_Exiv2_CurlIo(arg1); + } + catch(std::exception const& e) { + _set_python_exception(); + SWIG_fail; + } + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGPY_DESTRUCTOR_CLOSURE(_wrap_delete_CurlIo) /* defines _wrap_delete_CurlIo_destructor_closure */ + static PyMethodDef SwigMethods[] = { { "_enum_list_Position", _wrap__enum_list_Position, METH_VARARGS, NULL}, { NULL, NULL, 0, NULL } @@ -10721,9 +11040,279 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__HttpIo_type = { SWIGINTERN SwigPyClientData SwigPyBuiltin__Exiv2__HttpIo_clientdata = {0, 0, 0, 0, 0, 0, (PyTypeObject *)&SwigPyBuiltin__Exiv2__HttpIo_type}; +static SwigPyGetSet CurlIo___dict___getset = { SwigPyObject_get___dict__, 0 }; +SWIGINTERN PyGetSetDef SwigPyBuiltin__Exiv2__CurlIo_getset[] = { + { (char *)"__dict__", SwigPyBuiltin_GetterClosure, 0, (char *)"\n" + "Constructor that accepts the URL on which IO will be\n" + " performed.\n" + ":type url: str\n" + ":param url: The full path of url\n" + ":type blockSize: int, optional\n" + ":param blockSize: the size of the memory block. The file content is\n" + " divided into the memory blocks. These blocks are populated\n" + " on demand from the server, so it avoids copying the complete file.\n" + ":raises: Error if it is unable to init curl pointer.\n" + "", &CurlIo___dict___getset }, + { NULL, NULL, NULL, NULL, NULL } /* Sentinel */ +}; + +SWIGINTERN PyObject * +SwigPyBuiltin__Exiv2__CurlIo_richcompare(PyObject *self, PyObject *other, int op) { + PyObject *result = NULL; + PyObject *tuple = PyTuple_New(1); + assert(tuple); + PyTuple_SET_ITEM(tuple, 0, other); + Py_XINCREF(other); + if (!result && !PyErr_Occurred()) { + if (SwigPyObject_Check(self) && SwigPyObject_Check(other)) { + result = SwigPyObject_richcompare((SwigPyObject *)self, (SwigPyObject *)other, op); + } else { + result = Py_NotImplemented; + Py_INCREF(result); + } + } + Py_DECREF(tuple); + return result; +} + +SWIGINTERN PyMethodDef SwigPyBuiltin__Exiv2__CurlIo_methods[] = { + { "write", _wrap_CurlIo_write, METH_VARARGS, "\n" + "*Overload 1:*\n" + "\n" + "Write access is only available for some protocols. This method\n" + " will call RemoteIo::write(const byte* data, long wcount) if the write\n" + " access is available for the protocol. Otherwise, it throws the Error.\n" + "\n" + "|\n" + "\n" + "*Overload 2:*\n" + "\n" + "Write access is only available for some protocols. This method\n" + " will call RemoteIo::write(BasicIo& src) if the write access is available\n" + " for the protocol. Otherwise, it throws the Error.\n" + "" }, + { NULL, NULL, 0, NULL } /* Sentinel */ +}; + +static PyHeapTypeObject SwigPyBuiltin__Exiv2__CurlIo_type = { + { +#if PY_VERSION_HEX >= 0x03000000 + PyVarObject_HEAD_INIT(NULL, 0) +#else + PyObject_HEAD_INIT(NULL) + 0, /* ob_size */ +#endif + "exiv2.basicio.CurlIo", /* tp_name */ + sizeof(SwigPyObject), /* tp_basicsize */ + 0, /* tp_itemsize */ + _wrap_delete_CurlIo_destructor_closure, /* tp_dealloc */ +#if PY_VERSION_HEX < 0x030800b4 + (printfunc) 0, /* tp_print */ +#else + (Py_ssize_t) 0, /* tp_vectorcall_offset */ +#endif + (getattrfunc) 0, /* tp_getattr */ + (setattrfunc) 0, /* tp_setattr */ +#if PY_VERSION_HEX >= 0x03000000 + 0, /* tp_compare */ +#else + (cmpfunc) 0, /* tp_compare */ +#endif + (reprfunc) 0, /* tp_repr */ + &SwigPyBuiltin__Exiv2__CurlIo_type.as_number, /* tp_as_number */ + &SwigPyBuiltin__Exiv2__CurlIo_type.as_sequence, /* tp_as_sequence */ + &SwigPyBuiltin__Exiv2__CurlIo_type.as_mapping, /* tp_as_mapping */ + SwigPyObject_hash, /* tp_hash */ + (ternaryfunc) 0, /* tp_call */ + (reprfunc) 0, /* tp_str */ + (getattrofunc) 0, /* tp_getattro */ + (setattrofunc) 0, /* tp_setattro */ + &SwigPyBuiltin__Exiv2__CurlIo_type.as_buffer, /* tp_as_buffer */ +#if PY_VERSION_HEX >= 0x03000000 + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */ +#else + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES, /* tp_flags */ +#endif + "\n" + "Provides the http, https read/write access and ftp read access for the RemoteIo.\n" + " This class is based on libcurl.\n" + "",/* tp_doc */ + (traverseproc) 0, /* tp_traverse */ + (inquiry) 0, /* tp_clear */ + SwigPyBuiltin__Exiv2__CurlIo_richcompare, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + (getiterfunc) 0, /* tp_iter */ + (iternextfunc) 0, /* tp_iternext */ + SwigPyBuiltin__Exiv2__CurlIo_methods, /* tp_methods */ + 0, /* tp_members */ + SwigPyBuiltin__Exiv2__CurlIo_getset, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + (descrgetfunc) 0, /* tp_descr_get */ + (descrsetfunc) 0, /* tp_descr_set */ + offsetof(SwigPyObject, dict), /* tp_dictoffset */ + _wrap_new_CurlIo, /* tp_init */ + (allocfunc) 0, /* tp_alloc */ + (newfunc) 0, /* tp_new */ + (freefunc) 0, /* tp_free */ + (inquiry) 0, /* tp_is_gc */ + (PyObject *) 0, /* tp_bases */ + (PyObject *) 0, /* tp_mro */ + (PyObject *) 0, /* tp_cache */ + (PyObject *) 0, /* tp_subclasses */ + (PyObject *) 0, /* tp_weaklist */ + (destructor) 0, /* tp_del */ + (int) 0, /* tp_version_tag */ +#if PY_VERSION_HEX >= 0x03040000 + (destructor) 0, /* tp_finalize */ +#endif +#if PY_VERSION_HEX >= 0x03080000 + (vectorcallfunc) 0, /* tp_vectorcall */ +#endif +#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) + 0, /* tp_print */ +#endif +#if PY_VERSION_HEX >= 0x030c0000 + (char) 0, /* tp_watched */ +#endif +#ifdef COUNT_ALLOCS + (Py_ssize_t) 0, /* tp_allocs */ + (Py_ssize_t) 0, /* tp_frees */ + (Py_ssize_t) 0, /* tp_maxalloc */ + 0, /* tp_prev */ + 0, /* tp_next */ +#endif + }, +#if PY_VERSION_HEX >= 0x03050000 + { + (unaryfunc) 0, /* am_await */ + (unaryfunc) 0, /* am_aiter */ + (unaryfunc) 0, /* am_anext */ +# if PY_VERSION_HEX >= 0x030a0000 + (sendfunc) 0, /* am_send */ +# endif + }, +#endif + { + (binaryfunc) 0, /* nb_add */ + (binaryfunc) 0, /* nb_subtract */ + (binaryfunc) 0, /* nb_multiply */ +#if PY_VERSION_HEX < 0x03000000 + (binaryfunc) 0, /* nb_divide */ +#endif + (binaryfunc) 0, /* nb_remainder */ + (binaryfunc) 0, /* nb_divmod */ + (ternaryfunc) 0, /* nb_power */ + (unaryfunc) 0, /* nb_negative */ + (unaryfunc) 0, /* nb_positive */ + (unaryfunc) 0, /* nb_absolute */ + (inquiry) 0, /* nb_nonzero */ + (unaryfunc) 0, /* nb_invert */ + (binaryfunc) 0, /* nb_lshift */ + (binaryfunc) 0, /* nb_rshift */ + (binaryfunc) 0, /* nb_and */ + (binaryfunc) 0, /* nb_xor */ + (binaryfunc) 0, /* nb_or */ +#if PY_VERSION_HEX < 0x03000000 + (coercion) 0, /* nb_coerce */ +#endif + (unaryfunc) 0, /* nb_int */ +#if PY_VERSION_HEX >= 0x03000000 + (void *) 0, /* nb_reserved */ +#else + (unaryfunc) 0, /* nb_long */ +#endif + (unaryfunc) 0, /* nb_float */ +#if PY_VERSION_HEX < 0x03000000 + (unaryfunc) 0, /* nb_oct */ + (unaryfunc) 0, /* nb_hex */ +#endif + (binaryfunc) 0, /* nb_inplace_add */ + (binaryfunc) 0, /* nb_inplace_subtract */ + (binaryfunc) 0, /* nb_inplace_multiply */ +#if PY_VERSION_HEX < 0x03000000 + (binaryfunc) 0, /* nb_inplace_divide */ +#endif + (binaryfunc) 0, /* nb_inplace_remainder */ + (ternaryfunc) 0, /* nb_inplace_power */ + (binaryfunc) 0, /* nb_inplace_lshift */ + (binaryfunc) 0, /* nb_inplace_rshift */ + (binaryfunc) 0, /* nb_inplace_and */ + (binaryfunc) 0, /* nb_inplace_xor */ + (binaryfunc) 0, /* nb_inplace_or */ + (binaryfunc) 0, /* nb_floor_divide */ + (binaryfunc) 0, /* nb_true_divide */ + (binaryfunc) 0, /* nb_inplace_floor_divide */ + (binaryfunc) 0, /* nb_inplace_true_divide */ + (unaryfunc) 0, /* nb_index */ +#if PY_VERSION_HEX >= 0x03050000 + (binaryfunc) 0, /* nb_matrix_multiply */ + (binaryfunc) 0, /* nb_inplace_matrix_multiply */ +#endif + }, + { + (lenfunc) 0, /* mp_length */ + (binaryfunc) 0, /* mp_subscript */ + (objobjargproc) 0, /* mp_ass_subscript */ + }, + { + (lenfunc) 0, /* sq_length */ + (binaryfunc) 0, /* sq_concat */ + (ssizeargfunc) 0, /* sq_repeat */ + (ssizeargfunc) 0, /* sq_item */ +#if PY_VERSION_HEX >= 0x03000000 + (void *) 0, /* was_sq_slice */ +#else + (ssizessizeargfunc) 0, /* sq_slice */ +#endif + (ssizeobjargproc) 0, /* sq_ass_item */ +#if PY_VERSION_HEX >= 0x03000000 + (void *) 0, /* was_sq_ass_slice */ +#else + (ssizessizeobjargproc) 0, /* sq_ass_slice */ +#endif + (objobjproc) 0, /* sq_contains */ + (binaryfunc) 0, /* sq_inplace_concat */ + (ssizeargfunc) 0, /* sq_inplace_repeat */ + }, + { +#if PY_VERSION_HEX < 0x03000000 + (readbufferproc) 0, /* bf_getreadbuffer */ + (writebufferproc) 0, /* bf_getwritebuffer */ + (segcountproc) 0, /* bf_getsegcount */ + (charbufferproc) 0, /* bf_getcharbuffer */ +#endif + (getbufferproc) 0, /* bf_getbuffer */ + (releasebufferproc) 0, /* bf_releasebuffer */ + }, + (PyObject *) 0, /* ht_name */ + (PyObject *) 0, /* ht_slots */ +#if PY_VERSION_HEX >= 0x03030000 + (PyObject *) 0, /* ht_qualname */ + 0, /* ht_cached_keys */ +#endif +#if PY_VERSION_HEX >= 0x03090000 + (PyObject *) 0, /* ht_module */ +#endif +#if PY_VERSION_HEX >= 0x030b0000 + (char *) 0, /* _ht_tpname */ + { + (PyObject *) 0, /* getitem */ +#if PY_VERSION_HEX >= 0x030c0000 + (uint32_t) 0, /* getitem_version */ +#endif + } +#endif +}; + +SWIGINTERN SwigPyClientData SwigPyBuiltin__Exiv2__CurlIo_clientdata = {0, 0, 0, 0, 0, 0, (PyTypeObject *)&SwigPyBuiltin__Exiv2__CurlIo_type}; + /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ +static void *_p_Exiv2__CurlIoTo_p_Exiv2__BasicIo(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((Exiv2::BasicIo *) (Exiv2::RemoteIo *) ((Exiv2::CurlIo *) x)); +} static void *_p_Exiv2__FileIoTo_p_Exiv2__BasicIo(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((Exiv2::BasicIo *) ((Exiv2::FileIo *) x)); } @@ -10742,10 +11331,14 @@ static void *_p_Exiv2__XPathIoTo_p_Exiv2__BasicIo(void *x, int *SWIGUNUSEDPARM(n static void *_p_Exiv2__XPathIoTo_p_Exiv2__FileIo(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((Exiv2::FileIo *) ((Exiv2::XPathIo *) x)); } +static void *_p_Exiv2__CurlIoTo_p_Exiv2__RemoteIo(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((Exiv2::RemoteIo *) ((Exiv2::CurlIo *) x)); +} static void *_p_Exiv2__HttpIoTo_p_Exiv2__RemoteIo(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((Exiv2::RemoteIo *) ((Exiv2::HttpIo *) x)); } static swig_type_info _swigt__p_Exiv2__BasicIo = {"_p_Exiv2__BasicIo", "Exiv2::BasicIo *", 0, 0, (void*)&SwigPyBuiltin__Exiv2__BasicIo_clientdata, 0}; +static swig_type_info _swigt__p_Exiv2__CurlIo = {"_p_Exiv2__CurlIo", "Exiv2::CurlIo *", 0, 0, (void*)&SwigPyBuiltin__Exiv2__CurlIo_clientdata, 0}; static swig_type_info _swigt__p_Exiv2__DataBuf = {"_p_Exiv2__DataBuf", "Exiv2::DataBuf *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Exiv2__FileIo = {"_p_Exiv2__FileIo", "Exiv2::FileIo *", 0, 0, (void*)&SwigPyBuiltin__Exiv2__FileIo_clientdata, 0}; static swig_type_info _swigt__p_Exiv2__HttpIo = {"_p_Exiv2__HttpIo", "Exiv2::HttpIo *", 0, 0, (void*)&SwigPyBuiltin__Exiv2__HttpIo_clientdata, 0}; @@ -10769,6 +11362,7 @@ static swig_type_info _swigt__p_unsigned_short = {"_p_unsigned_short", "uint16_t static swig_type_info *swig_type_initial[] = { &_swigt__p_Exiv2__BasicIo, + &_swigt__p_Exiv2__CurlIo, &_swigt__p_Exiv2__DataBuf, &_swigt__p_Exiv2__FileIo, &_swigt__p_Exiv2__HttpIo, @@ -10791,12 +11385,13 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_unsigned_short, }; -static swig_cast_info _swigc__p_Exiv2__BasicIo[] = { {&_swigt__p_Exiv2__BasicIo, 0, 0, 0}, {&_swigt__p_Exiv2__FileIo, _p_Exiv2__FileIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__HttpIo, _p_Exiv2__HttpIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__MemIo, _p_Exiv2__MemIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__RemoteIo, _p_Exiv2__RemoteIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__XPathIo, _p_Exiv2__XPathIoTo_p_Exiv2__BasicIo, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Exiv2__BasicIo[] = { {&_swigt__p_Exiv2__BasicIo, 0, 0, 0}, {&_swigt__p_Exiv2__CurlIo, _p_Exiv2__CurlIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__FileIo, _p_Exiv2__FileIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__HttpIo, _p_Exiv2__HttpIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__MemIo, _p_Exiv2__MemIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__RemoteIo, _p_Exiv2__RemoteIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__XPathIo, _p_Exiv2__XPathIoTo_p_Exiv2__BasicIo, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Exiv2__CurlIo[] = { {&_swigt__p_Exiv2__CurlIo, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__DataBuf[] = { {&_swigt__p_Exiv2__DataBuf, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__FileIo[] = { {&_swigt__p_Exiv2__FileIo, 0, 0, 0}, {&_swigt__p_Exiv2__XPathIo, _p_Exiv2__XPathIoTo_p_Exiv2__FileIo, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__HttpIo[] = { {&_swigt__p_Exiv2__HttpIo, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__MemIo[] = { {&_swigt__p_Exiv2__MemIo, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_Exiv2__RemoteIo[] = { {&_swigt__p_Exiv2__RemoteIo, 0, 0, 0}, {&_swigt__p_Exiv2__HttpIo, _p_Exiv2__HttpIoTo_p_Exiv2__RemoteIo, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Exiv2__RemoteIo[] = { {&_swigt__p_Exiv2__RemoteIo, 0, 0, 0}, {&_swigt__p_Exiv2__CurlIo, _p_Exiv2__CurlIoTo_p_Exiv2__RemoteIo, 0, 0}, {&_swigt__p_Exiv2__HttpIo, _p_Exiv2__HttpIoTo_p_Exiv2__RemoteIo, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__XPathIo[] = { {&_swigt__p_Exiv2__XPathIo, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_SwigPyObject[] = { {&_swigt__p_SwigPyObject, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; @@ -10815,6 +11410,7 @@ static swig_cast_info _swigc__p_unsigned_short[] = { {&_swigt__p_unsigned_short static swig_cast_info *swig_cast_initial[] = { _swigc__p_Exiv2__BasicIo, + _swigc__p_Exiv2__CurlIo, _swigc__p_Exiv2__DataBuf, _swigc__p_Exiv2__FileIo, _swigc__p_Exiv2__HttpIo, @@ -11525,6 +12121,40 @@ SWIG_init(void) { SwigPyBuiltin_AddPublicSymbol(public_interface, "HttpIo"); d = md; + /* type 'Exiv2::CurlIo' */ + builtin_pytype = (PyTypeObject *)&SwigPyBuiltin__Exiv2__CurlIo_type; + builtin_pytype->tp_dict = d = PyDict_New(); + SwigPyBuiltin_SetMetaType(builtin_pytype, metatype); + builtin_pytype->tp_new = PyType_GenericNew; + builtin_base_count = 0; + builtin_basetype = SWIG_MangledTypeQuery("_p_Exiv2__RemoteIo"); + if (builtin_basetype && builtin_basetype->clientdata && ((SwigPyClientData *) builtin_basetype->clientdata)->pytype) { + builtin_bases[builtin_base_count++] = ((SwigPyClientData *) builtin_basetype->clientdata)->pytype; + } else { + PyErr_SetString(PyExc_TypeError, "Could not create type 'CurlIo' as base 'Exiv2::RemoteIo' has not been initialized.\n"); +#if PY_VERSION_HEX >= 0x03000000 + return NULL; +#else + return; +#endif + } + builtin_bases[builtin_base_count] = NULL; + SwigPyBuiltin_InitBases(builtin_pytype, builtin_bases); + PyDict_SetItemString(d, "this", this_descr); + PyDict_SetItemString(d, "thisown", thisown_descr); + if (PyType_Ready(builtin_pytype) < 0) { + PyErr_SetString(PyExc_TypeError, "Could not create type 'CurlIo'."); +#if PY_VERSION_HEX >= 0x03000000 + return NULL; +#else + return; +#endif + } + Py_INCREF(builtin_pytype); + PyModule_AddObject(m, "CurlIo", (PyObject *)builtin_pytype); + SwigPyBuiltin_AddPublicSymbol(public_interface, "CurlIo"); + d = md; + /* Initialize threading */ SWIG_PYTHON_INITIALIZE_THREADS; #if PY_VERSION_HEX >= 0x03000000 diff --git a/src/swig-0_27_7/image_wrap.cxx b/src/swig-0_27_7/image_wrap.cxx index ec82656..3b28b29 100644 --- a/src/swig-0_27_7/image_wrap.cxx +++ b/src/swig-0_27_7/image_wrap.cxx @@ -3930,75 +3930,76 @@ SwigPyBuiltin_iternextfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) { #define SWIGTYPE_p_Exiv2__AsciiValue swig_types[2] #define SWIGTYPE_p_Exiv2__BasicIo swig_types[3] #define SWIGTYPE_p_Exiv2__CommentValue swig_types[4] -#define SWIGTYPE_p_Exiv2__DataBuf swig_types[5] -#define SWIGTYPE_p_Exiv2__DataSet swig_types[6] -#define SWIGTYPE_p_Exiv2__DataValue swig_types[7] -#define SWIGTYPE_p_Exiv2__DateValue swig_types[8] -#define SWIGTYPE_p_Exiv2__ExifData swig_types[9] -#define SWIGTYPE_p_Exiv2__ExifKey swig_types[10] -#define SWIGTYPE_p_Exiv2__FileIo swig_types[11] -#define SWIGTYPE_p_Exiv2__GroupInfo swig_types[12] -#define SWIGTYPE_p_Exiv2__HttpIo swig_types[13] -#define SWIGTYPE_p_Exiv2__Image swig_types[14] -#define SWIGTYPE_p_Exiv2__ImageFactory swig_types[15] -#define SWIGTYPE_p_Exiv2__IptcData swig_types[16] -#define SWIGTYPE_p_Exiv2__IptcKey swig_types[17] -#define SWIGTYPE_p_Exiv2__Key swig_types[18] -#define SWIGTYPE_p_Exiv2__LangAltValue swig_types[19] -#define SWIGTYPE_p_Exiv2__MemIo swig_types[20] -#define SWIGTYPE_p_Exiv2__RemoteIo swig_types[21] -#define SWIGTYPE_p_Exiv2__StringValue swig_types[22] -#define SWIGTYPE_p_Exiv2__StringValueBase swig_types[23] -#define SWIGTYPE_p_Exiv2__TagInfo swig_types[24] -#define SWIGTYPE_p_Exiv2__TimeValue swig_types[25] -#define SWIGTYPE_p_Exiv2__Value swig_types[26] -#define SWIGTYPE_p_Exiv2__ValueTypeT_double_t swig_types[27] -#define SWIGTYPE_p_Exiv2__ValueTypeT_float_t swig_types[28] -#define SWIGTYPE_p_Exiv2__ValueTypeT_int16_t_t swig_types[29] -#define SWIGTYPE_p_Exiv2__ValueTypeT_int32_t_t swig_types[30] -#define SWIGTYPE_p_Exiv2__ValueTypeT_std__pairT_int32_t_int32_t_t_t swig_types[31] -#define SWIGTYPE_p_Exiv2__ValueTypeT_std__pairT_uint32_t_uint32_t_t_t swig_types[32] -#define SWIGTYPE_p_Exiv2__ValueTypeT_uint16_t_t swig_types[33] -#define SWIGTYPE_p_Exiv2__ValueTypeT_uint32_t_t swig_types[34] -#define SWIGTYPE_p_Exiv2__XPathIo swig_types[35] -#define SWIGTYPE_p_Exiv2__XmpArrayValue swig_types[36] -#define SWIGTYPE_p_Exiv2__XmpData swig_types[37] -#define SWIGTYPE_p_Exiv2__XmpKey swig_types[38] -#define SWIGTYPE_p_Exiv2__XmpPropertyInfo swig_types[39] -#define SWIGTYPE_p_Exiv2__XmpTextValue swig_types[40] -#define SWIGTYPE_p_Exiv2__XmpValue swig_types[41] -#define SWIGTYPE_p_IptcData_iterator swig_types[42] -#define SWIGTYPE_p_IptcData_iterator_base swig_types[43] -#define SWIGTYPE_p_SwigPyObject swig_types[44] -#define SWIGTYPE_p_ValueType swig_types[45] -#define SWIGTYPE_p_XmpData_iterator swig_types[46] -#define SWIGTYPE_p_XmpData_iterator_base swig_types[47] -#define SWIGTYPE_p_allocator_type swig_types[48] -#define SWIGTYPE_p_char swig_types[49] -#define SWIGTYPE_p_const_iterator swig_types[50] -#define SWIGTYPE_p_difference_type swig_types[51] -#define SWIGTYPE_p_first_type swig_types[52] -#define SWIGTYPE_p_int swig_types[53] -#define SWIGTYPE_p_iterator swig_types[54] -#define SWIGTYPE_p_key_type swig_types[55] -#define SWIGTYPE_p_long_long swig_types[56] -#define SWIGTYPE_p_mapped_type swig_types[57] -#define SWIGTYPE_p_second_type swig_types[58] -#define SWIGTYPE_p_short swig_types[59] -#define SWIGTYPE_p_signed_char swig_types[60] -#define SWIGTYPE_p_size_type swig_types[61] -#define SWIGTYPE_p_std__listT_Exiv2__Exifdatum_t swig_types[62] -#define SWIGTYPE_p_std__pairT_int32_t_int32_t_t swig_types[63] -#define SWIGTYPE_p_std__pairT_uint32_t_uint32_t_t swig_types[64] -#define SWIGTYPE_p_std__vectorT_Exiv2__Iptcdatum_std__allocatorT_Exiv2__Iptcdatum_t_t swig_types[65] -#define SWIGTYPE_p_std__vectorT_Exiv2__Xmpdatum_std__allocatorT_Exiv2__Xmpdatum_t_t swig_types[66] -#define SWIGTYPE_p_unsigned_char swig_types[67] -#define SWIGTYPE_p_unsigned_int swig_types[68] -#define SWIGTYPE_p_unsigned_long_long swig_types[69] -#define SWIGTYPE_p_unsigned_short swig_types[70] -#define SWIGTYPE_p_value_type swig_types[71] -static swig_type_info *swig_types[73]; -static swig_module_info swig_module = {swig_types, 72, 0, 0, 0, 0}; +#define SWIGTYPE_p_Exiv2__CurlIo swig_types[5] +#define SWIGTYPE_p_Exiv2__DataBuf swig_types[6] +#define SWIGTYPE_p_Exiv2__DataSet swig_types[7] +#define SWIGTYPE_p_Exiv2__DataValue swig_types[8] +#define SWIGTYPE_p_Exiv2__DateValue swig_types[9] +#define SWIGTYPE_p_Exiv2__ExifData swig_types[10] +#define SWIGTYPE_p_Exiv2__ExifKey swig_types[11] +#define SWIGTYPE_p_Exiv2__FileIo swig_types[12] +#define SWIGTYPE_p_Exiv2__GroupInfo swig_types[13] +#define SWIGTYPE_p_Exiv2__HttpIo swig_types[14] +#define SWIGTYPE_p_Exiv2__Image swig_types[15] +#define SWIGTYPE_p_Exiv2__ImageFactory swig_types[16] +#define SWIGTYPE_p_Exiv2__IptcData swig_types[17] +#define SWIGTYPE_p_Exiv2__IptcKey swig_types[18] +#define SWIGTYPE_p_Exiv2__Key swig_types[19] +#define SWIGTYPE_p_Exiv2__LangAltValue swig_types[20] +#define SWIGTYPE_p_Exiv2__MemIo swig_types[21] +#define SWIGTYPE_p_Exiv2__RemoteIo swig_types[22] +#define SWIGTYPE_p_Exiv2__StringValue swig_types[23] +#define SWIGTYPE_p_Exiv2__StringValueBase swig_types[24] +#define SWIGTYPE_p_Exiv2__TagInfo swig_types[25] +#define SWIGTYPE_p_Exiv2__TimeValue swig_types[26] +#define SWIGTYPE_p_Exiv2__Value swig_types[27] +#define SWIGTYPE_p_Exiv2__ValueTypeT_double_t swig_types[28] +#define SWIGTYPE_p_Exiv2__ValueTypeT_float_t swig_types[29] +#define SWIGTYPE_p_Exiv2__ValueTypeT_int16_t_t swig_types[30] +#define SWIGTYPE_p_Exiv2__ValueTypeT_int32_t_t swig_types[31] +#define SWIGTYPE_p_Exiv2__ValueTypeT_std__pairT_int32_t_int32_t_t_t swig_types[32] +#define SWIGTYPE_p_Exiv2__ValueTypeT_std__pairT_uint32_t_uint32_t_t_t swig_types[33] +#define SWIGTYPE_p_Exiv2__ValueTypeT_uint16_t_t swig_types[34] +#define SWIGTYPE_p_Exiv2__ValueTypeT_uint32_t_t swig_types[35] +#define SWIGTYPE_p_Exiv2__XPathIo swig_types[36] +#define SWIGTYPE_p_Exiv2__XmpArrayValue swig_types[37] +#define SWIGTYPE_p_Exiv2__XmpData swig_types[38] +#define SWIGTYPE_p_Exiv2__XmpKey swig_types[39] +#define SWIGTYPE_p_Exiv2__XmpPropertyInfo swig_types[40] +#define SWIGTYPE_p_Exiv2__XmpTextValue swig_types[41] +#define SWIGTYPE_p_Exiv2__XmpValue swig_types[42] +#define SWIGTYPE_p_IptcData_iterator swig_types[43] +#define SWIGTYPE_p_IptcData_iterator_base swig_types[44] +#define SWIGTYPE_p_SwigPyObject swig_types[45] +#define SWIGTYPE_p_ValueType swig_types[46] +#define SWIGTYPE_p_XmpData_iterator swig_types[47] +#define SWIGTYPE_p_XmpData_iterator_base swig_types[48] +#define SWIGTYPE_p_allocator_type swig_types[49] +#define SWIGTYPE_p_char swig_types[50] +#define SWIGTYPE_p_const_iterator swig_types[51] +#define SWIGTYPE_p_difference_type swig_types[52] +#define SWIGTYPE_p_first_type swig_types[53] +#define SWIGTYPE_p_int swig_types[54] +#define SWIGTYPE_p_iterator swig_types[55] +#define SWIGTYPE_p_key_type swig_types[56] +#define SWIGTYPE_p_long_long swig_types[57] +#define SWIGTYPE_p_mapped_type swig_types[58] +#define SWIGTYPE_p_second_type swig_types[59] +#define SWIGTYPE_p_short swig_types[60] +#define SWIGTYPE_p_signed_char swig_types[61] +#define SWIGTYPE_p_size_type swig_types[62] +#define SWIGTYPE_p_std__listT_Exiv2__Exifdatum_t swig_types[63] +#define SWIGTYPE_p_std__pairT_int32_t_int32_t_t swig_types[64] +#define SWIGTYPE_p_std__pairT_uint32_t_uint32_t_t swig_types[65] +#define SWIGTYPE_p_std__vectorT_Exiv2__Iptcdatum_std__allocatorT_Exiv2__Iptcdatum_t_t swig_types[66] +#define SWIGTYPE_p_std__vectorT_Exiv2__Xmpdatum_std__allocatorT_Exiv2__Xmpdatum_t_t swig_types[67] +#define SWIGTYPE_p_unsigned_char swig_types[68] +#define SWIGTYPE_p_unsigned_int swig_types[69] +#define SWIGTYPE_p_unsigned_long_long swig_types[70] +#define SWIGTYPE_p_unsigned_short swig_types[71] +#define SWIGTYPE_p_value_type swig_types[72] +static swig_type_info *swig_types[74]; +static swig_module_info swig_module = {swig_types, 73, 0, 0, 0, 0}; #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) @@ -4197,6 +4198,19 @@ SWIG_FromCharPtr(const char *cptr) #include "exiv2/exiv2.hpp" +#ifndef EXV_USE_CURL +namespace Exiv2 { + class CurlIo : public RemoteIo { + public: + CurlIo(const std::string& url, size_t blockSize=0) { + throw std::runtime_error( + "CurlIo not enabled in linked libexiv2"); + }; + }; +} +#endif + + #include @@ -4697,6 +4711,10 @@ static swig_type_info* basicio_subtype(Exiv2::BasicIo* ptr) { else if (dynamic_cast(ptr)) { if (dynamic_cast(ptr)) return SWIGTYPE_p_Exiv2__HttpIo; + + else if (dynamic_cast(ptr)) + return SWIGTYPE_p_Exiv2__CurlIo; + else return SWIGTYPE_p_Exiv2__RemoteIo; } @@ -7794,6 +7812,9 @@ SWIGINTERN SwigPyClientData SwigPyBuiltin__Exiv2__ImageFactory_clientdata = {0, /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ +static void *_p_Exiv2__CurlIoTo_p_Exiv2__BasicIo(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((Exiv2::BasicIo *) (Exiv2::RemoteIo *) ((Exiv2::CurlIo *) x)); +} static void *_p_Exiv2__FileIoTo_p_Exiv2__BasicIo(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((Exiv2::BasicIo *) ((Exiv2::FileIo *) x)); } @@ -7821,6 +7842,9 @@ static void *_p_Exiv2__IptcKeyTo_p_Exiv2__Key(void *x, int *SWIGUNUSEDPARM(newme static void *_p_Exiv2__XmpKeyTo_p_Exiv2__Key(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((Exiv2::Key *) ((Exiv2::XmpKey *) x)); } +static void *_p_Exiv2__CurlIoTo_p_Exiv2__RemoteIo(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((Exiv2::RemoteIo *) ((Exiv2::CurlIo *) x)); +} static void *_p_Exiv2__HttpIoTo_p_Exiv2__RemoteIo(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((Exiv2::RemoteIo *) ((Exiv2::HttpIo *) x)); } @@ -7904,6 +7928,7 @@ static swig_type_info _swigt__p_ExifData_iterator_base = {"_p_ExifData_iterator_ static swig_type_info _swigt__p_Exiv2__AsciiValue = {"_p_Exiv2__AsciiValue", "Exiv2::AsciiValue *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Exiv2__BasicIo = {"_p_Exiv2__BasicIo", "Exiv2::BasicIo *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Exiv2__CommentValue = {"_p_Exiv2__CommentValue", "Exiv2::CommentValue *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_Exiv2__CurlIo = {"_p_Exiv2__CurlIo", "Exiv2::CurlIo *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Exiv2__DataBuf = {"_p_Exiv2__DataBuf", "Exiv2::DataBuf *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Exiv2__DataSet = {"_p_Exiv2__DataSet", "Exiv2::DataSet *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Exiv2__DataValue = {"_p_Exiv2__DataValue", "Exiv2::DataValue *", 0, 0, (void*)0, 0}; @@ -7978,6 +8003,7 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_Exiv2__AsciiValue, &_swigt__p_Exiv2__BasicIo, &_swigt__p_Exiv2__CommentValue, + &_swigt__p_Exiv2__CurlIo, &_swigt__p_Exiv2__DataBuf, &_swigt__p_Exiv2__DataSet, &_swigt__p_Exiv2__DataValue, @@ -8050,8 +8076,9 @@ static swig_type_info *swig_type_initial[] = { static swig_cast_info _swigc__p_ExifData_iterator[] = { {&_swigt__p_ExifData_iterator, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_ExifData_iterator_base[] = { {&_swigt__p_ExifData_iterator_base, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__AsciiValue[] = { {&_swigt__p_Exiv2__AsciiValue, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_Exiv2__BasicIo[] = { {&_swigt__p_Exiv2__BasicIo, 0, 0, 0}, {&_swigt__p_Exiv2__FileIo, _p_Exiv2__FileIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__HttpIo, _p_Exiv2__HttpIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__MemIo, _p_Exiv2__MemIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__RemoteIo, _p_Exiv2__RemoteIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__XPathIo, _p_Exiv2__XPathIoTo_p_Exiv2__BasicIo, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Exiv2__BasicIo[] = { {&_swigt__p_Exiv2__BasicIo, 0, 0, 0}, {&_swigt__p_Exiv2__CurlIo, _p_Exiv2__CurlIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__FileIo, _p_Exiv2__FileIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__HttpIo, _p_Exiv2__HttpIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__MemIo, _p_Exiv2__MemIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__RemoteIo, _p_Exiv2__RemoteIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__XPathIo, _p_Exiv2__XPathIoTo_p_Exiv2__BasicIo, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__CommentValue[] = { {&_swigt__p_Exiv2__CommentValue, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Exiv2__CurlIo[] = { {&_swigt__p_Exiv2__CurlIo, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__DataBuf[] = { {&_swigt__p_Exiv2__DataBuf, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__DataSet[] = { {&_swigt__p_Exiv2__DataSet, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__DataValue[] = { {&_swigt__p_Exiv2__DataValue, 0, 0, 0},{0, 0, 0, 0}}; @@ -8068,7 +8095,7 @@ static swig_cast_info _swigc__p_Exiv2__IptcKey[] = { {&_swigt__p_Exiv2__IptcKey static swig_cast_info _swigc__p_Exiv2__Key[] = { {&_swigt__p_Exiv2__Key, 0, 0, 0}, {&_swigt__p_Exiv2__ExifKey, _p_Exiv2__ExifKeyTo_p_Exiv2__Key, 0, 0}, {&_swigt__p_Exiv2__IptcKey, _p_Exiv2__IptcKeyTo_p_Exiv2__Key, 0, 0}, {&_swigt__p_Exiv2__XmpKey, _p_Exiv2__XmpKeyTo_p_Exiv2__Key, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__LangAltValue[] = { {&_swigt__p_Exiv2__LangAltValue, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__MemIo[] = { {&_swigt__p_Exiv2__MemIo, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_Exiv2__RemoteIo[] = { {&_swigt__p_Exiv2__RemoteIo, 0, 0, 0}, {&_swigt__p_Exiv2__HttpIo, _p_Exiv2__HttpIoTo_p_Exiv2__RemoteIo, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Exiv2__RemoteIo[] = { {&_swigt__p_Exiv2__RemoteIo, 0, 0, 0}, {&_swigt__p_Exiv2__CurlIo, _p_Exiv2__CurlIoTo_p_Exiv2__RemoteIo, 0, 0}, {&_swigt__p_Exiv2__HttpIo, _p_Exiv2__HttpIoTo_p_Exiv2__RemoteIo, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__StringValue[] = { {&_swigt__p_Exiv2__StringValue, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__StringValueBase[] = { {&_swigt__p_Exiv2__StringValueBase, 0, 0, 0}, {&_swigt__p_Exiv2__AsciiValue, _p_Exiv2__AsciiValueTo_p_Exiv2__StringValueBase, 0, 0}, {&_swigt__p_Exiv2__CommentValue, _p_Exiv2__CommentValueTo_p_Exiv2__StringValueBase, 0, 0}, {&_swigt__p_Exiv2__StringValue, _p_Exiv2__StringValueTo_p_Exiv2__StringValueBase, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__TagInfo[] = { {&_swigt__p_Exiv2__TagInfo, 0, 0, 0},{0, 0, 0, 0}}; @@ -8126,6 +8153,7 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_Exiv2__AsciiValue, _swigc__p_Exiv2__BasicIo, _swigc__p_Exiv2__CommentValue, + _swigc__p_Exiv2__CurlIo, _swigc__p_Exiv2__DataBuf, _swigc__p_Exiv2__DataSet, _swigc__p_Exiv2__DataValue, diff --git a/src/swig-0_27_7/preview_wrap.cxx b/src/swig-0_27_7/preview_wrap.cxx index 65f5c35..2f2b02a 100644 --- a/src/swig-0_27_7/preview_wrap.cxx +++ b/src/swig-0_27_7/preview_wrap.cxx @@ -3932,75 +3932,76 @@ SwigPyBuiltin_iternextfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) { #define SWIGTYPE_p_Exiv2__AsciiValue swig_types[2] #define SWIGTYPE_p_Exiv2__BasicIo swig_types[3] #define SWIGTYPE_p_Exiv2__CommentValue swig_types[4] -#define SWIGTYPE_p_Exiv2__DataBuf swig_types[5] -#define SWIGTYPE_p_Exiv2__DataSet swig_types[6] -#define SWIGTYPE_p_Exiv2__DataValue swig_types[7] -#define SWIGTYPE_p_Exiv2__DateValue swig_types[8] -#define SWIGTYPE_p_Exiv2__ExifKey swig_types[9] -#define SWIGTYPE_p_Exiv2__FileIo swig_types[10] -#define SWIGTYPE_p_Exiv2__GroupInfo swig_types[11] -#define SWIGTYPE_p_Exiv2__HttpIo swig_types[12] -#define SWIGTYPE_p_Exiv2__Image swig_types[13] -#define SWIGTYPE_p_Exiv2__IptcKey swig_types[14] -#define SWIGTYPE_p_Exiv2__Key swig_types[15] -#define SWIGTYPE_p_Exiv2__LangAltValue swig_types[16] -#define SWIGTYPE_p_Exiv2__MemIo swig_types[17] -#define SWIGTYPE_p_Exiv2__PreviewImage swig_types[18] -#define SWIGTYPE_p_Exiv2__PreviewManager swig_types[19] -#define SWIGTYPE_p_Exiv2__PreviewProperties swig_types[20] -#define SWIGTYPE_p_Exiv2__RemoteIo swig_types[21] -#define SWIGTYPE_p_Exiv2__StringValue swig_types[22] -#define SWIGTYPE_p_Exiv2__StringValueBase swig_types[23] -#define SWIGTYPE_p_Exiv2__TagInfo swig_types[24] -#define SWIGTYPE_p_Exiv2__TimeValue swig_types[25] -#define SWIGTYPE_p_Exiv2__Value swig_types[26] -#define SWIGTYPE_p_Exiv2__ValueTypeT_double_t swig_types[27] -#define SWIGTYPE_p_Exiv2__ValueTypeT_float_t swig_types[28] -#define SWIGTYPE_p_Exiv2__ValueTypeT_int16_t_t swig_types[29] -#define SWIGTYPE_p_Exiv2__ValueTypeT_int32_t_t swig_types[30] -#define SWIGTYPE_p_Exiv2__ValueTypeT_std__pairT_int32_t_int32_t_t_t swig_types[31] -#define SWIGTYPE_p_Exiv2__ValueTypeT_std__pairT_uint32_t_uint32_t_t_t swig_types[32] -#define SWIGTYPE_p_Exiv2__ValueTypeT_uint16_t_t swig_types[33] -#define SWIGTYPE_p_Exiv2__ValueTypeT_uint32_t_t swig_types[34] -#define SWIGTYPE_p_Exiv2__XPathIo swig_types[35] -#define SWIGTYPE_p_Exiv2__XmpArrayValue swig_types[36] -#define SWIGTYPE_p_Exiv2__XmpKey swig_types[37] -#define SWIGTYPE_p_Exiv2__XmpPropertyInfo swig_types[38] -#define SWIGTYPE_p_Exiv2__XmpTextValue swig_types[39] -#define SWIGTYPE_p_Exiv2__XmpValue swig_types[40] -#define SWIGTYPE_p_IptcData_iterator swig_types[41] -#define SWIGTYPE_p_IptcData_iterator_base swig_types[42] -#define SWIGTYPE_p_SwigPyObject swig_types[43] -#define SWIGTYPE_p_ValueType swig_types[44] -#define SWIGTYPE_p_XmpData_iterator swig_types[45] -#define SWIGTYPE_p_XmpData_iterator_base swig_types[46] -#define SWIGTYPE_p_allocator_type swig_types[47] -#define SWIGTYPE_p_char swig_types[48] -#define SWIGTYPE_p_const_iterator swig_types[49] -#define SWIGTYPE_p_difference_type swig_types[50] -#define SWIGTYPE_p_first_type swig_types[51] -#define SWIGTYPE_p_int swig_types[52] -#define SWIGTYPE_p_iterator swig_types[53] -#define SWIGTYPE_p_key_type swig_types[54] -#define SWIGTYPE_p_long_long swig_types[55] -#define SWIGTYPE_p_mapped_type swig_types[56] -#define SWIGTYPE_p_second_type swig_types[57] -#define SWIGTYPE_p_short swig_types[58] -#define SWIGTYPE_p_signed_char swig_types[59] -#define SWIGTYPE_p_size_type swig_types[60] -#define SWIGTYPE_p_std__listT_Exiv2__Exifdatum_t swig_types[61] -#define SWIGTYPE_p_std__pairT_int32_t_int32_t_t swig_types[62] -#define SWIGTYPE_p_std__pairT_uint32_t_uint32_t_t swig_types[63] -#define SWIGTYPE_p_std__vectorT_Exiv2__Iptcdatum_std__allocatorT_Exiv2__Iptcdatum_t_t swig_types[64] -#define SWIGTYPE_p_std__vectorT_Exiv2__PreviewProperties_t swig_types[65] -#define SWIGTYPE_p_std__vectorT_Exiv2__Xmpdatum_std__allocatorT_Exiv2__Xmpdatum_t_t swig_types[66] -#define SWIGTYPE_p_unsigned_char swig_types[67] -#define SWIGTYPE_p_unsigned_int swig_types[68] -#define SWIGTYPE_p_unsigned_long_long swig_types[69] -#define SWIGTYPE_p_unsigned_short swig_types[70] -#define SWIGTYPE_p_value_type swig_types[71] -static swig_type_info *swig_types[73]; -static swig_module_info swig_module = {swig_types, 72, 0, 0, 0, 0}; +#define SWIGTYPE_p_Exiv2__CurlIo swig_types[5] +#define SWIGTYPE_p_Exiv2__DataBuf swig_types[6] +#define SWIGTYPE_p_Exiv2__DataSet swig_types[7] +#define SWIGTYPE_p_Exiv2__DataValue swig_types[8] +#define SWIGTYPE_p_Exiv2__DateValue swig_types[9] +#define SWIGTYPE_p_Exiv2__ExifKey swig_types[10] +#define SWIGTYPE_p_Exiv2__FileIo swig_types[11] +#define SWIGTYPE_p_Exiv2__GroupInfo swig_types[12] +#define SWIGTYPE_p_Exiv2__HttpIo swig_types[13] +#define SWIGTYPE_p_Exiv2__Image swig_types[14] +#define SWIGTYPE_p_Exiv2__IptcKey swig_types[15] +#define SWIGTYPE_p_Exiv2__Key swig_types[16] +#define SWIGTYPE_p_Exiv2__LangAltValue swig_types[17] +#define SWIGTYPE_p_Exiv2__MemIo swig_types[18] +#define SWIGTYPE_p_Exiv2__PreviewImage swig_types[19] +#define SWIGTYPE_p_Exiv2__PreviewManager swig_types[20] +#define SWIGTYPE_p_Exiv2__PreviewProperties swig_types[21] +#define SWIGTYPE_p_Exiv2__RemoteIo swig_types[22] +#define SWIGTYPE_p_Exiv2__StringValue swig_types[23] +#define SWIGTYPE_p_Exiv2__StringValueBase swig_types[24] +#define SWIGTYPE_p_Exiv2__TagInfo swig_types[25] +#define SWIGTYPE_p_Exiv2__TimeValue swig_types[26] +#define SWIGTYPE_p_Exiv2__Value swig_types[27] +#define SWIGTYPE_p_Exiv2__ValueTypeT_double_t swig_types[28] +#define SWIGTYPE_p_Exiv2__ValueTypeT_float_t swig_types[29] +#define SWIGTYPE_p_Exiv2__ValueTypeT_int16_t_t swig_types[30] +#define SWIGTYPE_p_Exiv2__ValueTypeT_int32_t_t swig_types[31] +#define SWIGTYPE_p_Exiv2__ValueTypeT_std__pairT_int32_t_int32_t_t_t swig_types[32] +#define SWIGTYPE_p_Exiv2__ValueTypeT_std__pairT_uint32_t_uint32_t_t_t swig_types[33] +#define SWIGTYPE_p_Exiv2__ValueTypeT_uint16_t_t swig_types[34] +#define SWIGTYPE_p_Exiv2__ValueTypeT_uint32_t_t swig_types[35] +#define SWIGTYPE_p_Exiv2__XPathIo swig_types[36] +#define SWIGTYPE_p_Exiv2__XmpArrayValue swig_types[37] +#define SWIGTYPE_p_Exiv2__XmpKey swig_types[38] +#define SWIGTYPE_p_Exiv2__XmpPropertyInfo swig_types[39] +#define SWIGTYPE_p_Exiv2__XmpTextValue swig_types[40] +#define SWIGTYPE_p_Exiv2__XmpValue swig_types[41] +#define SWIGTYPE_p_IptcData_iterator swig_types[42] +#define SWIGTYPE_p_IptcData_iterator_base swig_types[43] +#define SWIGTYPE_p_SwigPyObject swig_types[44] +#define SWIGTYPE_p_ValueType swig_types[45] +#define SWIGTYPE_p_XmpData_iterator swig_types[46] +#define SWIGTYPE_p_XmpData_iterator_base swig_types[47] +#define SWIGTYPE_p_allocator_type swig_types[48] +#define SWIGTYPE_p_char swig_types[49] +#define SWIGTYPE_p_const_iterator swig_types[50] +#define SWIGTYPE_p_difference_type swig_types[51] +#define SWIGTYPE_p_first_type swig_types[52] +#define SWIGTYPE_p_int swig_types[53] +#define SWIGTYPE_p_iterator swig_types[54] +#define SWIGTYPE_p_key_type swig_types[55] +#define SWIGTYPE_p_long_long swig_types[56] +#define SWIGTYPE_p_mapped_type swig_types[57] +#define SWIGTYPE_p_second_type swig_types[58] +#define SWIGTYPE_p_short swig_types[59] +#define SWIGTYPE_p_signed_char swig_types[60] +#define SWIGTYPE_p_size_type swig_types[61] +#define SWIGTYPE_p_std__listT_Exiv2__Exifdatum_t swig_types[62] +#define SWIGTYPE_p_std__pairT_int32_t_int32_t_t swig_types[63] +#define SWIGTYPE_p_std__pairT_uint32_t_uint32_t_t swig_types[64] +#define SWIGTYPE_p_std__vectorT_Exiv2__Iptcdatum_std__allocatorT_Exiv2__Iptcdatum_t_t swig_types[65] +#define SWIGTYPE_p_std__vectorT_Exiv2__PreviewProperties_t swig_types[66] +#define SWIGTYPE_p_std__vectorT_Exiv2__Xmpdatum_std__allocatorT_Exiv2__Xmpdatum_t_t swig_types[67] +#define SWIGTYPE_p_unsigned_char swig_types[68] +#define SWIGTYPE_p_unsigned_int swig_types[69] +#define SWIGTYPE_p_unsigned_long_long swig_types[70] +#define SWIGTYPE_p_unsigned_short swig_types[71] +#define SWIGTYPE_p_value_type swig_types[72] +static swig_type_info *swig_types[74]; +static swig_module_info swig_module = {swig_types, 73, 0, 0, 0, 0}; #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) @@ -4199,6 +4200,19 @@ SWIG_FromCharPtr(const char *cptr) #include "exiv2/exiv2.hpp" +#ifndef EXV_USE_CURL +namespace Exiv2 { + class CurlIo : public RemoteIo { + public: + CurlIo(const std::string& url, size_t blockSize=0) { + throw std::runtime_error( + "CurlIo not enabled in linked libexiv2"); + }; + }; +} +#endif + + #include @@ -7432,6 +7446,9 @@ SWIGINTERN SwigPyClientData SwigPyBuiltin__Exiv2__PreviewManager_clientdata = {0 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ +static void *_p_Exiv2__CurlIoTo_p_Exiv2__BasicIo(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((Exiv2::BasicIo *) (Exiv2::RemoteIo *) ((Exiv2::CurlIo *) x)); +} static void *_p_Exiv2__FileIoTo_p_Exiv2__BasicIo(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((Exiv2::BasicIo *) ((Exiv2::FileIo *) x)); } @@ -7459,6 +7476,9 @@ static void *_p_Exiv2__IptcKeyTo_p_Exiv2__Key(void *x, int *SWIGUNUSEDPARM(newme static void *_p_Exiv2__XmpKeyTo_p_Exiv2__Key(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((Exiv2::Key *) ((Exiv2::XmpKey *) x)); } +static void *_p_Exiv2__CurlIoTo_p_Exiv2__RemoteIo(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((Exiv2::RemoteIo *) ((Exiv2::CurlIo *) x)); +} static void *_p_Exiv2__HttpIoTo_p_Exiv2__RemoteIo(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((Exiv2::RemoteIo *) ((Exiv2::HttpIo *) x)); } @@ -7542,6 +7562,7 @@ static swig_type_info _swigt__p_ExifData_iterator_base = {"_p_ExifData_iterator_ static swig_type_info _swigt__p_Exiv2__AsciiValue = {"_p_Exiv2__AsciiValue", "Exiv2::AsciiValue *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Exiv2__BasicIo = {"_p_Exiv2__BasicIo", "Exiv2::BasicIo *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Exiv2__CommentValue = {"_p_Exiv2__CommentValue", "Exiv2::CommentValue *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_Exiv2__CurlIo = {"_p_Exiv2__CurlIo", "Exiv2::CurlIo *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Exiv2__DataBuf = {"_p_Exiv2__DataBuf", "Exiv2::DataBuf *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Exiv2__DataSet = {"_p_Exiv2__DataSet", "Exiv2::DataSet *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Exiv2__DataValue = {"_p_Exiv2__DataValue", "Exiv2::DataValue *", 0, 0, (void*)0, 0}; @@ -7616,6 +7637,7 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_Exiv2__AsciiValue, &_swigt__p_Exiv2__BasicIo, &_swigt__p_Exiv2__CommentValue, + &_swigt__p_Exiv2__CurlIo, &_swigt__p_Exiv2__DataBuf, &_swigt__p_Exiv2__DataSet, &_swigt__p_Exiv2__DataValue, @@ -7688,8 +7710,9 @@ static swig_type_info *swig_type_initial[] = { static swig_cast_info _swigc__p_ExifData_iterator[] = { {&_swigt__p_ExifData_iterator, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_ExifData_iterator_base[] = { {&_swigt__p_ExifData_iterator_base, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__AsciiValue[] = { {&_swigt__p_Exiv2__AsciiValue, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_Exiv2__BasicIo[] = { {&_swigt__p_Exiv2__BasicIo, 0, 0, 0}, {&_swigt__p_Exiv2__FileIo, _p_Exiv2__FileIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__HttpIo, _p_Exiv2__HttpIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__MemIo, _p_Exiv2__MemIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__RemoteIo, _p_Exiv2__RemoteIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__XPathIo, _p_Exiv2__XPathIoTo_p_Exiv2__BasicIo, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Exiv2__BasicIo[] = { {&_swigt__p_Exiv2__BasicIo, 0, 0, 0}, {&_swigt__p_Exiv2__CurlIo, _p_Exiv2__CurlIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__FileIo, _p_Exiv2__FileIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__HttpIo, _p_Exiv2__HttpIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__MemIo, _p_Exiv2__MemIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__RemoteIo, _p_Exiv2__RemoteIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__XPathIo, _p_Exiv2__XPathIoTo_p_Exiv2__BasicIo, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__CommentValue[] = { {&_swigt__p_Exiv2__CommentValue, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Exiv2__CurlIo[] = { {&_swigt__p_Exiv2__CurlIo, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__DataBuf[] = { {&_swigt__p_Exiv2__DataBuf, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__DataSet[] = { {&_swigt__p_Exiv2__DataSet, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__DataValue[] = { {&_swigt__p_Exiv2__DataValue, 0, 0, 0},{0, 0, 0, 0}}; @@ -7706,7 +7729,7 @@ static swig_cast_info _swigc__p_Exiv2__MemIo[] = { {&_swigt__p_Exiv2__MemIo, 0, static swig_cast_info _swigc__p_Exiv2__PreviewImage[] = { {&_swigt__p_Exiv2__PreviewImage, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__PreviewManager[] = { {&_swigt__p_Exiv2__PreviewManager, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__PreviewProperties[] = { {&_swigt__p_Exiv2__PreviewProperties, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_Exiv2__RemoteIo[] = { {&_swigt__p_Exiv2__RemoteIo, 0, 0, 0}, {&_swigt__p_Exiv2__HttpIo, _p_Exiv2__HttpIoTo_p_Exiv2__RemoteIo, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Exiv2__RemoteIo[] = { {&_swigt__p_Exiv2__RemoteIo, 0, 0, 0}, {&_swigt__p_Exiv2__CurlIo, _p_Exiv2__CurlIoTo_p_Exiv2__RemoteIo, 0, 0}, {&_swigt__p_Exiv2__HttpIo, _p_Exiv2__HttpIoTo_p_Exiv2__RemoteIo, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__StringValue[] = { {&_swigt__p_Exiv2__StringValue, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__StringValueBase[] = { {&_swigt__p_Exiv2__StringValueBase, 0, 0, 0}, {&_swigt__p_Exiv2__AsciiValue, _p_Exiv2__AsciiValueTo_p_Exiv2__StringValueBase, 0, 0}, {&_swigt__p_Exiv2__CommentValue, _p_Exiv2__CommentValueTo_p_Exiv2__StringValueBase, 0, 0}, {&_swigt__p_Exiv2__StringValue, _p_Exiv2__StringValueTo_p_Exiv2__StringValueBase, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__TagInfo[] = { {&_swigt__p_Exiv2__TagInfo, 0, 0, 0},{0, 0, 0, 0}}; @@ -7764,6 +7787,7 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_Exiv2__AsciiValue, _swigc__p_Exiv2__BasicIo, _swigc__p_Exiv2__CommentValue, + _swigc__p_Exiv2__CurlIo, _swigc__p_Exiv2__DataBuf, _swigc__p_Exiv2__DataSet, _swigc__p_Exiv2__DataValue, diff --git a/src/swig-0_27_7/version_wrap.cxx b/src/swig-0_27_7/version_wrap.cxx index 9078c28..3b0d067 100644 --- a/src/swig-0_27_7/version_wrap.cxx +++ b/src/swig-0_27_7/version_wrap.cxx @@ -4263,6 +4263,7 @@ static PyObject* versionInfo() { bool video = false; bool unicode = false; bool webready = false; + bool curl = false; #ifdef EXV_ENABLE_NLS nls = true; #endif @@ -4275,13 +4276,17 @@ static PyObject* versionInfo() { #ifdef EXV_ENABLE_WEBREADY webready = true; #endif - return Py_BuildValue("{ss,sN,sN,sN,sN,sN}", +#ifdef EXV_USE_CURL + curl = true; +#endif + return Py_BuildValue("{ss,sN,sN,sN,sN,sN,sN}", "version", Exiv2::version(), "EXV_ENABLE_NLS", PyBool_FromLong(nls), "EXV_ENABLE_BMFF", PyBool_FromLong(bmff), "EXV_ENABLE_VIDEO", PyBool_FromLong(video), "EXV_UNICODE_PATH", PyBool_FromLong(unicode), - "EXV_ENABLE_WEBREADY", PyBool_FromLong(webready)); + "EXV_ENABLE_WEBREADY", PyBool_FromLong(webready), + "EXV_USE_CURL", PyBool_FromLong(curl)); }; diff --git a/src/swig-0_28_2/basicio_wrap.cxx b/src/swig-0_28_2/basicio_wrap.cxx index 92e41ce..8ef1228 100644 --- a/src/swig-0_28_2/basicio_wrap.cxx +++ b/src/swig-0_28_2/basicio_wrap.cxx @@ -3927,28 +3927,29 @@ SwigPyBuiltin_iternextfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) { #define SWIGTYPE_p_ErrorCode swig_types[0] #define SWIGTYPE_p_Exiv2__BasicIo swig_types[1] -#define SWIGTYPE_p_Exiv2__DataBuf swig_types[2] -#define SWIGTYPE_p_Exiv2__FileIo swig_types[3] -#define SWIGTYPE_p_Exiv2__HttpIo swig_types[4] -#define SWIGTYPE_p_Exiv2__MemIo swig_types[5] -#define SWIGTYPE_p_Exiv2__RemoteIo swig_types[6] -#define SWIGTYPE_p_Exiv2__XPathIo swig_types[7] -#define SWIGTYPE_p_SwigPyObject swig_types[8] -#define SWIGTYPE_p_char swig_types[9] -#define SWIGTYPE_p_first_type swig_types[10] -#define SWIGTYPE_p_int swig_types[11] -#define SWIGTYPE_p_long_long swig_types[12] -#define SWIGTYPE_p_second_type swig_types[13] -#define SWIGTYPE_p_short swig_types[14] -#define SWIGTYPE_p_signed_char swig_types[15] -#define SWIGTYPE_p_std__pairT_int32_t_int32_t_t swig_types[16] -#define SWIGTYPE_p_std__pairT_uint32_t_uint32_t_t swig_types[17] -#define SWIGTYPE_p_unsigned_char swig_types[18] -#define SWIGTYPE_p_unsigned_int swig_types[19] -#define SWIGTYPE_p_unsigned_long_long swig_types[20] -#define SWIGTYPE_p_unsigned_short swig_types[21] -static swig_type_info *swig_types[23]; -static swig_module_info swig_module = {swig_types, 22, 0, 0, 0, 0}; +#define SWIGTYPE_p_Exiv2__CurlIo swig_types[2] +#define SWIGTYPE_p_Exiv2__DataBuf swig_types[3] +#define SWIGTYPE_p_Exiv2__FileIo swig_types[4] +#define SWIGTYPE_p_Exiv2__HttpIo swig_types[5] +#define SWIGTYPE_p_Exiv2__MemIo swig_types[6] +#define SWIGTYPE_p_Exiv2__RemoteIo swig_types[7] +#define SWIGTYPE_p_Exiv2__XPathIo swig_types[8] +#define SWIGTYPE_p_SwigPyObject swig_types[9] +#define SWIGTYPE_p_char swig_types[10] +#define SWIGTYPE_p_first_type swig_types[11] +#define SWIGTYPE_p_int swig_types[12] +#define SWIGTYPE_p_long_long swig_types[13] +#define SWIGTYPE_p_second_type swig_types[14] +#define SWIGTYPE_p_short swig_types[15] +#define SWIGTYPE_p_signed_char swig_types[16] +#define SWIGTYPE_p_std__pairT_int32_t_int32_t_t swig_types[17] +#define SWIGTYPE_p_std__pairT_uint32_t_uint32_t_t swig_types[18] +#define SWIGTYPE_p_unsigned_char swig_types[19] +#define SWIGTYPE_p_unsigned_int swig_types[20] +#define SWIGTYPE_p_unsigned_long_long swig_types[21] +#define SWIGTYPE_p_unsigned_short swig_types[22] +static swig_type_info *swig_types[24]; +static swig_module_info swig_module = {swig_types, 23, 0, 0, 0, 0}; #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) @@ -4147,6 +4148,19 @@ SWIG_FromCharPtr(const char *cptr) #include "exiv2/exiv2.hpp" +#ifndef EXV_USE_CURL +namespace Exiv2 { + class CurlIo : public RemoteIo { + public: + CurlIo(const std::string& url, size_t blockSize=0) { + throw std::runtime_error( + "CurlIo not enabled in linked libexiv2"); + }; + }; +} +#endif + + #include @@ -8814,195 +8828,930 @@ SWIGINTERN PyObject *_wrap_delete_HttpIo(PyObject *self, PyObject *args) { SWIGPY_DESTRUCTOR_CLOSURE(_wrap_delete_HttpIo) /* defines _wrap_delete_HttpIo_destructor_closure */ -static PyMethodDef SwigMethods[] = { - { "_enum_list_Position", _wrap__enum_list_Position, METH_VARARGS, NULL}, - { NULL, NULL, 0, NULL } -}; +SWIGINTERN int _wrap_new_CurlIo__SWIG_0(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + std::string *arg1 = 0 ; + size_t arg2 ; + int res1 = SWIG_OLDOBJ ; + size_t val2 ; + int ecode2 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + Exiv2::CurlIo *result = 0 ; + + if (!SWIG_Python_CheckNoKeywords(kwargs, "new_CurlIo")) SWIG_fail; + if (!PyArg_UnpackTuple(args, "new_CurlIo", 2, 2, &obj1, &obj2)) SWIG_fail; + { + std::string *ptr = (std::string *)0; + res1 = SWIG_AsPtr_std_string(obj1, &ptr); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CurlIo" "', argument " "1"" of type '" "std::string const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_CurlIo" "', argument " "1"" of type '" "std::string const &""'"); + } + arg1 = ptr; + } + ecode2 = SWIG_AsVal_size_t(obj2, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CurlIo" "', argument " "2"" of type '" "size_t""'"); + } + arg2 = static_cast< size_t >(val2); + { +#ifdef _WIN32 + if (utf8_to_wcp(arg1, true) < 0) { + SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); + } +#endif + } + { + try { + result = (Exiv2::CurlIo *)new Exiv2::CurlIo((std::string const &)*arg1,arg2); + } + catch(std::exception const& e) { + _set_python_exception(); + SWIG_fail; + } + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Exiv2__CurlIo, SWIG_BUILTIN_INIT | 0 ); + if (SWIG_IsNewObj(res1)) delete arg1; + return resultobj == Py_None ? -1 : 0; +fail: + if (SWIG_IsNewObj(res1)) delete arg1; + return -1; +} -static SwigPyGetSet BasicIo___dict___getset = { SwigPyObject_get___dict__, 0 }; -SWIGINTERN PyGetSetDef SwigPyBuiltin__Exiv2__BasicIo_getset[] = { - { (char *)"__dict__", SwigPyBuiltin_GetterClosure, 0, (char *)"", &BasicIo___dict___getset }, - { NULL, NULL, NULL, NULL, NULL } /* Sentinel */ -}; -SWIGINTERN PyObject * -SwigPyBuiltin__Exiv2__BasicIo_richcompare(PyObject *self, PyObject *other, int op) { - PyObject *result = NULL; - PyObject *tuple = PyTuple_New(1); - assert(tuple); - PyTuple_SET_ITEM(tuple, 0, other); - Py_XINCREF(other); - if (!result && !PyErr_Occurred()) { - if (SwigPyObject_Check(self) && SwigPyObject_Check(other)) { - result = SwigPyObject_richcompare((SwigPyObject *)self, (SwigPyObject *)other, op); - } else { - result = Py_NotImplemented; - Py_INCREF(result); +SWIGINTERN int _wrap_new_CurlIo__SWIG_1(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + std::string *arg1 = 0 ; + int res1 = SWIG_OLDOBJ ; + PyObject * obj1 = 0 ; + Exiv2::CurlIo *result = 0 ; + + if (!SWIG_Python_CheckNoKeywords(kwargs, "new_CurlIo")) SWIG_fail; + if (!PyArg_UnpackTuple(args, "new_CurlIo", 1, 1, &obj1)) SWIG_fail; + { + std::string *ptr = (std::string *)0; + res1 = SWIG_AsPtr_std_string(obj1, &ptr); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CurlIo" "', argument " "1"" of type '" "std::string const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_CurlIo" "', argument " "1"" of type '" "std::string const &""'"); } + arg1 = ptr; } - Py_DECREF(tuple); - return result; + { +#ifdef _WIN32 + if (utf8_to_wcp(arg1, true) < 0) { + SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); + } +#endif + } + { + try { + result = (Exiv2::CurlIo *)new Exiv2::CurlIo((std::string const &)*arg1); + } + catch(std::exception const& e) { + _set_python_exception(); + SWIG_fail; + } + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Exiv2__CurlIo, SWIG_BUILTIN_INIT | 0 ); + if (SWIG_IsNewObj(res1)) delete arg1; + return resultobj == Py_None ? -1 : 0; +fail: + if (SWIG_IsNewObj(res1)) delete arg1; + return -1; } -SWIGINTERN PyMethodDef SwigPyBuiltin__Exiv2__BasicIo_methods[] = { - { "open", _wrap_BasicIo_open, METH_VARARGS, "\n" - "Open the IO source using the default access mode. The\n" - " default mode should allow for reading and writing.\n" - "\n" - "This method can also be used to \"reopen\" an IO source which will\n" - "flush any unwritten data and reset the IO position to the start.\n" - "Subclasses may provide custom methods to allow for\n" - "opening IO sources differently.\n" - "\n" - ":rtype: int\n" - ":return: 0 if successful;\n" - "\n" - " Nonzero if failure.\n" - "" }, - { "close", _wrap_BasicIo_close, METH_VARARGS, "\n" - "Close the IO source. After closing a BasicIo instance can not\n" - " be read or written. Closing flushes any unwritten data. It is\n" - " safe to call close on a closed instance.\n" - ":rtype: int\n" - ":return: 0 if successful;\n" - "\n" - " Nonzero if failure.\n" - "" }, - { "write", _wrap_BasicIo_write, METH_VARARGS, "\n" - "*Overload 1:*\n" - "\n" - "Write data to the IO source. Current IO position is advanced\n" - " by the number of bytes written.\n" - ":type data: :py:term:`bytes-like object`\n" - ":param data: Pointer to data. Data must be at least *wcount*\n" - " bytes long\n" - ":type wcount: int\n" - ":param wcount: Number of bytes to be written.\n" - ":rtype: int\n" - ":return: Number of bytes written to IO source successfully;\n" - "\n" - " 0 if failure;\n" - "\n" - "|\n" - "\n" - "*Overload 2:*\n" - "\n" - "Write data that is read from another BasicIo instance to\n" - " the IO source. Current IO position is advanced by the number\n" - " of bytes written.\n" - ":type src: :py:class:`BasicIo`\n" - ":param src: Reference to another BasicIo instance. Reading start\n" - " at the source's current IO position\n" - ":rtype: int\n" - ":return: Number of bytes written to IO source successfully;\n" - "\n" - " 0 if failure;\n" - "" }, - { "putb", _wrap_BasicIo_putb, METH_VARARGS, "\n" - "Write one byte to the IO source. Current IO position is\n" - " advanced by one byte.\n" - ":type data: int\n" - ":param data: The single byte to be written.\n" - ":rtype: int\n" - ":return: The value of the byte written if successful;\n" - "\n" - " EOF if failure;\n" - "" }, - { "read", _wrap_BasicIo_read, METH_VARARGS, "\n" - "*Overload 1:*\n" - "\n" - "Read data from the IO source. Reading starts at the current\n" - " IO position and the position is advanced by the number of bytes\n" - " read.\n" - ":type rcount: int\n" - ":param rcount: Maximum number of bytes to read. Fewer bytes may be\n" - " read if *rcount* bytes are not available.\n" - ":rtype: :py:class:`DataBuf`\n" - ":return: DataBuf instance containing the bytes read. Use the\n" - " DataBuf::size_ member to find the number of bytes read.\n" - " DataBuf::size_ will be 0 on failure.\n" - "\n" - "|\n" - "\n" - "*Overload 2:*\n" - "\n" - "Read data from the IO source. Reading starts at the current\n" - " IO position and the position is advanced by the number of bytes\n" - " read.\n" - ":type buf: writeable :py:term:`bytes-like object`\n" - ":param buf: Pointer to a block of memory into which the read data\n" - " is stored. The memory block must be at least *rcount* bytes\n" - " long.\n" - ":type rcount: int\n" - ":param rcount: Maximum number of bytes to read. Fewer bytes may be\n" - " read if *rcount* bytes are not available.\n" - ":rtype: int\n" - ":return: Number of bytes read from IO source successfully;\n" - "\n" - " 0 if failure;\n" - "" }, - { "readOrThrow", _wrap_BasicIo_readOrThrow, METH_VARARGS, "\n" - "Safe version of `read()` that checks for errors and throws\n" - " an exception if the read was unsuccessful.\n" - ":type buf: writeable :py:term:`bytes-like object`\n" - ":param buf: Pointer to a block of memory into which the read data\n" - " is stored. The memory block must be at least *rcount* bytes\n" - " long.\n" - ":type rcount: int\n" - ":param rcount: Maximum number of bytes to read. Fewer bytes may be\n" - " read if *rcount* bytes are not available.\n" - ":type err: ErrorCode, optional\n" - ":param err: Error code to use if an exception is thrown.\n" - "" }, - { "getb", _wrap_BasicIo_getb, METH_VARARGS, "\n" - "Read one byte from the IO source. Current IO position is\n" - " advanced by one byte.\n" - ":rtype: int\n" - ":return: The byte read from the IO source if successful;\n" - "\n" - " EOF if failure;\n" - "" }, - { "transfer", _wrap_BasicIo_transfer, METH_VARARGS, "\n" - "Remove all data from this object's IO source and then transfer\n" - " data from the *src* BasicIo object into this object.\n" - "\n" - "The source object is invalidated by this operation and should not be\n" - "used after this method returns. This method exists primarily to\n" - "be used with the BasicIo::temporary() method.\n" - "\n" - ":type src: :py:class:`BasicIo`\n" - ":param src: Reference to another BasicIo instance. The entire contents\n" - " of src are transferred to this object. The *src* object is\n" - " invalidated by the method.\n" - ":raises: Error In case of failure\n" - "" }, - { "seek", _wrap_BasicIo_seek, METH_VARARGS, "\n" - "Move the current IO position.\n" - ":type offset: int\n" - ":param offset: Number of bytes to move the position relative\n" - " to the starting position specified by *pos*\n" - ":type pos: :py:class:`BasicIo.Position`\n" - ":param pos: Position from which the seek should start\n" - ":rtype: int\n" - ":return: 0 if successful;\n" - "\n" - " Nonzero if failure;\n" - "" }, - { "seekOrThrow", _wrap_BasicIo_seekOrThrow, METH_VARARGS, "\n" - "Safe version of `seek()` that checks for errors and throws\n" - " an exception if the seek was unsuccessful.\n" - ":type offset: int\n" - ":param offset: Number of bytes to move the position relative\n" - " to the starting position specified by *pos*\n" - ":type pos: :py:class:`BasicIo.Position`\n" - ":param pos: Position from which the seek should start\n" + +SWIGINTERN int _wrap_new_CurlIo(PyObject *self, PyObject *args, PyObject *kwargs) { + Py_ssize_t argc; + PyObject *argv[3] = { + 0 + }; + Py_ssize_t ii; + + (void)self; + if (!SWIG_Python_CheckNoKeywords(kwargs, "new_CurlIo")) SWIG_fail; + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < 2) && (ii < argc); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 1) { + int retval = _wrap_new_CurlIo__SWIG_1(self, args, NULL); + if (retval == 0 || !SWIG_Python_TypeErrorOccurred(NULL)) return retval; + SWIG_fail; + } + if (argc == 2) { + int retval = _wrap_new_CurlIo__SWIG_0(self, args, NULL); + if (retval == 0 || !SWIG_Python_TypeErrorOccurred(NULL)) return retval; + SWIG_fail; + } + +fail: + SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'new_CurlIo'.\n" + " Possible C/C++ prototypes are:\n" + " Exiv2::CurlIo::CurlIo(std::string const &,size_t)\n" + " Exiv2::CurlIo::CurlIo(std::string const &)\n"); + return -1; +} + + +SWIGINTERN PyObject *_wrap_CurlIo_write__SWIG_0(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + Exiv2::CurlIo *arg1 = (Exiv2::CurlIo *) 0 ; + Exiv2::byte *arg2 = (Exiv2::byte *) 0 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *_global_view = NULL ; + PyObject * obj1 = 0 ; + size_t result; + + if (!PyArg_UnpackTuple(args, "CurlIo_write", 1, 1, &obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Exiv2__CurlIo, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CurlIo_write" "', argument " "1"" of type '" "Exiv2::CurlIo *""'"); + } + arg1 = reinterpret_cast< Exiv2::CurlIo * >(argp1); + { + _global_view = PyMemoryView_GetContiguous(obj1, PyBUF_READ, 'A'); + if (!_global_view) { + PyErr_Clear(); + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "CurlIo_write" "', argument " "2"" of type '" "bytes-like object""'") + ; + } + Py_buffer* buff = PyMemoryView_GET_BUFFER(_global_view); + arg2 = (Exiv2::byte *) buff->buf; + arg3 = (size_t) buff->len; + } + { + try { + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (arg1)->write((Exiv2::byte const *)arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + } + catch(std::exception const& e) { + _set_python_exception(); + SWIG_fail; + } + } + resultobj = SWIG_From_size_t(static_cast< size_t >(result)); + + Py_XDECREF(_global_view); + + return resultobj; +fail: + + Py_XDECREF(_global_view); + + return NULL; +} + + +SWIGINTERN PyObject *_wrap_CurlIo_write__SWIG_1(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + Exiv2::CurlIo *arg1 = (Exiv2::CurlIo *) 0 ; + Exiv2::BasicIo *arg2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj1 = 0 ; + size_t result; + + if (!PyArg_UnpackTuple(args, "CurlIo_write", 1, 1, &obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Exiv2__CurlIo, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CurlIo_write" "', argument " "1"" of type '" "Exiv2::CurlIo *""'"); + } + arg1 = reinterpret_cast< Exiv2::CurlIo * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_Exiv2__BasicIo, 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CurlIo_write" "', argument " "2"" of type '" "Exiv2::BasicIo &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CurlIo_write" "', argument " "2"" of type '" "Exiv2::BasicIo &""'"); + } + arg2 = reinterpret_cast< Exiv2::BasicIo * >(argp2); + { + try { + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (arg1)->write(*arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + } + catch(std::exception const& e) { + _set_python_exception(); + SWIG_fail; + } + } + resultobj = SWIG_From_size_t(static_cast< size_t >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_CurlIo_write(PyObject *self, PyObject *args) { + Py_ssize_t argc; + PyObject *argv[3] = { + 0 + }; + Py_ssize_t ii; + + (void)self; + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + argv[0] = self; + for (ii = 0; (ii < 1) && (ii < argc); ii++) { + argv[ii + 1] = PyTuple_GET_ITEM(args,ii); + } + argc++; + if (argc == 2) { + int _v = 0; + { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Exiv2__BasicIo, SWIG_POINTER_NO_NULL); + _v = SWIG_CheckState(res); + } + if (!_v) goto check_1; + return _wrap_CurlIo_write__SWIG_1(self, args); + } +check_1: + + if (argc == 2) { + PyObject *retobj = _wrap_CurlIo_write__SWIG_0(self, args); + if (!SWIG_Python_TypeErrorOccurred(retobj)) return retobj; + SWIG_fail; + } + +fail: + SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'CurlIo_write'.\n" + " Possible C/C++ prototypes are:\n" + " Exiv2::CurlIo::write(Exiv2::byte const *,size_t)\n" + " Exiv2::CurlIo::write(Exiv2::BasicIo &)\n"); + return 0; +} + + +SWIGINTERN PyObject *_wrap_delete_CurlIo(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + Exiv2::CurlIo *arg1 = (Exiv2::CurlIo *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + + if (args && PyTuple_Check(args) && PyTuple_GET_SIZE(args) > 0) SWIG_exception_fail(SWIG_TypeError, "delete_CurlIo takes no arguments"); + res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Exiv2__CurlIo, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CurlIo" "', argument " "1"" of type '" "Exiv2::CurlIo *""'"); + } + arg1 = reinterpret_cast< Exiv2::CurlIo * >(argp1); + { + try { + delete arg1; + } + catch(std::exception const& e) { + _set_python_exception(); + SWIG_fail; + } + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGPY_DESTRUCTOR_CLOSURE(_wrap_delete_CurlIo) /* defines _wrap_delete_CurlIo_destructor_closure */ + +static PyMethodDef SwigMethods[] = { + { "_enum_list_Position", _wrap__enum_list_Position, METH_VARARGS, NULL}, + { NULL, NULL, 0, NULL } +}; + +static SwigPyGetSet BasicIo___dict___getset = { SwigPyObject_get___dict__, 0 }; +SWIGINTERN PyGetSetDef SwigPyBuiltin__Exiv2__BasicIo_getset[] = { + { (char *)"__dict__", SwigPyBuiltin_GetterClosure, 0, (char *)"", &BasicIo___dict___getset }, + { NULL, NULL, NULL, NULL, NULL } /* Sentinel */ +}; + +SWIGINTERN PyObject * +SwigPyBuiltin__Exiv2__BasicIo_richcompare(PyObject *self, PyObject *other, int op) { + PyObject *result = NULL; + PyObject *tuple = PyTuple_New(1); + assert(tuple); + PyTuple_SET_ITEM(tuple, 0, other); + Py_XINCREF(other); + if (!result && !PyErr_Occurred()) { + if (SwigPyObject_Check(self) && SwigPyObject_Check(other)) { + result = SwigPyObject_richcompare((SwigPyObject *)self, (SwigPyObject *)other, op); + } else { + result = Py_NotImplemented; + Py_INCREF(result); + } + } + Py_DECREF(tuple); + return result; +} + +SWIGINTERN PyMethodDef SwigPyBuiltin__Exiv2__BasicIo_methods[] = { + { "open", _wrap_BasicIo_open, METH_VARARGS, "\n" + "Open the IO source using the default access mode. The\n" + " default mode should allow for reading and writing.\n" + "\n" + "This method can also be used to \"reopen\" an IO source which will\n" + "flush any unwritten data and reset the IO position to the start.\n" + "Subclasses may provide custom methods to allow for\n" + "opening IO sources differently.\n" + "\n" + ":rtype: int\n" + ":return: 0 if successful;\n" + "\n" + " Nonzero if failure.\n" + "" }, + { "close", _wrap_BasicIo_close, METH_VARARGS, "\n" + "Close the IO source. After closing a BasicIo instance can not\n" + " be read or written. Closing flushes any unwritten data. It is\n" + " safe to call close on a closed instance.\n" + ":rtype: int\n" + ":return: 0 if successful;\n" + "\n" + " Nonzero if failure.\n" + "" }, + { "write", _wrap_BasicIo_write, METH_VARARGS, "\n" + "*Overload 1:*\n" + "\n" + "Write data to the IO source. Current IO position is advanced\n" + " by the number of bytes written.\n" + ":type data: :py:term:`bytes-like object`\n" + ":param data: Pointer to data. Data must be at least *wcount*\n" + " bytes long\n" + ":type wcount: int\n" + ":param wcount: Number of bytes to be written.\n" + ":rtype: int\n" + ":return: Number of bytes written to IO source successfully;\n" + "\n" + " 0 if failure;\n" + "\n" + "|\n" + "\n" + "*Overload 2:*\n" + "\n" + "Write data that is read from another BasicIo instance to\n" + " the IO source. Current IO position is advanced by the number\n" + " of bytes written.\n" + ":type src: :py:class:`BasicIo`\n" + ":param src: Reference to another BasicIo instance. Reading start\n" + " at the source's current IO position\n" + ":rtype: int\n" + ":return: Number of bytes written to IO source successfully;\n" + "\n" + " 0 if failure;\n" + "" }, + { "putb", _wrap_BasicIo_putb, METH_VARARGS, "\n" + "Write one byte to the IO source. Current IO position is\n" + " advanced by one byte.\n" + ":type data: int\n" + ":param data: The single byte to be written.\n" + ":rtype: int\n" + ":return: The value of the byte written if successful;\n" + "\n" + " EOF if failure;\n" + "" }, + { "read", _wrap_BasicIo_read, METH_VARARGS, "\n" + "*Overload 1:*\n" + "\n" + "Read data from the IO source. Reading starts at the current\n" + " IO position and the position is advanced by the number of bytes\n" + " read.\n" + ":type rcount: int\n" + ":param rcount: Maximum number of bytes to read. Fewer bytes may be\n" + " read if *rcount* bytes are not available.\n" + ":rtype: :py:class:`DataBuf`\n" + ":return: DataBuf instance containing the bytes read. Use the\n" + " DataBuf::size_ member to find the number of bytes read.\n" + " DataBuf::size_ will be 0 on failure.\n" + "\n" + "|\n" + "\n" + "*Overload 2:*\n" + "\n" + "Read data from the IO source. Reading starts at the current\n" + " IO position and the position is advanced by the number of bytes\n" + " read.\n" + ":type buf: writeable :py:term:`bytes-like object`\n" + ":param buf: Pointer to a block of memory into which the read data\n" + " is stored. The memory block must be at least *rcount* bytes\n" + " long.\n" + ":type rcount: int\n" + ":param rcount: Maximum number of bytes to read. Fewer bytes may be\n" + " read if *rcount* bytes are not available.\n" + ":rtype: int\n" + ":return: Number of bytes read from IO source successfully;\n" + "\n" + " 0 if failure;\n" + "" }, + { "readOrThrow", _wrap_BasicIo_readOrThrow, METH_VARARGS, "\n" + "Safe version of `read()` that checks for errors and throws\n" + " an exception if the read was unsuccessful.\n" + ":type buf: writeable :py:term:`bytes-like object`\n" + ":param buf: Pointer to a block of memory into which the read data\n" + " is stored. The memory block must be at least *rcount* bytes\n" + " long.\n" + ":type rcount: int\n" + ":param rcount: Maximum number of bytes to read. Fewer bytes may be\n" + " read if *rcount* bytes are not available.\n" + ":type err: ErrorCode, optional\n" + ":param err: Error code to use if an exception is thrown.\n" + "" }, + { "getb", _wrap_BasicIo_getb, METH_VARARGS, "\n" + "Read one byte from the IO source. Current IO position is\n" + " advanced by one byte.\n" + ":rtype: int\n" + ":return: The byte read from the IO source if successful;\n" + "\n" + " EOF if failure;\n" + "" }, + { "transfer", _wrap_BasicIo_transfer, METH_VARARGS, "\n" + "Remove all data from this object's IO source and then transfer\n" + " data from the *src* BasicIo object into this object.\n" + "\n" + "The source object is invalidated by this operation and should not be\n" + "used after this method returns. This method exists primarily to\n" + "be used with the BasicIo::temporary() method.\n" + "\n" + ":type src: :py:class:`BasicIo`\n" + ":param src: Reference to another BasicIo instance. The entire contents\n" + " of src are transferred to this object. The *src* object is\n" + " invalidated by the method.\n" + ":raises: Error In case of failure\n" + "" }, + { "seek", _wrap_BasicIo_seek, METH_VARARGS, "\n" + "Move the current IO position.\n" + ":type offset: int\n" + ":param offset: Number of bytes to move the position relative\n" + " to the starting position specified by *pos*\n" + ":type pos: :py:class:`BasicIo.Position`\n" + ":param pos: Position from which the seek should start\n" + ":rtype: int\n" + ":return: 0 if successful;\n" + "\n" + " Nonzero if failure;\n" + "" }, + { "seekOrThrow", _wrap_BasicIo_seekOrThrow, METH_VARARGS, "\n" + "Safe version of `seek()` that checks for errors and throws\n" + " an exception if the seek was unsuccessful.\n" + ":type offset: int\n" + ":param offset: Number of bytes to move the position relative\n" + " to the starting position specified by *pos*\n" + ":type pos: :py:class:`BasicIo.Position`\n" + ":param pos: Position from which the seek should start\n" ":type err: ErrorCode\n" ":param err: Error code to use if an exception is thrown.\n" "" }, - { "mmap", _wrap_BasicIo_mmap, METH_VARARGS, "\n" - "Direct access to the IO data. For files, this is done by\n" - " mapping the file into the process's address space; for memory\n" - " blocks, this allows direct access to the memory block.\n" + { "mmap", _wrap_BasicIo_mmap, METH_VARARGS, "\n" + "Direct access to the IO data. For files, this is done by\n" + " mapping the file into the process's address space; for memory\n" + " blocks, this allows direct access to the memory block.\n" + ":type isWriteable: bool, optional\n" + ":param isWriteable: Set to true if the mapped area should be writeable\n" + " (default is false).\n" + ":rtype: memoryview\n" + ":return: A pointer to the mapped area.\n" + ":raises: Error In case of failure.\n" + "" }, + { "munmap", _wrap_BasicIo_munmap, METH_VARARGS, "\n" + "Remove a mapping established with mmap(). If the mapped area\n" + " is writeable, this ensures that changes are written back.\n" + ":rtype: int\n" + ":return: 0 if successful;\n" + "\n" + " Nonzero if failure;\n" + "" }, + { "tell", _wrap_BasicIo_tell, METH_VARARGS, "\n" + "Get the current IO position.\n" + ":rtype: int\n" + ":return: Offset from the start of IO\n" + "" }, + { "size", _wrap_BasicIo_size, METH_VARARGS, "\n" + "Get the current size of the IO source in bytes.\n" + ":rtype: int\n" + ":return: Size of the IO source in bytes;\n" + "\n" + " -1 if failure;\n" + "" }, + { "isopen", _wrap_BasicIo_isopen, METH_VARARGS, " Returns true if the IO source is open, otherwise false." }, + { "error", _wrap_BasicIo_error, METH_VARARGS, " Returns 0 if the IO source is in a valid state, otherwise nonzero." }, + { "eof", _wrap_BasicIo_eof, METH_VARARGS, " Returns true if the IO position has reached the end, otherwise false." }, + { "path", _wrap_BasicIo_path, METH_VARARGS, "\n" + "Return the path to the IO resource. Often used to form\n" + " comprehensive error messages where only a BasicIo instance is\n" + " available.\n" + "" }, + { NULL, NULL, 0, NULL } /* Sentinel */ +}; + +static PyHeapTypeObject SwigPyBuiltin__Exiv2__BasicIo_type = { + { +#if PY_VERSION_HEX >= 0x03000000 + PyVarObject_HEAD_INIT(NULL, 0) +#else + PyObject_HEAD_INIT(NULL) + 0, /* ob_size */ +#endif + "exiv2.basicio.BasicIo", /* tp_name */ + sizeof(SwigPyObject), /* tp_basicsize */ + 0, /* tp_itemsize */ + SwigPyBuiltin_BadDealloc, /* tp_dealloc */ +#if PY_VERSION_HEX < 0x030800b4 + (printfunc) 0, /* tp_print */ +#else + (Py_ssize_t) 0, /* tp_vectorcall_offset */ +#endif + (getattrfunc) 0, /* tp_getattr */ + (setattrfunc) 0, /* tp_setattr */ +#if PY_VERSION_HEX >= 0x03000000 + 0, /* tp_compare */ +#else + (cmpfunc) 0, /* tp_compare */ +#endif + (reprfunc) 0, /* tp_repr */ + &SwigPyBuiltin__Exiv2__BasicIo_type.as_number, /* tp_as_number */ + &SwigPyBuiltin__Exiv2__BasicIo_type.as_sequence, /* tp_as_sequence */ + &SwigPyBuiltin__Exiv2__BasicIo_type.as_mapping, /* tp_as_mapping */ + SwigPyObject_hash, /* tp_hash */ + (ternaryfunc) 0, /* tp_call */ + (reprfunc) 0, /* tp_str */ + (getattrofunc) 0, /* tp_getattro */ + (setattrofunc) 0, /* tp_setattro */ + &SwigPyBuiltin__Exiv2__BasicIo_type.as_buffer, /* tp_as_buffer */ +#if PY_VERSION_HEX >= 0x03000000 + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */ +#else + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES, /* tp_flags */ +#endif + "\n" + "An interface for simple binary IO.\n" + "\n" + "Designed to have semantics and names similar to those of C style FILE*\n" + "operations. Subclasses should all behave the same so that they can be\n" + "interchanged.\n" + "",/* tp_doc */ + (traverseproc) 0, /* tp_traverse */ + (inquiry) 0, /* tp_clear */ + SwigPyBuiltin__Exiv2__BasicIo_richcompare,/* tp_richcompare */ + 0, /* tp_weaklistoffset */ + (getiterfunc) 0, /* tp_iter */ + (iternextfunc) 0, /* tp_iternext */ + SwigPyBuiltin__Exiv2__BasicIo_methods, /* tp_methods */ + 0, /* tp_members */ + SwigPyBuiltin__Exiv2__BasicIo_getset, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + (descrgetfunc) 0, /* tp_descr_get */ + (descrsetfunc) 0, /* tp_descr_set */ + offsetof(SwigPyObject, dict), /* tp_dictoffset */ + SwigPyBuiltin_BadInit, /* tp_init */ + (allocfunc) 0, /* tp_alloc */ + (newfunc) 0, /* tp_new */ + (freefunc) 0, /* tp_free */ + (inquiry) 0, /* tp_is_gc */ + (PyObject *) 0, /* tp_bases */ + (PyObject *) 0, /* tp_mro */ + (PyObject *) 0, /* tp_cache */ + (PyObject *) 0, /* tp_subclasses */ + (PyObject *) 0, /* tp_weaklist */ + (destructor) 0, /* tp_del */ + (int) 0, /* tp_version_tag */ +#if PY_VERSION_HEX >= 0x03040000 + (destructor) 0, /* tp_finalize */ +#endif +#if PY_VERSION_HEX >= 0x03080000 + (vectorcallfunc) 0, /* tp_vectorcall */ +#endif +#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) + 0, /* tp_print */ +#endif +#if PY_VERSION_HEX >= 0x030c0000 + (char) 0, /* tp_watched */ +#endif +#ifdef COUNT_ALLOCS + (Py_ssize_t) 0, /* tp_allocs */ + (Py_ssize_t) 0, /* tp_frees */ + (Py_ssize_t) 0, /* tp_maxalloc */ + 0, /* tp_prev */ + 0, /* tp_next */ +#endif + }, +#if PY_VERSION_HEX >= 0x03050000 + { + (unaryfunc) 0, /* am_await */ + (unaryfunc) 0, /* am_aiter */ + (unaryfunc) 0, /* am_anext */ +# if PY_VERSION_HEX >= 0x030a0000 + (sendfunc) 0, /* am_send */ +# endif + }, +#endif + { + (binaryfunc) 0, /* nb_add */ + (binaryfunc) 0, /* nb_subtract */ + (binaryfunc) 0, /* nb_multiply */ +#if PY_VERSION_HEX < 0x03000000 + (binaryfunc) 0, /* nb_divide */ +#endif + (binaryfunc) 0, /* nb_remainder */ + (binaryfunc) 0, /* nb_divmod */ + (ternaryfunc) 0, /* nb_power */ + (unaryfunc) 0, /* nb_negative */ + (unaryfunc) 0, /* nb_positive */ + (unaryfunc) 0, /* nb_absolute */ + (inquiry) 0, /* nb_nonzero */ + (unaryfunc) 0, /* nb_invert */ + (binaryfunc) 0, /* nb_lshift */ + (binaryfunc) 0, /* nb_rshift */ + (binaryfunc) 0, /* nb_and */ + (binaryfunc) 0, /* nb_xor */ + (binaryfunc) 0, /* nb_or */ +#if PY_VERSION_HEX < 0x03000000 + (coercion) 0, /* nb_coerce */ +#endif + (unaryfunc) 0, /* nb_int */ +#if PY_VERSION_HEX >= 0x03000000 + (void *) 0, /* nb_reserved */ +#else + (unaryfunc) 0, /* nb_long */ +#endif + (unaryfunc) 0, /* nb_float */ +#if PY_VERSION_HEX < 0x03000000 + (unaryfunc) 0, /* nb_oct */ + (unaryfunc) 0, /* nb_hex */ +#endif + (binaryfunc) 0, /* nb_inplace_add */ + (binaryfunc) 0, /* nb_inplace_subtract */ + (binaryfunc) 0, /* nb_inplace_multiply */ +#if PY_VERSION_HEX < 0x03000000 + (binaryfunc) 0, /* nb_inplace_divide */ +#endif + (binaryfunc) 0, /* nb_inplace_remainder */ + (ternaryfunc) 0, /* nb_inplace_power */ + (binaryfunc) 0, /* nb_inplace_lshift */ + (binaryfunc) 0, /* nb_inplace_rshift */ + (binaryfunc) 0, /* nb_inplace_and */ + (binaryfunc) 0, /* nb_inplace_xor */ + (binaryfunc) 0, /* nb_inplace_or */ + (binaryfunc) 0, /* nb_floor_divide */ + (binaryfunc) 0, /* nb_true_divide */ + (binaryfunc) 0, /* nb_inplace_floor_divide */ + (binaryfunc) 0, /* nb_inplace_true_divide */ + (unaryfunc) 0, /* nb_index */ +#if PY_VERSION_HEX >= 0x03050000 + (binaryfunc) 0, /* nb_matrix_multiply */ + (binaryfunc) 0, /* nb_inplace_matrix_multiply */ +#endif + }, + { + (lenfunc) 0, /* mp_length */ + (binaryfunc) 0, /* mp_subscript */ + (objobjargproc) 0, /* mp_ass_subscript */ + }, + { + (lenfunc) 0, /* sq_length */ + (binaryfunc) 0, /* sq_concat */ + (ssizeargfunc) 0, /* sq_repeat */ + (ssizeargfunc) 0, /* sq_item */ +#if PY_VERSION_HEX >= 0x03000000 + (void *) 0, /* was_sq_slice */ +#else + (ssizessizeargfunc) 0, /* sq_slice */ +#endif + (ssizeobjargproc) 0, /* sq_ass_item */ +#if PY_VERSION_HEX >= 0x03000000 + (void *) 0, /* was_sq_ass_slice */ +#else + (ssizessizeobjargproc) 0, /* sq_ass_slice */ +#endif + (objobjproc) 0, /* sq_contains */ + (binaryfunc) 0, /* sq_inplace_concat */ + (ssizeargfunc) 0, /* sq_inplace_repeat */ + }, + { +#if PY_VERSION_HEX < 0x03000000 + (readbufferproc) 0, /* bf_getreadbuffer */ + (writebufferproc) 0, /* bf_getwritebuffer */ + (segcountproc) 0, /* bf_getsegcount */ + (charbufferproc) 0, /* bf_getcharbuffer */ +#endif + (getbufferproc) 0, /* bf_getbuffer */ + (releasebufferproc) 0, /* bf_releasebuffer */ + }, + (PyObject *) 0, /* ht_name */ + (PyObject *) 0, /* ht_slots */ +#if PY_VERSION_HEX >= 0x03030000 + (PyObject *) 0, /* ht_qualname */ + 0, /* ht_cached_keys */ +#endif +#if PY_VERSION_HEX >= 0x03090000 + (PyObject *) 0, /* ht_module */ +#endif +#if PY_VERSION_HEX >= 0x030b0000 + (char *) 0, /* _ht_tpname */ + { + (PyObject *) 0, /* getitem */ +#if PY_VERSION_HEX >= 0x030c0000 + (uint32_t) 0, /* getitem_version */ +#endif + } +#endif +}; + +SWIGINTERN SwigPyClientData SwigPyBuiltin__Exiv2__BasicIo_clientdata = {0, 0, 0, 0, 0, 0, (PyTypeObject *)&SwigPyBuiltin__Exiv2__BasicIo_type}; + +static SwigPyGetSet FileIo___dict___getset = { SwigPyObject_get___dict__, 0 }; +SWIGINTERN PyGetSetDef SwigPyBuiltin__Exiv2__FileIo_getset[] = { + { (char *)"__dict__", SwigPyBuiltin_GetterClosure, 0, (char *)"\n" + "Constructor that accepts the file path on which IO will be\n" + " performed. The constructor does not open the file, and\n" + " therefore never fails.\n" + ":type path: str\n" + ":param path: The full path of a file\n" + "", &FileIo___dict___getset }, + { NULL, NULL, NULL, NULL, NULL } /* Sentinel */ +}; + +SWIGINTERN PyObject * +SwigPyBuiltin__Exiv2__FileIo_richcompare(PyObject *self, PyObject *other, int op) { + PyObject *result = NULL; + PyObject *tuple = PyTuple_New(1); + assert(tuple); + PyTuple_SET_ITEM(tuple, 0, other); + Py_XINCREF(other); + if (!result && !PyErr_Occurred()) { + if (SwigPyObject_Check(self) && SwigPyObject_Check(other)) { + result = SwigPyObject_richcompare((SwigPyObject *)self, (SwigPyObject *)other, op); + } else { + result = Py_NotImplemented; + Py_INCREF(result); + } + } + Py_DECREF(tuple); + return result; +} + +SWIGINTERN PyMethodDef SwigPyBuiltin__Exiv2__FileIo_methods[] = { + { "open", _wrap_FileIo_open, METH_VARARGS, "\n" + "*Overload 1:*\n" + "\n" + "Open the file using the specified mode.\n" + "\n" + "This method can also be used to \"reopen\" a file which will flush any\n" + "unwritten data and reset the IO position to the start. Although\n" + "files can be opened in binary or text mode, this class has\n" + "only been tested carefully in binary mode.\n" + "\n" + ":type mode: str\n" + ":param mode: Specified that type of access allowed on the file.\n" + " Valid values match those of the C fopen command exactly.\n" + ":rtype: int\n" + ":return: 0 if successful;\n" + "\n" + " Nonzero if failure.\n" + "\n" + "|\n" + "\n" + "*Overload 2:*\n" + "\n" + "Open the file using the default access mode of \"rb\".\n" + " This method can also be used to \"reopen\" a file which will flush\n" + " any unwritten data and reset the IO position to the start.\n" + ":rtype: int\n" + ":return: 0 if successful;\n" + "\n" + " Nonzero if failure.\n" + "" }, + { "close", _wrap_FileIo_close, METH_VARARGS, "\n" + "Flush and unwritten data and close the file . It is\n" + " safe to call close on an already closed instance.\n" + ":rtype: int\n" + ":return: 0 if successful;\n" + "\n" + " Nonzero if failure;\n" + "" }, + { "write", _wrap_FileIo_write, METH_VARARGS, "\n" + "*Overload 1:*\n" + "\n" + "Write data to the file. The file position is advanced\n" + " by the number of bytes written.\n" + ":type data: :py:term:`bytes-like object`\n" + ":param data: Pointer to data. Data must be at least *wcount*\n" + " bytes long\n" + ":type wcount: int\n" + ":param wcount: Number of bytes to be written.\n" + ":rtype: int\n" + ":return: Number of bytes written to the file successfully;\n" + "\n" + " 0 if failure;\n" + "\n" + "|\n" + "\n" + "*Overload 2:*\n" + "\n" + "Write data that is read from another BasicIo instance to\n" + " the file. The file position is advanced by the number\n" + " of bytes written.\n" + ":type src: :py:class:`BasicIo`\n" + ":param src: Reference to another BasicIo instance. Reading start\n" + " at the source's current IO position\n" + ":rtype: int\n" + ":return: Number of bytes written to the file successfully;\n" + "\n" + " 0 if failure;\n" + "" }, + { "putb", _wrap_FileIo_putb, METH_VARARGS, "\n" + "Write one byte to the file. The file position is\n" + " advanced by one byte.\n" + ":type data: int\n" + ":param data: The single byte to be written.\n" + ":rtype: int\n" + ":return: The value of the byte written if successful;\n" + "\n" + " EOF if failure;\n" + "" }, + { "read", _wrap_FileIo_read, METH_VARARGS, "\n" + "*Overload 1:*\n" + "\n" + "Read data from the file. Reading starts at the current\n" + " file position and the position is advanced by the number of\n" + " bytes read.\n" + ":type rcount: int\n" + ":param rcount: Maximum number of bytes to read. Fewer bytes may be\n" + " read if *rcount* bytes are not available.\n" + ":rtype: :py:class:`DataBuf`\n" + ":return: DataBuf instance containing the bytes read. Use the\n" + " DataBuf::size_ member to find the number of bytes read.\n" + " DataBuf::size_ will be 0 on failure.\n" + "\n" + "|\n" + "\n" + "*Overload 2:*\n" + "\n" + "Read data from the file. Reading starts at the current\n" + " file position and the position is advanced by the number of\n" + " bytes read.\n" + ":type buf: writeable :py:term:`bytes-like object`\n" + ":param buf: Pointer to a block of memory into which the read data\n" + " is stored. The memory block must be at least *rcount* bytes\n" + " long.\n" + ":type rcount: int\n" + ":param rcount: Maximum number of bytes to read. Fewer bytes may be\n" + " read if *rcount* bytes are not available.\n" + ":rtype: int\n" + ":return: Number of bytes read from the file successfully;\n" + "\n" + " 0 if failure;\n" + "" }, + { "getb", _wrap_FileIo_getb, METH_VARARGS, "\n" + "Read one byte from the file. The file position is\n" + " advanced by one byte.\n" + ":rtype: int\n" + ":return: The byte read from the file if successful;\n" + "\n" + " EOF if failure;\n" + "" }, + { "transfer", _wrap_FileIo_transfer, METH_VARARGS, "\n" + "Remove the contents of the file and then transfer data from\n" + " the *src* BasicIo object into the empty file.\n" + "\n" + "This method is optimized to simply rename the source file if the\n" + "source object is another FileIo instance. The source BasicIo object\n" + "is invalidated by this operation and should not be used after this\n" + "method returns. This method exists primarily to be used with\n" + "the BasicIo::temporary() method.\n" + "\n" + "Notes: If the caller doesn't have permissions to write to the file,\n" + " an exception is raised and *src* is deleted.\n" + "\n" + ":type src: :py:class:`BasicIo`\n" + ":param src: Reference to another BasicIo instance. The entire contents\n" + " of src are transferred to this object. The *src* object is\n" + " invalidated by the method.\n" + ":raises: Error In case of failure\n" + "" }, + { "seek", _wrap_FileIo_seek, METH_VARARGS, "" }, + { "mmap", _wrap_FileIo_mmap, METH_VARARGS, "\n" + "Map the file into the process's address space. The file must be\n" + " open before mmap() is called. If the mapped area is writeable,\n" + " changes may not be written back to the underlying file until\n" + " munmap() is called. The pointer is valid only as long as the\n" + " FileIo object exists.\n" ":type isWriteable: bool, optional\n" ":param isWriteable: Set to true if the mapped area should be writeable\n" " (default is false).\n" @@ -9010,38 +9759,37 @@ SWIGINTERN PyMethodDef SwigPyBuiltin__Exiv2__BasicIo_methods[] = { ":return: A pointer to the mapped area.\n" ":raises: Error In case of failure.\n" "" }, - { "munmap", _wrap_BasicIo_munmap, METH_VARARGS, "\n" - "Remove a mapping established with mmap(). If the mapped area\n" - " is writeable, this ensures that changes are written back.\n" + { "munmap", _wrap_FileIo_munmap, METH_VARARGS, "\n" + "Remove a mapping established with mmap(). If the mapped area is\n" + " writeable, this ensures that changes are written back to the\n" + " underlying file.\n" ":rtype: int\n" ":return: 0 if successful;\n" "\n" " Nonzero if failure;\n" "" }, - { "tell", _wrap_BasicIo_tell, METH_VARARGS, "\n" - "Get the current IO position.\n" + { "setPath", _wrap_FileIo_setPath, METH_VARARGS, " close the file source and set a new path." }, + { "tell", _wrap_FileIo_tell, METH_VARARGS, "\n" + "Get the current file position.\n" ":rtype: int\n" - ":return: Offset from the start of IO\n" + ":return: Offset from the start of the file\n" "" }, - { "size", _wrap_BasicIo_size, METH_VARARGS, "\n" - "Get the current size of the IO source in bytes.\n" + { "size", _wrap_FileIo_size, METH_VARARGS, "\n" + "Flush any buffered writes and get the current file size\n" + " in bytes.\n" ":rtype: int\n" - ":return: Size of the IO source in bytes;\n" + ":return: Size of the file in bytes;\n" "\n" " -1 if failure;\n" "" }, - { "isopen", _wrap_BasicIo_isopen, METH_VARARGS, " Returns true if the IO source is open, otherwise false." }, - { "error", _wrap_BasicIo_error, METH_VARARGS, " Returns 0 if the IO source is in a valid state, otherwise nonzero." }, - { "eof", _wrap_BasicIo_eof, METH_VARARGS, " Returns true if the IO position has reached the end, otherwise false." }, - { "path", _wrap_BasicIo_path, METH_VARARGS, "\n" - "Return the path to the IO resource. Often used to form\n" - " comprehensive error messages where only a BasicIo instance is\n" - " available.\n" - "" }, + { "isopen", _wrap_FileIo_isopen, METH_VARARGS, " Returns true if the file is open, otherwise false." }, + { "error", _wrap_FileIo_error, METH_VARARGS, " Returns 0 if the file is in a valid state, otherwise nonzero." }, + { "eof", _wrap_FileIo_eof, METH_VARARGS, " Returns true if the file position has reached the end, otherwise false." }, + { "path", _wrap_FileIo_path, METH_VARARGS, " Returns the path of the file" }, { NULL, NULL, 0, NULL } /* Sentinel */ }; -static PyHeapTypeObject SwigPyBuiltin__Exiv2__BasicIo_type = { +static PyHeapTypeObject SwigPyBuiltin__Exiv2__FileIo_type = { { #if PY_VERSION_HEX >= 0x03000000 PyVarObject_HEAD_INIT(NULL, 0) @@ -9049,10 +9797,10 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__BasicIo_type = { PyObject_HEAD_INIT(NULL) 0, /* ob_size */ #endif - "exiv2.basicio.BasicIo", /* tp_name */ + "exiv2.basicio.FileIo", /* tp_name */ sizeof(SwigPyObject), /* tp_basicsize */ 0, /* tp_itemsize */ - SwigPyBuiltin_BadDealloc, /* tp_dealloc */ + _wrap_delete_FileIo_destructor_closure, /* tp_dealloc */ #if PY_VERSION_HEX < 0x030800b4 (printfunc) 0, /* tp_print */ #else @@ -9066,42 +9814,39 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__BasicIo_type = { (cmpfunc) 0, /* tp_compare */ #endif (reprfunc) 0, /* tp_repr */ - &SwigPyBuiltin__Exiv2__BasicIo_type.as_number, /* tp_as_number */ - &SwigPyBuiltin__Exiv2__BasicIo_type.as_sequence, /* tp_as_sequence */ - &SwigPyBuiltin__Exiv2__BasicIo_type.as_mapping, /* tp_as_mapping */ + &SwigPyBuiltin__Exiv2__FileIo_type.as_number, /* tp_as_number */ + &SwigPyBuiltin__Exiv2__FileIo_type.as_sequence, /* tp_as_sequence */ + &SwigPyBuiltin__Exiv2__FileIo_type.as_mapping, /* tp_as_mapping */ SwigPyObject_hash, /* tp_hash */ (ternaryfunc) 0, /* tp_call */ (reprfunc) 0, /* tp_str */ (getattrofunc) 0, /* tp_getattro */ (setattrofunc) 0, /* tp_setattro */ - &SwigPyBuiltin__Exiv2__BasicIo_type.as_buffer, /* tp_as_buffer */ + &SwigPyBuiltin__Exiv2__FileIo_type.as_buffer, /* tp_as_buffer */ #if PY_VERSION_HEX >= 0x03000000 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */ #else Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES, /* tp_flags */ #endif "\n" - "An interface for simple binary IO.\n" - "\n" - "Designed to have semantics and names similar to those of C style FILE*\n" - "operations. Subclasses should all behave the same so that they can be\n" - "interchanged.\n" + "Provides binary file IO by implementing the BasicIo\n" + " interface.\n" "",/* tp_doc */ (traverseproc) 0, /* tp_traverse */ (inquiry) 0, /* tp_clear */ - SwigPyBuiltin__Exiv2__BasicIo_richcompare,/* tp_richcompare */ + SwigPyBuiltin__Exiv2__FileIo_richcompare, /* tp_richcompare */ 0, /* tp_weaklistoffset */ (getiterfunc) 0, /* tp_iter */ (iternextfunc) 0, /* tp_iternext */ - SwigPyBuiltin__Exiv2__BasicIo_methods, /* tp_methods */ + SwigPyBuiltin__Exiv2__FileIo_methods, /* tp_methods */ 0, /* tp_members */ - SwigPyBuiltin__Exiv2__BasicIo_getset, /* tp_getset */ + SwigPyBuiltin__Exiv2__FileIo_getset, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ (descrgetfunc) 0, /* tp_descr_get */ (descrsetfunc) 0, /* tp_descr_set */ offsetof(SwigPyObject, dict), /* tp_dictoffset */ - SwigPyBuiltin_BadInit, /* tp_init */ + _wrap_new_FileIo, /* tp_init */ (allocfunc) 0, /* tp_alloc */ (newfunc) 0, /* tp_new */ (freefunc) 0, /* tp_free */ @@ -9206,7 +9951,7 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__BasicIo_type = { (objobjargproc) 0, /* mp_ass_subscript */ }, { - (lenfunc) 0, /* sq_length */ + _wrap_FileIo_size_lenfunc_closure, /* sq_length */ (binaryfunc) 0, /* sq_concat */ (ssizeargfunc) 0, /* sq_repeat */ (ssizeargfunc) 0, /* sq_item */ @@ -9232,8 +9977,8 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__BasicIo_type = { (segcountproc) 0, /* bf_getsegcount */ (charbufferproc) 0, /* bf_getcharbuffer */ #endif - (getbufferproc) 0, /* bf_getbuffer */ - (releasebufferproc) 0, /* bf_releasebuffer */ + getbuffer_Exiv2_FileIo, /* bf_getbuffer */ + releasebuffer_Exiv2_FileIo, /* bf_releasebuffer */ }, (PyObject *) 0, /* ht_name */ (PyObject *) 0, /* ht_slots */ @@ -9255,22 +10000,31 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__BasicIo_type = { #endif }; -SWIGINTERN SwigPyClientData SwigPyBuiltin__Exiv2__BasicIo_clientdata = {0, 0, 0, 0, 0, 0, (PyTypeObject *)&SwigPyBuiltin__Exiv2__BasicIo_type}; +SWIGINTERN SwigPyClientData SwigPyBuiltin__Exiv2__FileIo_clientdata = {0, 0, 0, 0, 0, 0, (PyTypeObject *)&SwigPyBuiltin__Exiv2__FileIo_type}; -static SwigPyGetSet FileIo___dict___getset = { SwigPyObject_get___dict__, 0 }; -SWIGINTERN PyGetSetDef SwigPyBuiltin__Exiv2__FileIo_getset[] = { +static SwigPyGetSet MemIo___dict___getset = { SwigPyObject_get___dict__, 0 }; +SWIGINTERN PyGetSetDef SwigPyBuiltin__Exiv2__MemIo_getset[] = { { (char *)"__dict__", SwigPyBuiltin_GetterClosure, 0, (char *)"\n" - "Constructor that accepts the file path on which IO will be\n" - " performed. The constructor does not open the file, and\n" - " therefore never fails.\n" - ":type path: str\n" - ":param path: The full path of a file\n" - "", &FileIo___dict___getset }, + "*Overload 1:*\n" + "Default constructor that results in an empty object\n" + "\n" + "|\n" + "\n" + "*Overload 2:*\n" + "\n" + " Constructor that accepts a block of memory. A copy-on-write\n" + " algorithm allows read operations directly from the original data\n" + " and will create a copy of the buffer on the first write operation.\n" + " :type data: :py:term:`bytes-like object`\n" + " :param data: Pointer to data. Data must be at least *size* bytes long\n" + " :type size: int\n" + " :param size: Number of bytes to copy.\n" + "", &MemIo___dict___getset }, { NULL, NULL, NULL, NULL, NULL } /* Sentinel */ }; SWIGINTERN PyObject * -SwigPyBuiltin__Exiv2__FileIo_richcompare(PyObject *self, PyObject *other, int op) { +SwigPyBuiltin__Exiv2__MemIo_richcompare(PyObject *self, PyObject *other, int op) { PyObject *result = NULL; PyObject *tuple = PyTuple_New(1); assert(tuple); @@ -9288,49 +10042,24 @@ SwigPyBuiltin__Exiv2__FileIo_richcompare(PyObject *self, PyObject *other, int op return result; } -SWIGINTERN PyMethodDef SwigPyBuiltin__Exiv2__FileIo_methods[] = { - { "open", _wrap_FileIo_open, METH_VARARGS, "\n" - "*Overload 1:*\n" - "\n" - "Open the file using the specified mode.\n" - "\n" - "This method can also be used to \"reopen\" a file which will flush any\n" - "unwritten data and reset the IO position to the start. Although\n" - "files can be opened in binary or text mode, this class has\n" - "only been tested carefully in binary mode.\n" - "\n" - ":type mode: str\n" - ":param mode: Specified that type of access allowed on the file.\n" - " Valid values match those of the C fopen command exactly.\n" - ":rtype: int\n" - ":return: 0 if successful;\n" - "\n" - " Nonzero if failure.\n" - "\n" - "|\n" - "\n" - "*Overload 2:*\n" +SWIGINTERN PyMethodDef SwigPyBuiltin__Exiv2__MemIo_methods[] = { + { "open", _wrap_MemIo_open, METH_VARARGS, "\n" + "Memory IO is always open for reading and writing. This method\n" + " therefore only resets the IO position to the start.\n" "\n" - "Open the file using the default access mode of \"rb\".\n" - " This method can also be used to \"reopen\" a file which will flush\n" - " any unwritten data and reset the IO position to the start.\n" ":rtype: int\n" - ":return: 0 if successful;\n" - "\n" - " Nonzero if failure.\n" + ":return: 0\n" "" }, - { "close", _wrap_FileIo_close, METH_VARARGS, "\n" - "Flush and unwritten data and close the file . It is\n" - " safe to call close on an already closed instance.\n" + { "close", _wrap_MemIo_close, METH_VARARGS, "\n" + "Does nothing on MemIo objects.\n" ":rtype: int\n" - ":return: 0 if successful;\n" - "\n" - " Nonzero if failure;\n" + ":return: 0\n" "" }, - { "write", _wrap_FileIo_write, METH_VARARGS, "\n" + { "write", _wrap_MemIo_write, METH_VARARGS, "\n" "*Overload 1:*\n" "\n" - "Write data to the file. The file position is advanced\n" + "Write data to the memory block. If needed, the size of the\n" + " internal memory block is expanded. The IO position is advanced\n" " by the number of bytes written.\n" ":type data: :py:term:`bytes-like object`\n" ":param data: Pointer to data. Data must be at least *wcount*\n" @@ -9338,7 +10067,7 @@ SWIGINTERN PyMethodDef SwigPyBuiltin__Exiv2__FileIo_methods[] = { ":type wcount: int\n" ":param wcount: Number of bytes to be written.\n" ":rtype: int\n" - ":return: Number of bytes written to the file successfully;\n" + ":return: Number of bytes written to the memory block successfully;\n" "\n" " 0 if failure;\n" "\n" @@ -9347,18 +10076,19 @@ SWIGINTERN PyMethodDef SwigPyBuiltin__Exiv2__FileIo_methods[] = { "*Overload 2:*\n" "\n" "Write data that is read from another BasicIo instance to\n" - " the file. The file position is advanced by the number\n" + " the memory block. If needed, the size of the internal memory\n" + " block is expanded. The IO position is advanced by the number\n" " of bytes written.\n" ":type src: :py:class:`BasicIo`\n" ":param src: Reference to another BasicIo instance. Reading start\n" " at the source's current IO position\n" ":rtype: int\n" - ":return: Number of bytes written to the file successfully;\n" + ":return: Number of bytes written to the memory block successfully;\n" "\n" " 0 if failure;\n" "" }, - { "putb", _wrap_FileIo_putb, METH_VARARGS, "\n" - "Write one byte to the file. The file position is\n" + { "putb", _wrap_MemIo_putb, METH_VARARGS, "\n" + "Write one byte to the memory block. The IO position is\n" " advanced by one byte.\n" ":type data: int\n" ":param data: The single byte to be written.\n" @@ -9367,11 +10097,11 @@ SWIGINTERN PyMethodDef SwigPyBuiltin__Exiv2__FileIo_methods[] = { "\n" " EOF if failure;\n" "" }, - { "read", _wrap_FileIo_read, METH_VARARGS, "\n" + { "read", _wrap_MemIo_read, METH_VARARGS, "\n" "*Overload 1:*\n" "\n" - "Read data from the file. Reading starts at the current\n" - " file position and the position is advanced by the number of\n" + "Read data from the memory block. Reading starts at the current\n" + " IO position and the position is advanced by the number of\n" " bytes read.\n" ":type rcount: int\n" ":param rcount: Maximum number of bytes to read. Fewer bytes may be\n" @@ -9385,8 +10115,8 @@ SWIGINTERN PyMethodDef SwigPyBuiltin__Exiv2__FileIo_methods[] = { "\n" "*Overload 2:*\n" "\n" - "Read data from the file. Reading starts at the current\n" - " file position and the position is advanced by the number of\n" + "Read data from the memory block. Reading starts at the current\n" + " IO position and the position is advanced by the number of\n" " bytes read.\n" ":type buf: writeable :py:term:`bytes-like object`\n" ":param buf: Pointer to a block of memory into which the read data\n" @@ -9396,82 +10126,64 @@ SWIGINTERN PyMethodDef SwigPyBuiltin__Exiv2__FileIo_methods[] = { ":param rcount: Maximum number of bytes to read. Fewer bytes may be\n" " read if *rcount* bytes are not available.\n" ":rtype: int\n" - ":return: Number of bytes read from the file successfully;\n" + ":return: Number of bytes read from the memory block successfully;\n" "\n" " 0 if failure;\n" "" }, - { "getb", _wrap_FileIo_getb, METH_VARARGS, "\n" - "Read one byte from the file. The file position is\n" + { "getb", _wrap_MemIo_getb, METH_VARARGS, "\n" + "Read one byte from the memory block. The IO position is\n" " advanced by one byte.\n" ":rtype: int\n" - ":return: The byte read from the file if successful;\n" + ":return: The byte read from the memory block if successful;\n" "\n" " EOF if failure;\n" - "" }, - { "transfer", _wrap_FileIo_transfer, METH_VARARGS, "\n" - "Remove the contents of the file and then transfer data from\n" - " the *src* BasicIo object into the empty file.\n" + "" }, + { "transfer", _wrap_MemIo_transfer, METH_VARARGS, "\n" + "Clear the memory block and then transfer data from\n" + " the *src* BasicIo object into a new block of memory.\n" "\n" - "This method is optimized to simply rename the source file if the\n" - "source object is another FileIo instance. The source BasicIo object\n" + "This method is optimized to simply swap memory block if the source\n" + "object is another MemIo instance. The source BasicIo instance\n" "is invalidated by this operation and should not be used after this\n" "method returns. This method exists primarily to be used with\n" "the BasicIo::temporary() method.\n" "\n" - "Notes: If the caller doesn't have permissions to write to the file,\n" - " an exception is raised and *src* is deleted.\n" - "\n" ":type src: :py:class:`BasicIo`\n" ":param src: Reference to another BasicIo instance. The entire contents\n" " of src are transferred to this object. The *src* object is\n" " invalidated by the method.\n" ":raises: Error In case of failure\n" "" }, - { "seek", _wrap_FileIo_seek, METH_VARARGS, "" }, - { "mmap", _wrap_FileIo_mmap, METH_VARARGS, "\n" - "Map the file into the process's address space. The file must be\n" - " open before mmap() is called. If the mapped area is writeable,\n" - " changes may not be written back to the underlying file until\n" - " munmap() is called. The pointer is valid only as long as the\n" - " FileIo object exists.\n" - ":type isWriteable: bool, optional\n" - ":param isWriteable: Set to true if the mapped area should be writeable\n" - " (default is false).\n" - ":rtype: memoryview\n" - ":return: A pointer to the mapped area.\n" - ":raises: Error In case of failure.\n" - "" }, - { "munmap", _wrap_FileIo_munmap, METH_VARARGS, "\n" - "Remove a mapping established with mmap(). If the mapped area is\n" - " writeable, this ensures that changes are written back to the\n" - " underlying file.\n" - ":rtype: int\n" - ":return: 0 if successful;\n" - "\n" - " Nonzero if failure;\n" + { "seek", _wrap_MemIo_seek, METH_VARARGS, "" }, + { "mmap", _wrap_MemIo_mmap, METH_VARARGS, "\n" + "Allow direct access to the underlying data buffer. The buffer\n" + " is not protected against write access in any way, the argument\n" + " is ignored.\n" + "Notes: The application must ensure that the memory pointed to by the\n" + " returned pointer remains valid and allocated as long as the\n" + " MemIo object exists.\n" "" }, - { "setPath", _wrap_FileIo_setPath, METH_VARARGS, " close the file source and set a new path." }, - { "tell", _wrap_FileIo_tell, METH_VARARGS, "\n" - "Get the current file position.\n" + { "munmap", _wrap_MemIo_munmap, METH_VARARGS, "" }, + { "tell", _wrap_MemIo_tell, METH_VARARGS, "\n" + "Get the current IO position.\n" ":rtype: int\n" - ":return: Offset from the start of the file\n" + ":return: Offset from the start of the memory block\n" "" }, - { "size", _wrap_FileIo_size, METH_VARARGS, "\n" - "Flush any buffered writes and get the current file size\n" - " in bytes.\n" + { "size", _wrap_MemIo_size, METH_VARARGS, "\n" + "Get the current memory buffer size in bytes.\n" ":rtype: int\n" - ":return: Size of the file in bytes;\n" + ":return: Size of the in memory data in bytes;\n" "\n" " -1 if failure;\n" "" }, - { "isopen", _wrap_FileIo_isopen, METH_VARARGS, " Returns true if the file is open, otherwise false." }, - { "error", _wrap_FileIo_error, METH_VARARGS, " Returns 0 if the file is in a valid state, otherwise nonzero." }, - { "eof", _wrap_FileIo_eof, METH_VARARGS, " Returns true if the file position has reached the end, otherwise false." }, - { "path", _wrap_FileIo_path, METH_VARARGS, " Returns the path of the file" }, + { "isopen", _wrap_MemIo_isopen, METH_VARARGS, " Always returns true" }, + { "error", _wrap_MemIo_error, METH_VARARGS, " Always returns 0" }, + { "eof", _wrap_MemIo_eof, METH_VARARGS, " Returns true if the IO position has reached the end, otherwise false." }, + { "path", _wrap_MemIo_path, METH_VARARGS, " Returns a dummy path, indicating that memory access is used" }, { NULL, NULL, 0, NULL } /* Sentinel */ }; -static PyHeapTypeObject SwigPyBuiltin__Exiv2__FileIo_type = { +static PyHeapTypeObject SwigPyBuiltin__Exiv2__MemIo_type = { { #if PY_VERSION_HEX >= 0x03000000 PyVarObject_HEAD_INIT(NULL, 0) @@ -9479,10 +10191,10 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__FileIo_type = { PyObject_HEAD_INIT(NULL) 0, /* ob_size */ #endif - "exiv2.basicio.FileIo", /* tp_name */ + "exiv2.basicio.MemIo", /* tp_name */ sizeof(SwigPyObject), /* tp_basicsize */ 0, /* tp_itemsize */ - _wrap_delete_FileIo_destructor_closure, /* tp_dealloc */ + _wrap_delete_MemIo_destructor_closure, /* tp_dealloc */ #if PY_VERSION_HEX < 0x030800b4 (printfunc) 0, /* tp_print */ #else @@ -9496,39 +10208,47 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__FileIo_type = { (cmpfunc) 0, /* tp_compare */ #endif (reprfunc) 0, /* tp_repr */ - &SwigPyBuiltin__Exiv2__FileIo_type.as_number, /* tp_as_number */ - &SwigPyBuiltin__Exiv2__FileIo_type.as_sequence, /* tp_as_sequence */ - &SwigPyBuiltin__Exiv2__FileIo_type.as_mapping, /* tp_as_mapping */ + &SwigPyBuiltin__Exiv2__MemIo_type.as_number, /* tp_as_number */ + &SwigPyBuiltin__Exiv2__MemIo_type.as_sequence, /* tp_as_sequence */ + &SwigPyBuiltin__Exiv2__MemIo_type.as_mapping, /* tp_as_mapping */ SwigPyObject_hash, /* tp_hash */ (ternaryfunc) 0, /* tp_call */ (reprfunc) 0, /* tp_str */ (getattrofunc) 0, /* tp_getattro */ (setattrofunc) 0, /* tp_setattro */ - &SwigPyBuiltin__Exiv2__FileIo_type.as_buffer, /* tp_as_buffer */ + &SwigPyBuiltin__Exiv2__MemIo_type.as_buffer, /* tp_as_buffer */ #if PY_VERSION_HEX >= 0x03000000 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */ #else Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES, /* tp_flags */ #endif "\n" - "Provides binary file IO by implementing the BasicIo\n" - " interface.\n" + "Provides binary IO on blocks of memory by implementing the BasicIo\n" + " interface. A copy-on-write implementation ensures that the data passed\n" + " in is only copied when necessary, i.e., as soon as data is written to\n" + " the MemIo. The original data is only used for reading. If writes are\n" + " performed, the changed data can be retrieved using the read methods\n" + " (since the data used in construction is never modified).\n" + "\n" + "Notes: If read only usage of this class is common, it might be worth\n" + " creating a specialized readonly class or changing this one to\n" + " have a readonly mode.\n" "",/* tp_doc */ (traverseproc) 0, /* tp_traverse */ (inquiry) 0, /* tp_clear */ - SwigPyBuiltin__Exiv2__FileIo_richcompare, /* tp_richcompare */ + SwigPyBuiltin__Exiv2__MemIo_richcompare, /* tp_richcompare */ 0, /* tp_weaklistoffset */ (getiterfunc) 0, /* tp_iter */ (iternextfunc) 0, /* tp_iternext */ - SwigPyBuiltin__Exiv2__FileIo_methods, /* tp_methods */ + SwigPyBuiltin__Exiv2__MemIo_methods, /* tp_methods */ 0, /* tp_members */ - SwigPyBuiltin__Exiv2__FileIo_getset, /* tp_getset */ + SwigPyBuiltin__Exiv2__MemIo_getset, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ (descrgetfunc) 0, /* tp_descr_get */ (descrsetfunc) 0, /* tp_descr_set */ offsetof(SwigPyObject, dict), /* tp_dictoffset */ - _wrap_new_FileIo, /* tp_init */ + _wrap_new_MemIo, /* tp_init */ (allocfunc) 0, /* tp_alloc */ (newfunc) 0, /* tp_new */ (freefunc) 0, /* tp_free */ @@ -9633,7 +10353,7 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__FileIo_type = { (objobjargproc) 0, /* mp_ass_subscript */ }, { - _wrap_FileIo_size_lenfunc_closure, /* sq_length */ + _wrap_MemIo_size_lenfunc_closure, /* sq_length */ (binaryfunc) 0, /* sq_concat */ (ssizeargfunc) 0, /* sq_repeat */ (ssizeargfunc) 0, /* sq_item */ @@ -9659,8 +10379,8 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__FileIo_type = { (segcountproc) 0, /* bf_getsegcount */ (charbufferproc) 0, /* bf_getcharbuffer */ #endif - getbuffer_Exiv2_FileIo, /* bf_getbuffer */ - releasebuffer_Exiv2_FileIo, /* bf_releasebuffer */ + getbuffer_Exiv2_MemIo, /* bf_getbuffer */ + releasebuffer_Exiv2_MemIo, /* bf_releasebuffer */ }, (PyObject *) 0, /* ht_name */ (PyObject *) 0, /* ht_slots */ @@ -9682,31 +10402,16 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__FileIo_type = { #endif }; -SWIGINTERN SwigPyClientData SwigPyBuiltin__Exiv2__FileIo_clientdata = {0, 0, 0, 0, 0, 0, (PyTypeObject *)&SwigPyBuiltin__Exiv2__FileIo_type}; +SWIGINTERN SwigPyClientData SwigPyBuiltin__Exiv2__MemIo_clientdata = {0, 0, 0, 0, 0, 0, (PyTypeObject *)&SwigPyBuiltin__Exiv2__MemIo_type}; -static SwigPyGetSet MemIo___dict___getset = { SwigPyObject_get___dict__, 0 }; -SWIGINTERN PyGetSetDef SwigPyBuiltin__Exiv2__MemIo_getset[] = { - { (char *)"__dict__", SwigPyBuiltin_GetterClosure, 0, (char *)"\n" - "*Overload 1:*\n" - "Default constructor that results in an empty object\n" - "\n" - "|\n" - "\n" - "*Overload 2:*\n" - "\n" - " Constructor that accepts a block of memory. A copy-on-write\n" - " algorithm allows read operations directly from the original data\n" - " and will create a copy of the buffer on the first write operation.\n" - " :type data: :py:term:`bytes-like object`\n" - " :param data: Pointer to data. Data must be at least *size* bytes long\n" - " :type size: int\n" - " :param size: Number of bytes to copy.\n" - "", &MemIo___dict___getset }, +static SwigPyGetSet XPathIo___dict___getset = { SwigPyObject_get___dict__, 0 }; +SWIGINTERN PyGetSetDef SwigPyBuiltin__Exiv2__XPathIo_getset[] = { + { (char *)"__dict__", SwigPyBuiltin_GetterClosure, 0, (char *)" Default constructor that reads data from stdin/data uri path and writes them to the temp file.", &XPathIo___dict___getset }, { NULL, NULL, NULL, NULL, NULL } /* Sentinel */ }; SWIGINTERN PyObject * -SwigPyBuiltin__Exiv2__MemIo_richcompare(PyObject *self, PyObject *other, int op) { +SwigPyBuiltin__Exiv2__XPathIo_richcompare(PyObject *self, PyObject *other, int op) { PyObject *result = NULL; PyObject *tuple = PyTuple_New(1); assert(tuple); @@ -9724,148 +10429,23 @@ SwigPyBuiltin__Exiv2__MemIo_richcompare(PyObject *self, PyObject *other, int op) return result; } -SWIGINTERN PyMethodDef SwigPyBuiltin__Exiv2__MemIo_methods[] = { - { "open", _wrap_MemIo_open, METH_VARARGS, "\n" - "Memory IO is always open for reading and writing. This method\n" - " therefore only resets the IO position to the start.\n" - "\n" - ":rtype: int\n" - ":return: 0\n" - "" }, - { "close", _wrap_MemIo_close, METH_VARARGS, "\n" - "Does nothing on MemIo objects.\n" - ":rtype: int\n" - ":return: 0\n" - "" }, - { "write", _wrap_MemIo_write, METH_VARARGS, "\n" - "*Overload 1:*\n" - "\n" - "Write data to the memory block. If needed, the size of the\n" - " internal memory block is expanded. The IO position is advanced\n" - " by the number of bytes written.\n" - ":type data: :py:term:`bytes-like object`\n" - ":param data: Pointer to data. Data must be at least *wcount*\n" - " bytes long\n" - ":type wcount: int\n" - ":param wcount: Number of bytes to be written.\n" - ":rtype: int\n" - ":return: Number of bytes written to the memory block successfully;\n" - "\n" - " 0 if failure;\n" - "\n" - "|\n" - "\n" - "*Overload 2:*\n" - "\n" - "Write data that is read from another BasicIo instance to\n" - " the memory block. If needed, the size of the internal memory\n" - " block is expanded. The IO position is advanced by the number\n" - " of bytes written.\n" - ":type src: :py:class:`BasicIo`\n" - ":param src: Reference to another BasicIo instance. Reading start\n" - " at the source's current IO position\n" - ":rtype: int\n" - ":return: Number of bytes written to the memory block successfully;\n" - "\n" - " 0 if failure;\n" - "" }, - { "putb", _wrap_MemIo_putb, METH_VARARGS, "\n" - "Write one byte to the memory block. The IO position is\n" - " advanced by one byte.\n" - ":type data: int\n" - ":param data: The single byte to be written.\n" - ":rtype: int\n" - ":return: The value of the byte written if successful;\n" - "\n" - " EOF if failure;\n" - "" }, - { "read", _wrap_MemIo_read, METH_VARARGS, "\n" - "*Overload 1:*\n" - "\n" - "Read data from the memory block. Reading starts at the current\n" - " IO position and the position is advanced by the number of\n" - " bytes read.\n" - ":type rcount: int\n" - ":param rcount: Maximum number of bytes to read. Fewer bytes may be\n" - " read if *rcount* bytes are not available.\n" - ":rtype: :py:class:`DataBuf`\n" - ":return: DataBuf instance containing the bytes read. Use the\n" - " DataBuf::size_ member to find the number of bytes read.\n" - " DataBuf::size_ will be 0 on failure.\n" - "\n" - "|\n" - "\n" - "*Overload 2:*\n" - "\n" - "Read data from the memory block. Reading starts at the current\n" - " IO position and the position is advanced by the number of\n" - " bytes read.\n" - ":type buf: writeable :py:term:`bytes-like object`\n" - ":param buf: Pointer to a block of memory into which the read data\n" - " is stored. The memory block must be at least *rcount* bytes\n" - " long.\n" - ":type rcount: int\n" - ":param rcount: Maximum number of bytes to read. Fewer bytes may be\n" - " read if *rcount* bytes are not available.\n" - ":rtype: int\n" - ":return: Number of bytes read from the memory block successfully;\n" - "\n" - " 0 if failure;\n" - "" }, - { "getb", _wrap_MemIo_getb, METH_VARARGS, "\n" - "Read one byte from the memory block. The IO position is\n" - " advanced by one byte.\n" - ":rtype: int\n" - ":return: The byte read from the memory block if successful;\n" - "\n" - " EOF if failure;\n" - "" }, - { "transfer", _wrap_MemIo_transfer, METH_VARARGS, "\n" - "Clear the memory block and then transfer data from\n" - " the *src* BasicIo object into a new block of memory.\n" - "\n" - "This method is optimized to simply swap memory block if the source\n" - "object is another MemIo instance. The source BasicIo instance\n" - "is invalidated by this operation and should not be used after this\n" - "method returns. This method exists primarily to be used with\n" - "the BasicIo::temporary() method.\n" - "\n" - ":type src: :py:class:`BasicIo`\n" - ":param src: Reference to another BasicIo instance. The entire contents\n" - " of src are transferred to this object. The *src* object is\n" - " invalidated by the method.\n" - ":raises: Error In case of failure\n" - "" }, - { "seek", _wrap_MemIo_seek, METH_VARARGS, "" }, - { "mmap", _wrap_MemIo_mmap, METH_VARARGS, "\n" - "Allow direct access to the underlying data buffer. The buffer\n" - " is not protected against write access in any way, the argument\n" - " is ignored.\n" - "Notes: The application must ensure that the memory pointed to by the\n" - " returned pointer remains valid and allocated as long as the\n" - " MemIo object exists.\n" - "" }, - { "munmap", _wrap_MemIo_munmap, METH_VARARGS, "" }, - { "tell", _wrap_MemIo_tell, METH_VARARGS, "\n" - "Get the current IO position.\n" - ":rtype: int\n" - ":return: Offset from the start of the memory block\n" +SWIGINTERN PyMethodDef SwigPyBuiltin__Exiv2__XPathIo_methods[] = { + { "transfer", _wrap_XPathIo_transfer, METH_VARARGS, "\n" + "Change the name of the temp file and make it untemporary before\n" + " calling the method of superclass FileIo::transfer.\n" "" }, - { "size", _wrap_MemIo_size, METH_VARARGS, "\n" - "Get the current memory buffer size in bytes.\n" - ":rtype: int\n" - ":return: Size of the in memory data in bytes;\n" - "\n" - " -1 if failure;\n" + { "writeDataToFile", (PyCFunction)(void(*)(void))_wrap_XPathIo_writeDataToFile, METH_STATIC|METH_VARARGS, "\n" + "Read the data from stdin/data uri path and write them to the file.\n" + ":type orgPath: str\n" + ":param orgPath: It equals \"-\" if the input data's from stdin. Otherwise, it's data uri path.\n" + ":rtype: str\n" + ":return: the name of the new file.\n" + ":raises: Error if it fails.\n" "" }, - { "isopen", _wrap_MemIo_isopen, METH_VARARGS, " Always returns true" }, - { "error", _wrap_MemIo_error, METH_VARARGS, " Always returns 0" }, - { "eof", _wrap_MemIo_eof, METH_VARARGS, " Returns true if the IO position has reached the end, otherwise false." }, - { "path", _wrap_MemIo_path, METH_VARARGS, " Returns a dummy path, indicating that memory access is used" }, { NULL, NULL, 0, NULL } /* Sentinel */ }; -static PyHeapTypeObject SwigPyBuiltin__Exiv2__MemIo_type = { +static PyHeapTypeObject SwigPyBuiltin__Exiv2__XPathIo_type = { { #if PY_VERSION_HEX >= 0x03000000 PyVarObject_HEAD_INIT(NULL, 0) @@ -9873,10 +10453,10 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__MemIo_type = { PyObject_HEAD_INIT(NULL) 0, /* ob_size */ #endif - "exiv2.basicio.MemIo", /* tp_name */ + "exiv2.basicio.XPathIo", /* tp_name */ sizeof(SwigPyObject), /* tp_basicsize */ 0, /* tp_itemsize */ - _wrap_delete_MemIo_destructor_closure, /* tp_dealloc */ + _wrap_delete_XPathIo_destructor_closure, /* tp_dealloc */ #if PY_VERSION_HEX < 0x030800b4 (printfunc) 0, /* tp_print */ #else @@ -9890,47 +10470,36 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__MemIo_type = { (cmpfunc) 0, /* tp_compare */ #endif (reprfunc) 0, /* tp_repr */ - &SwigPyBuiltin__Exiv2__MemIo_type.as_number, /* tp_as_number */ - &SwigPyBuiltin__Exiv2__MemIo_type.as_sequence, /* tp_as_sequence */ - &SwigPyBuiltin__Exiv2__MemIo_type.as_mapping, /* tp_as_mapping */ + &SwigPyBuiltin__Exiv2__XPathIo_type.as_number, /* tp_as_number */ + &SwigPyBuiltin__Exiv2__XPathIo_type.as_sequence, /* tp_as_sequence */ + &SwigPyBuiltin__Exiv2__XPathIo_type.as_mapping, /* tp_as_mapping */ SwigPyObject_hash, /* tp_hash */ (ternaryfunc) 0, /* tp_call */ (reprfunc) 0, /* tp_str */ (getattrofunc) 0, /* tp_getattro */ (setattrofunc) 0, /* tp_setattro */ - &SwigPyBuiltin__Exiv2__MemIo_type.as_buffer, /* tp_as_buffer */ + &SwigPyBuiltin__Exiv2__XPathIo_type.as_buffer, /* tp_as_buffer */ #if PY_VERSION_HEX >= 0x03000000 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */ #else Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES, /* tp_flags */ #endif - "\n" - "Provides binary IO on blocks of memory by implementing the BasicIo\n" - " interface. A copy-on-write implementation ensures that the data passed\n" - " in is only copied when necessary, i.e., as soon as data is written to\n" - " the MemIo. The original data is only used for reading. If writes are\n" - " performed, the changed data can be retrieved using the read methods\n" - " (since the data used in construction is never modified).\n" - "\n" - "Notes: If read only usage of this class is common, it might be worth\n" - " creating a specialized readonly class or changing this one to\n" - " have a readonly mode.\n" - "",/* tp_doc */ + " Provides binary IO for the data from stdin and data uri path.",/* tp_doc */ (traverseproc) 0, /* tp_traverse */ (inquiry) 0, /* tp_clear */ - SwigPyBuiltin__Exiv2__MemIo_richcompare, /* tp_richcompare */ + SwigPyBuiltin__Exiv2__XPathIo_richcompare,/* tp_richcompare */ 0, /* tp_weaklistoffset */ (getiterfunc) 0, /* tp_iter */ (iternextfunc) 0, /* tp_iternext */ - SwigPyBuiltin__Exiv2__MemIo_methods, /* tp_methods */ + SwigPyBuiltin__Exiv2__XPathIo_methods, /* tp_methods */ 0, /* tp_members */ - SwigPyBuiltin__Exiv2__MemIo_getset, /* tp_getset */ + SwigPyBuiltin__Exiv2__XPathIo_getset, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ (descrgetfunc) 0, /* tp_descr_get */ (descrsetfunc) 0, /* tp_descr_set */ offsetof(SwigPyObject, dict), /* tp_dictoffset */ - _wrap_new_MemIo, /* tp_init */ + _wrap_new_XPathIo, /* tp_init */ (allocfunc) 0, /* tp_alloc */ (newfunc) 0, /* tp_new */ (freefunc) 0, /* tp_free */ @@ -10035,7 +10604,7 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__MemIo_type = { (objobjargproc) 0, /* mp_ass_subscript */ }, { - _wrap_MemIo_size_lenfunc_closure, /* sq_length */ + (lenfunc) 0, /* sq_length */ (binaryfunc) 0, /* sq_concat */ (ssizeargfunc) 0, /* sq_repeat */ (ssizeargfunc) 0, /* sq_item */ @@ -10061,8 +10630,8 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__MemIo_type = { (segcountproc) 0, /* bf_getsegcount */ (charbufferproc) 0, /* bf_getcharbuffer */ #endif - getbuffer_Exiv2_MemIo, /* bf_getbuffer */ - releasebuffer_Exiv2_MemIo, /* bf_releasebuffer */ + (getbufferproc) 0, /* bf_getbuffer */ + (releasebufferproc) 0, /* bf_releasebuffer */ }, (PyObject *) 0, /* ht_name */ (PyObject *) 0, /* ht_slots */ @@ -10084,16 +10653,16 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__MemIo_type = { #endif }; -SWIGINTERN SwigPyClientData SwigPyBuiltin__Exiv2__MemIo_clientdata = {0, 0, 0, 0, 0, 0, (PyTypeObject *)&SwigPyBuiltin__Exiv2__MemIo_type}; +SWIGINTERN SwigPyClientData SwigPyBuiltin__Exiv2__XPathIo_clientdata = {0, 0, 0, 0, 0, 0, (PyTypeObject *)&SwigPyBuiltin__Exiv2__XPathIo_type}; -static SwigPyGetSet XPathIo___dict___getset = { SwigPyObject_get___dict__, 0 }; -SWIGINTERN PyGetSetDef SwigPyBuiltin__Exiv2__XPathIo_getset[] = { - { (char *)"__dict__", SwigPyBuiltin_GetterClosure, 0, (char *)" Default constructor that reads data from stdin/data uri path and writes them to the temp file.", &XPathIo___dict___getset }, +static SwigPyGetSet RemoteIo___dict___getset = { SwigPyObject_get___dict__, 0 }; +SWIGINTERN PyGetSetDef SwigPyBuiltin__Exiv2__RemoteIo_getset[] = { + { (char *)"__dict__", SwigPyBuiltin_GetterClosure, 0, (char *)" Destructor. Releases all managed memory.", &RemoteIo___dict___getset }, { NULL, NULL, NULL, NULL, NULL } /* Sentinel */ }; SWIGINTERN PyObject * -SwigPyBuiltin__Exiv2__XPathIo_richcompare(PyObject *self, PyObject *other, int op) { +SwigPyBuiltin__Exiv2__RemoteIo_richcompare(PyObject *self, PyObject *other, int op) { PyObject *result = NULL; PyObject *tuple = PyTuple_New(1); assert(tuple); @@ -10111,23 +10680,150 @@ SwigPyBuiltin__Exiv2__XPathIo_richcompare(PyObject *self, PyObject *other, int o return result; } -SWIGINTERN PyMethodDef SwigPyBuiltin__Exiv2__XPathIo_methods[] = { - { "transfer", _wrap_XPathIo_transfer, METH_VARARGS, "\n" - "Change the name of the temp file and make it untemporary before\n" - " calling the method of superclass FileIo::transfer.\n" +SWIGINTERN PyMethodDef SwigPyBuiltin__Exiv2__RemoteIo_methods[] = { + { "open", _wrap_RemoteIo_open, METH_VARARGS, "\n" + "Connect to the remote server, get the size of the remote file and\n" + " allocate the array of blocksMap.\n" + "\n" + " If the blocksMap is already allocated (this method has been called before),\n" + " it just reset IO position to the start and does not flush the old data.\n" + ":rtype: int\n" + ":return: 0 if successful;\n" + "\n" + " Nonzero if failure.\n" "" }, - { "writeDataToFile", (PyCFunction)(void(*)(void))_wrap_XPathIo_writeDataToFile, METH_STATIC|METH_VARARGS, "\n" - "Read the data from stdin/data uri path and write them to the file.\n" - ":type orgPath: str\n" - ":param orgPath: It equals \"-\" if the input data's from stdin. Otherwise, it's data uri path.\n" - ":rtype: str\n" - ":return: the name of the new file.\n" - ":raises: Error if it fails.\n" + { "close", _wrap_RemoteIo_close, METH_VARARGS, "\n" + "Reset the IO position to the start. It does not release the data.\n" + ":rtype: int\n" + ":return: 0 if successful;\n" + "\n" + " Nonzero if failure.\n" + "" }, + { "write", _wrap_RemoteIo_write, METH_VARARGS, "\n" + "*Overload 1:*\n" + "\n" + "Not support this method.\n" + ":rtype: int\n" + ":return: 0 means failure\n" + "\n" + "|\n" + "\n" + "*Overload 2:*\n" + "\n" + "Write data that is read from another BasicIo instance to the remote file.\n" + "\n" + "The write access is done in an efficient way. It only sends the range of different\n" + "bytes between the current data and BasicIo instance to the remote machine.\n" + "\n" + ":type src: :py:class:`BasicIo`\n" + ":param src: Reference to another BasicIo instance. Reading start\n" + " at the source's current IO position\n" + ":rtype: int\n" + ":return: The size of BasicIo instance;\n" + "\n" + " 0 if failure;\n" + ":raises: Error In case of failure\n" + "\n" + "Notes: The write access is only supported by http, https, ssh.\n" + "" }, + { "putb", _wrap_RemoteIo_putb, METH_VARARGS, "\n" + "Not support\n" + ":rtype: int\n" + ":return: 0 means failure\n" + "" }, + { "read", _wrap_RemoteIo_read, METH_VARARGS, "\n" + "*Overload 1:*\n" + "\n" + "Read data from the memory blocks. Reading starts at the current\n" + " IO position and the position is advanced by the number of\n" + " bytes read.\n" + " If the memory blocks are not populated (False), it will connect to server\n" + " and populate the data to memory blocks.\n" + ":type rcount: int\n" + ":param rcount: Maximum number of bytes to read. Fewer bytes may be\n" + " read if *rcount* bytes are not available.\n" + ":rtype: :py:class:`DataBuf`\n" + ":return: DataBuf instance containing the bytes read. Use the\n" + " DataBuf::size_ member to find the number of bytes read.\n" + " DataBuf::size_ will be 0 on failure.\n" + "\n" + "|\n" + "\n" + "*Overload 2:*\n" + "\n" + "Read data from the memory blocks. Reading starts at the current\n" + " IO position and the position is advanced by the number of\n" + " bytes read.\n" + " If the memory blocks are not populated (!= bMemory), it will connect to server\n" + " and populate the data to memory blocks.\n" + ":type buf: writeable :py:term:`bytes-like object`\n" + ":param buf: Pointer to a block of memory into which the read data\n" + " is stored. The memory block must be at least *rcount* bytes\n" + " long.\n" + ":type rcount: int\n" + ":param rcount: Maximum number of bytes to read. Fewer bytes may be\n" + " read if *rcount* bytes are not available.\n" + ":rtype: int\n" + ":return: Number of bytes read from the memory block successfully;\n" + "\n" + " 0 if failure;\n" + "" }, + { "getb", _wrap_RemoteIo_getb, METH_VARARGS, "\n" + "Read one byte from the memory blocks. The IO position is\n" + " advanced by one byte.\n" + " If the memory block is not populated (!= bMemory), it will connect to server\n" + " and populate the data to the memory block.\n" + ":rtype: int\n" + ":return: The byte read from the memory block if successful;\n" + "\n" + " EOF if failure;\n" + "" }, + { "transfer", _wrap_RemoteIo_transfer, METH_VARARGS, "\n" + "Remove the contents of the file and then transfer data from\n" + " the *src* BasicIo object into the empty file.\n" + "\n" + "The write access is done in an efficient way. It only sends the range of different\n" + "bytes between the current data and BasicIo instance to the remote machine.\n" + "\n" + ":type src: :py:class:`BasicIo`\n" + ":param src: Reference to another BasicIo instance. The entire contents\n" + " of src are transferred to this object. The *src* object is\n" + " invalidated by the method.\n" + ":raises: Error In case of failure\n" + "\n" + "Notes: The write access is only supported by http, https, ssh.\n" + "" }, + { "seek", _wrap_RemoteIo_seek, METH_VARARGS, "" }, + { "mmap", _wrap_RemoteIo_mmap, METH_VARARGS, "\n" + "Not support\n" + ":rtype: memoryview\n" + ":return: NULL\n" + "" }, + { "munmap", _wrap_RemoteIo_munmap, METH_VARARGS, "\n" + "Not support\n" + ":rtype: int\n" + ":return: 0\n" + "" }, + { "tell", _wrap_RemoteIo_tell, METH_VARARGS, "\n" + "Get the current IO position.\n" + ":rtype: int\n" + ":return: Offset from the start of the memory block\n" + "" }, + { "size", _wrap_RemoteIo_size, METH_VARARGS, "\n" + "Get the current memory buffer size in bytes.\n" + ":rtype: int\n" + ":return: Size of the in memory data in bytes;\n" + "\n" + " -1 if failure;\n" "" }, + { "isopen", _wrap_RemoteIo_isopen, METH_VARARGS, " Returns true if the memory area is allocated." }, + { "error", _wrap_RemoteIo_error, METH_VARARGS, " Always returns 0" }, + { "eof", _wrap_RemoteIo_eof, METH_VARARGS, " Returns true if the IO position has reached the end, otherwise false." }, + { "path", _wrap_RemoteIo_path, METH_VARARGS, " Returns the URL of the file." }, { NULL, NULL, 0, NULL } /* Sentinel */ }; -static PyHeapTypeObject SwigPyBuiltin__Exiv2__XPathIo_type = { +static PyHeapTypeObject SwigPyBuiltin__Exiv2__RemoteIo_type = { { #if PY_VERSION_HEX >= 0x03000000 PyVarObject_HEAD_INIT(NULL, 0) @@ -10135,10 +10831,10 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__XPathIo_type = { PyObject_HEAD_INIT(NULL) 0, /* ob_size */ #endif - "exiv2.basicio.XPathIo", /* tp_name */ + "exiv2.basicio.RemoteIo", /* tp_name */ sizeof(SwigPyObject), /* tp_basicsize */ 0, /* tp_itemsize */ - _wrap_delete_XPathIo_destructor_closure, /* tp_dealloc */ + _wrap_delete_RemoteIo_destructor_closure, /* tp_dealloc */ #if PY_VERSION_HEX < 0x030800b4 (printfunc) 0, /* tp_print */ #else @@ -10152,36 +10848,40 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__XPathIo_type = { (cmpfunc) 0, /* tp_compare */ #endif (reprfunc) 0, /* tp_repr */ - &SwigPyBuiltin__Exiv2__XPathIo_type.as_number, /* tp_as_number */ - &SwigPyBuiltin__Exiv2__XPathIo_type.as_sequence, /* tp_as_sequence */ - &SwigPyBuiltin__Exiv2__XPathIo_type.as_mapping, /* tp_as_mapping */ + &SwigPyBuiltin__Exiv2__RemoteIo_type.as_number, /* tp_as_number */ + &SwigPyBuiltin__Exiv2__RemoteIo_type.as_sequence, /* tp_as_sequence */ + &SwigPyBuiltin__Exiv2__RemoteIo_type.as_mapping, /* tp_as_mapping */ SwigPyObject_hash, /* tp_hash */ (ternaryfunc) 0, /* tp_call */ (reprfunc) 0, /* tp_str */ (getattrofunc) 0, /* tp_getattro */ (setattrofunc) 0, /* tp_setattro */ - &SwigPyBuiltin__Exiv2__XPathIo_type.as_buffer, /* tp_as_buffer */ + &SwigPyBuiltin__Exiv2__RemoteIo_type.as_buffer, /* tp_as_buffer */ #if PY_VERSION_HEX >= 0x03000000 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */ #else Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES, /* tp_flags */ #endif - " Provides binary IO for the data from stdin and data uri path.",/* tp_doc */ + "\n" + "Provides remote binary file IO by implementing the BasicIo interface. This is an\n" + " abstract class. The logics for remote access are implemented in HttpIo, CurlIo, SshIo which\n" + " are the derived classes of RemoteIo.\n" + "",/* tp_doc */ (traverseproc) 0, /* tp_traverse */ (inquiry) 0, /* tp_clear */ - SwigPyBuiltin__Exiv2__XPathIo_richcompare,/* tp_richcompare */ + SwigPyBuiltin__Exiv2__RemoteIo_richcompare, /* tp_richcompare */ 0, /* tp_weaklistoffset */ (getiterfunc) 0, /* tp_iter */ (iternextfunc) 0, /* tp_iternext */ - SwigPyBuiltin__Exiv2__XPathIo_methods, /* tp_methods */ + SwigPyBuiltin__Exiv2__RemoteIo_methods, /* tp_methods */ 0, /* tp_members */ - SwigPyBuiltin__Exiv2__XPathIo_getset, /* tp_getset */ + SwigPyBuiltin__Exiv2__RemoteIo_getset, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ (descrgetfunc) 0, /* tp_descr_get */ (descrsetfunc) 0, /* tp_descr_set */ offsetof(SwigPyObject, dict), /* tp_dictoffset */ - _wrap_new_XPathIo, /* tp_init */ + _wrap_new_RemoteIo, /* tp_init */ (allocfunc) 0, /* tp_alloc */ (newfunc) 0, /* tp_new */ (freefunc) 0, /* tp_free */ @@ -10286,7 +10986,7 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__XPathIo_type = { (objobjargproc) 0, /* mp_ass_subscript */ }, { - (lenfunc) 0, /* sq_length */ + _wrap_RemoteIo_size_lenfunc_closure, /* sq_length */ (binaryfunc) 0, /* sq_concat */ (ssizeargfunc) 0, /* sq_repeat */ (ssizeargfunc) 0, /* sq_item */ @@ -10312,8 +11012,8 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__XPathIo_type = { (segcountproc) 0, /* bf_getsegcount */ (charbufferproc) 0, /* bf_getcharbuffer */ #endif - (getbufferproc) 0, /* bf_getbuffer */ - (releasebufferproc) 0, /* bf_releasebuffer */ + getbuffer_Exiv2_RemoteIo, /* bf_getbuffer */ + releasebuffer_Exiv2_RemoteIo, /* bf_releasebuffer */ }, (PyObject *) 0, /* ht_name */ (PyObject *) 0, /* ht_slots */ @@ -10335,16 +11035,26 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__XPathIo_type = { #endif }; -SWIGINTERN SwigPyClientData SwigPyBuiltin__Exiv2__XPathIo_clientdata = {0, 0, 0, 0, 0, 0, (PyTypeObject *)&SwigPyBuiltin__Exiv2__XPathIo_type}; +SWIGINTERN SwigPyClientData SwigPyBuiltin__Exiv2__RemoteIo_clientdata = {0, 0, 0, 0, 0, 0, (PyTypeObject *)&SwigPyBuiltin__Exiv2__RemoteIo_type}; -static SwigPyGetSet RemoteIo___dict___getset = { SwigPyObject_get___dict__, 0 }; -SWIGINTERN PyGetSetDef SwigPyBuiltin__Exiv2__RemoteIo_getset[] = { - { (char *)"__dict__", SwigPyBuiltin_GetterClosure, 0, (char *)" Destructor. Releases all managed memory.", &RemoteIo___dict___getset }, +static SwigPyGetSet HttpIo___dict___getset = { SwigPyObject_get___dict__, 0 }; +SWIGINTERN PyGetSetDef SwigPyBuiltin__Exiv2__HttpIo_getset[] = { + { (char *)"__dict__", SwigPyBuiltin_GetterClosure, 0, (char *)"\n" + "Constructor that accepts the http URL on which IO will be\n" + " performed. The constructor does not open the file, and\n" + " therefore never fails.\n" + ":type url: str\n" + ":param url: The full path of url\n" + ":type blockSize: int, optional\n" + ":param blockSize: the size of the memory block. The file content is\n" + " divided into the memory blocks. These blocks are populated\n" + " on demand from the server, so it avoids copying the complete file.\n" + "", &HttpIo___dict___getset }, { NULL, NULL, NULL, NULL, NULL } /* Sentinel */ }; SWIGINTERN PyObject * -SwigPyBuiltin__Exiv2__RemoteIo_richcompare(PyObject *self, PyObject *other, int op) { +SwigPyBuiltin__Exiv2__HttpIo_richcompare(PyObject *self, PyObject *other, int op) { PyObject *result = NULL; PyObject *tuple = PyTuple_New(1); assert(tuple); @@ -10362,150 +11072,11 @@ SwigPyBuiltin__Exiv2__RemoteIo_richcompare(PyObject *self, PyObject *other, int return result; } -SWIGINTERN PyMethodDef SwigPyBuiltin__Exiv2__RemoteIo_methods[] = { - { "open", _wrap_RemoteIo_open, METH_VARARGS, "\n" - "Connect to the remote server, get the size of the remote file and\n" - " allocate the array of blocksMap.\n" - "\n" - " If the blocksMap is already allocated (this method has been called before),\n" - " it just reset IO position to the start and does not flush the old data.\n" - ":rtype: int\n" - ":return: 0 if successful;\n" - "\n" - " Nonzero if failure.\n" - "" }, - { "close", _wrap_RemoteIo_close, METH_VARARGS, "\n" - "Reset the IO position to the start. It does not release the data.\n" - ":rtype: int\n" - ":return: 0 if successful;\n" - "\n" - " Nonzero if failure.\n" - "" }, - { "write", _wrap_RemoteIo_write, METH_VARARGS, "\n" - "*Overload 1:*\n" - "\n" - "Not support this method.\n" - ":rtype: int\n" - ":return: 0 means failure\n" - "\n" - "|\n" - "\n" - "*Overload 2:*\n" - "\n" - "Write data that is read from another BasicIo instance to the remote file.\n" - "\n" - "The write access is done in an efficient way. It only sends the range of different\n" - "bytes between the current data and BasicIo instance to the remote machine.\n" - "\n" - ":type src: :py:class:`BasicIo`\n" - ":param src: Reference to another BasicIo instance. Reading start\n" - " at the source's current IO position\n" - ":rtype: int\n" - ":return: The size of BasicIo instance;\n" - "\n" - " 0 if failure;\n" - ":raises: Error In case of failure\n" - "\n" - "Notes: The write access is only supported by http, https, ssh.\n" - "" }, - { "putb", _wrap_RemoteIo_putb, METH_VARARGS, "\n" - "Not support\n" - ":rtype: int\n" - ":return: 0 means failure\n" - "" }, - { "read", _wrap_RemoteIo_read, METH_VARARGS, "\n" - "*Overload 1:*\n" - "\n" - "Read data from the memory blocks. Reading starts at the current\n" - " IO position and the position is advanced by the number of\n" - " bytes read.\n" - " If the memory blocks are not populated (False), it will connect to server\n" - " and populate the data to memory blocks.\n" - ":type rcount: int\n" - ":param rcount: Maximum number of bytes to read. Fewer bytes may be\n" - " read if *rcount* bytes are not available.\n" - ":rtype: :py:class:`DataBuf`\n" - ":return: DataBuf instance containing the bytes read. Use the\n" - " DataBuf::size_ member to find the number of bytes read.\n" - " DataBuf::size_ will be 0 on failure.\n" - "\n" - "|\n" - "\n" - "*Overload 2:*\n" - "\n" - "Read data from the memory blocks. Reading starts at the current\n" - " IO position and the position is advanced by the number of\n" - " bytes read.\n" - " If the memory blocks are not populated (!= bMemory), it will connect to server\n" - " and populate the data to memory blocks.\n" - ":type buf: writeable :py:term:`bytes-like object`\n" - ":param buf: Pointer to a block of memory into which the read data\n" - " is stored. The memory block must be at least *rcount* bytes\n" - " long.\n" - ":type rcount: int\n" - ":param rcount: Maximum number of bytes to read. Fewer bytes may be\n" - " read if *rcount* bytes are not available.\n" - ":rtype: int\n" - ":return: Number of bytes read from the memory block successfully;\n" - "\n" - " 0 if failure;\n" - "" }, - { "getb", _wrap_RemoteIo_getb, METH_VARARGS, "\n" - "Read one byte from the memory blocks. The IO position is\n" - " advanced by one byte.\n" - " If the memory block is not populated (!= bMemory), it will connect to server\n" - " and populate the data to the memory block.\n" - ":rtype: int\n" - ":return: The byte read from the memory block if successful;\n" - "\n" - " EOF if failure;\n" - "" }, - { "transfer", _wrap_RemoteIo_transfer, METH_VARARGS, "\n" - "Remove the contents of the file and then transfer data from\n" - " the *src* BasicIo object into the empty file.\n" - "\n" - "The write access is done in an efficient way. It only sends the range of different\n" - "bytes between the current data and BasicIo instance to the remote machine.\n" - "\n" - ":type src: :py:class:`BasicIo`\n" - ":param src: Reference to another BasicIo instance. The entire contents\n" - " of src are transferred to this object. The *src* object is\n" - " invalidated by the method.\n" - ":raises: Error In case of failure\n" - "\n" - "Notes: The write access is only supported by http, https, ssh.\n" - "" }, - { "seek", _wrap_RemoteIo_seek, METH_VARARGS, "" }, - { "mmap", _wrap_RemoteIo_mmap, METH_VARARGS, "\n" - "Not support\n" - ":rtype: memoryview\n" - ":return: NULL\n" - "" }, - { "munmap", _wrap_RemoteIo_munmap, METH_VARARGS, "\n" - "Not support\n" - ":rtype: int\n" - ":return: 0\n" - "" }, - { "tell", _wrap_RemoteIo_tell, METH_VARARGS, "\n" - "Get the current IO position.\n" - ":rtype: int\n" - ":return: Offset from the start of the memory block\n" - "" }, - { "size", _wrap_RemoteIo_size, METH_VARARGS, "\n" - "Get the current memory buffer size in bytes.\n" - ":rtype: int\n" - ":return: Size of the in memory data in bytes;\n" - "\n" - " -1 if failure;\n" - "" }, - { "isopen", _wrap_RemoteIo_isopen, METH_VARARGS, " Returns true if the memory area is allocated." }, - { "error", _wrap_RemoteIo_error, METH_VARARGS, " Always returns 0" }, - { "eof", _wrap_RemoteIo_eof, METH_VARARGS, " Returns true if the IO position has reached the end, otherwise false." }, - { "path", _wrap_RemoteIo_path, METH_VARARGS, " Returns the URL of the file." }, +SWIGINTERN PyMethodDef SwigPyBuiltin__Exiv2__HttpIo_methods[] = { { NULL, NULL, 0, NULL } /* Sentinel */ }; -static PyHeapTypeObject SwigPyBuiltin__Exiv2__RemoteIo_type = { +static PyHeapTypeObject SwigPyBuiltin__Exiv2__HttpIo_type = { { #if PY_VERSION_HEX >= 0x03000000 PyVarObject_HEAD_INIT(NULL, 0) @@ -10513,10 +11084,10 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__RemoteIo_type = { PyObject_HEAD_INIT(NULL) 0, /* ob_size */ #endif - "exiv2.basicio.RemoteIo", /* tp_name */ + "exiv2.basicio.HttpIo", /* tp_name */ sizeof(SwigPyObject), /* tp_basicsize */ 0, /* tp_itemsize */ - _wrap_delete_RemoteIo_destructor_closure, /* tp_dealloc */ + _wrap_delete_HttpIo_destructor_closure, /* tp_dealloc */ #if PY_VERSION_HEX < 0x030800b4 (printfunc) 0, /* tp_print */ #else @@ -10530,40 +11101,36 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__RemoteIo_type = { (cmpfunc) 0, /* tp_compare */ #endif (reprfunc) 0, /* tp_repr */ - &SwigPyBuiltin__Exiv2__RemoteIo_type.as_number, /* tp_as_number */ - &SwigPyBuiltin__Exiv2__RemoteIo_type.as_sequence, /* tp_as_sequence */ - &SwigPyBuiltin__Exiv2__RemoteIo_type.as_mapping, /* tp_as_mapping */ + &SwigPyBuiltin__Exiv2__HttpIo_type.as_number, /* tp_as_number */ + &SwigPyBuiltin__Exiv2__HttpIo_type.as_sequence, /* tp_as_sequence */ + &SwigPyBuiltin__Exiv2__HttpIo_type.as_mapping, /* tp_as_mapping */ SwigPyObject_hash, /* tp_hash */ (ternaryfunc) 0, /* tp_call */ (reprfunc) 0, /* tp_str */ (getattrofunc) 0, /* tp_getattro */ (setattrofunc) 0, /* tp_setattro */ - &SwigPyBuiltin__Exiv2__RemoteIo_type.as_buffer, /* tp_as_buffer */ + &SwigPyBuiltin__Exiv2__HttpIo_type.as_buffer, /* tp_as_buffer */ #if PY_VERSION_HEX >= 0x03000000 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */ #else Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES, /* tp_flags */ #endif - "\n" - "Provides remote binary file IO by implementing the BasicIo interface. This is an\n" - " abstract class. The logics for remote access are implemented in HttpIo, CurlIo, SshIo which\n" - " are the derived classes of RemoteIo.\n" - "",/* tp_doc */ + " Provides the http read/write access for the RemoteIo.", /* tp_doc */ (traverseproc) 0, /* tp_traverse */ (inquiry) 0, /* tp_clear */ - SwigPyBuiltin__Exiv2__RemoteIo_richcompare, /* tp_richcompare */ + SwigPyBuiltin__Exiv2__HttpIo_richcompare, /* tp_richcompare */ 0, /* tp_weaklistoffset */ (getiterfunc) 0, /* tp_iter */ (iternextfunc) 0, /* tp_iternext */ - SwigPyBuiltin__Exiv2__RemoteIo_methods, /* tp_methods */ + SwigPyBuiltin__Exiv2__HttpIo_methods, /* tp_methods */ 0, /* tp_members */ - SwigPyBuiltin__Exiv2__RemoteIo_getset, /* tp_getset */ + SwigPyBuiltin__Exiv2__HttpIo_getset, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ (descrgetfunc) 0, /* tp_descr_get */ (descrsetfunc) 0, /* tp_descr_set */ offsetof(SwigPyObject, dict), /* tp_dictoffset */ - _wrap_new_RemoteIo, /* tp_init */ + _wrap_new_HttpIo, /* tp_init */ (allocfunc) 0, /* tp_alloc */ (newfunc) 0, /* tp_new */ (freefunc) 0, /* tp_free */ @@ -10668,7 +11235,7 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__RemoteIo_type = { (objobjargproc) 0, /* mp_ass_subscript */ }, { - _wrap_RemoteIo_size_lenfunc_closure, /* sq_length */ + (lenfunc) 0, /* sq_length */ (binaryfunc) 0, /* sq_concat */ (ssizeargfunc) 0, /* sq_repeat */ (ssizeargfunc) 0, /* sq_item */ @@ -10694,8 +11261,8 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__RemoteIo_type = { (segcountproc) 0, /* bf_getsegcount */ (charbufferproc) 0, /* bf_getcharbuffer */ #endif - getbuffer_Exiv2_RemoteIo, /* bf_getbuffer */ - releasebuffer_Exiv2_RemoteIo, /* bf_releasebuffer */ + (getbufferproc) 0, /* bf_getbuffer */ + (releasebufferproc) 0, /* bf_releasebuffer */ }, (PyObject *) 0, /* ht_name */ (PyObject *) 0, /* ht_slots */ @@ -10717,26 +11284,26 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__RemoteIo_type = { #endif }; -SWIGINTERN SwigPyClientData SwigPyBuiltin__Exiv2__RemoteIo_clientdata = {0, 0, 0, 0, 0, 0, (PyTypeObject *)&SwigPyBuiltin__Exiv2__RemoteIo_type}; +SWIGINTERN SwigPyClientData SwigPyBuiltin__Exiv2__HttpIo_clientdata = {0, 0, 0, 0, 0, 0, (PyTypeObject *)&SwigPyBuiltin__Exiv2__HttpIo_type}; -static SwigPyGetSet HttpIo___dict___getset = { SwigPyObject_get___dict__, 0 }; -SWIGINTERN PyGetSetDef SwigPyBuiltin__Exiv2__HttpIo_getset[] = { +static SwigPyGetSet CurlIo___dict___getset = { SwigPyObject_get___dict__, 0 }; +SWIGINTERN PyGetSetDef SwigPyBuiltin__Exiv2__CurlIo_getset[] = { { (char *)"__dict__", SwigPyBuiltin_GetterClosure, 0, (char *)"\n" - "Constructor that accepts the http URL on which IO will be\n" - " performed. The constructor does not open the file, and\n" - " therefore never fails.\n" + "Constructor that accepts the URL on which IO will be\n" + " performed.\n" ":type url: str\n" ":param url: The full path of url\n" ":type blockSize: int, optional\n" ":param blockSize: the size of the memory block. The file content is\n" " divided into the memory blocks. These blocks are populated\n" " on demand from the server, so it avoids copying the complete file.\n" - "", &HttpIo___dict___getset }, + ":raises: Error if it is unable to init curl pointer.\n" + "", &CurlIo___dict___getset }, { NULL, NULL, NULL, NULL, NULL } /* Sentinel */ }; SWIGINTERN PyObject * -SwigPyBuiltin__Exiv2__HttpIo_richcompare(PyObject *self, PyObject *other, int op) { +SwigPyBuiltin__Exiv2__CurlIo_richcompare(PyObject *self, PyObject *other, int op) { PyObject *result = NULL; PyObject *tuple = PyTuple_New(1); assert(tuple); @@ -10754,11 +11321,26 @@ SwigPyBuiltin__Exiv2__HttpIo_richcompare(PyObject *self, PyObject *other, int op return result; } -SWIGINTERN PyMethodDef SwigPyBuiltin__Exiv2__HttpIo_methods[] = { +SWIGINTERN PyMethodDef SwigPyBuiltin__Exiv2__CurlIo_methods[] = { + { "write", _wrap_CurlIo_write, METH_VARARGS, "\n" + "*Overload 1:*\n" + "\n" + "Write access is only available for some protocols. This method\n" + " will call RemoteIo::write(const byte* data, long wcount) if the write\n" + " access is available for the protocol. Otherwise, it throws the Error.\n" + "\n" + "|\n" + "\n" + "*Overload 2:*\n" + "\n" + "Write access is only available for some protocols. This method\n" + " will call RemoteIo::write(BasicIo& src) if the write access is available\n" + " for the protocol. Otherwise, it throws the Error.\n" + "" }, { NULL, NULL, 0, NULL } /* Sentinel */ }; -static PyHeapTypeObject SwigPyBuiltin__Exiv2__HttpIo_type = { +static PyHeapTypeObject SwigPyBuiltin__Exiv2__CurlIo_type = { { #if PY_VERSION_HEX >= 0x03000000 PyVarObject_HEAD_INIT(NULL, 0) @@ -10766,10 +11348,10 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__HttpIo_type = { PyObject_HEAD_INIT(NULL) 0, /* ob_size */ #endif - "exiv2.basicio.HttpIo", /* tp_name */ + "exiv2.basicio.CurlIo", /* tp_name */ sizeof(SwigPyObject), /* tp_basicsize */ 0, /* tp_itemsize */ - _wrap_delete_HttpIo_destructor_closure, /* tp_dealloc */ + _wrap_delete_CurlIo_destructor_closure, /* tp_dealloc */ #if PY_VERSION_HEX < 0x030800b4 (printfunc) 0, /* tp_print */ #else @@ -10783,36 +11365,39 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__HttpIo_type = { (cmpfunc) 0, /* tp_compare */ #endif (reprfunc) 0, /* tp_repr */ - &SwigPyBuiltin__Exiv2__HttpIo_type.as_number, /* tp_as_number */ - &SwigPyBuiltin__Exiv2__HttpIo_type.as_sequence, /* tp_as_sequence */ - &SwigPyBuiltin__Exiv2__HttpIo_type.as_mapping, /* tp_as_mapping */ + &SwigPyBuiltin__Exiv2__CurlIo_type.as_number, /* tp_as_number */ + &SwigPyBuiltin__Exiv2__CurlIo_type.as_sequence, /* tp_as_sequence */ + &SwigPyBuiltin__Exiv2__CurlIo_type.as_mapping, /* tp_as_mapping */ SwigPyObject_hash, /* tp_hash */ (ternaryfunc) 0, /* tp_call */ (reprfunc) 0, /* tp_str */ (getattrofunc) 0, /* tp_getattro */ (setattrofunc) 0, /* tp_setattro */ - &SwigPyBuiltin__Exiv2__HttpIo_type.as_buffer, /* tp_as_buffer */ + &SwigPyBuiltin__Exiv2__CurlIo_type.as_buffer, /* tp_as_buffer */ #if PY_VERSION_HEX >= 0x03000000 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */ #else Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES, /* tp_flags */ #endif - " Provides the http read/write access for the RemoteIo.", /* tp_doc */ + "\n" + "Provides the http, https read/write access and ftp read access for the RemoteIo.\n" + " This class is based on libcurl.\n" + "",/* tp_doc */ (traverseproc) 0, /* tp_traverse */ (inquiry) 0, /* tp_clear */ - SwigPyBuiltin__Exiv2__HttpIo_richcompare, /* tp_richcompare */ + SwigPyBuiltin__Exiv2__CurlIo_richcompare, /* tp_richcompare */ 0, /* tp_weaklistoffset */ (getiterfunc) 0, /* tp_iter */ (iternextfunc) 0, /* tp_iternext */ - SwigPyBuiltin__Exiv2__HttpIo_methods, /* tp_methods */ + SwigPyBuiltin__Exiv2__CurlIo_methods, /* tp_methods */ 0, /* tp_members */ - SwigPyBuiltin__Exiv2__HttpIo_getset, /* tp_getset */ + SwigPyBuiltin__Exiv2__CurlIo_getset, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ (descrgetfunc) 0, /* tp_descr_get */ (descrsetfunc) 0, /* tp_descr_set */ offsetof(SwigPyObject, dict), /* tp_dictoffset */ - _wrap_new_HttpIo, /* tp_init */ + _wrap_new_CurlIo, /* tp_init */ (allocfunc) 0, /* tp_alloc */ (newfunc) 0, /* tp_new */ (freefunc) 0, /* tp_free */ @@ -10966,11 +11551,14 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__HttpIo_type = { #endif }; -SWIGINTERN SwigPyClientData SwigPyBuiltin__Exiv2__HttpIo_clientdata = {0, 0, 0, 0, 0, 0, (PyTypeObject *)&SwigPyBuiltin__Exiv2__HttpIo_type}; +SWIGINTERN SwigPyClientData SwigPyBuiltin__Exiv2__CurlIo_clientdata = {0, 0, 0, 0, 0, 0, (PyTypeObject *)&SwigPyBuiltin__Exiv2__CurlIo_type}; /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ +static void *_p_Exiv2__CurlIoTo_p_Exiv2__BasicIo(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((Exiv2::BasicIo *) (Exiv2::RemoteIo *) ((Exiv2::CurlIo *) x)); +} static void *_p_Exiv2__FileIoTo_p_Exiv2__BasicIo(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((Exiv2::BasicIo *) ((Exiv2::FileIo *) x)); } @@ -10989,11 +11577,15 @@ static void *_p_Exiv2__XPathIoTo_p_Exiv2__BasicIo(void *x, int *SWIGUNUSEDPARM(n static void *_p_Exiv2__XPathIoTo_p_Exiv2__FileIo(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((Exiv2::FileIo *) ((Exiv2::XPathIo *) x)); } +static void *_p_Exiv2__CurlIoTo_p_Exiv2__RemoteIo(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((Exiv2::RemoteIo *) ((Exiv2::CurlIo *) x)); +} static void *_p_Exiv2__HttpIoTo_p_Exiv2__RemoteIo(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((Exiv2::RemoteIo *) ((Exiv2::HttpIo *) x)); } static swig_type_info _swigt__p_ErrorCode = {"_p_ErrorCode", "ErrorCode *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Exiv2__BasicIo = {"_p_Exiv2__BasicIo", "Exiv2::BasicIo *", 0, 0, (void*)&SwigPyBuiltin__Exiv2__BasicIo_clientdata, 0}; +static swig_type_info _swigt__p_Exiv2__CurlIo = {"_p_Exiv2__CurlIo", "Exiv2::CurlIo *", 0, 0, (void*)&SwigPyBuiltin__Exiv2__CurlIo_clientdata, 0}; static swig_type_info _swigt__p_Exiv2__DataBuf = {"_p_Exiv2__DataBuf", "Exiv2::DataBuf *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Exiv2__FileIo = {"_p_Exiv2__FileIo", "Exiv2::FileIo *", 0, 0, (void*)&SwigPyBuiltin__Exiv2__FileIo_clientdata, 0}; static swig_type_info _swigt__p_Exiv2__HttpIo = {"_p_Exiv2__HttpIo", "Exiv2::HttpIo *", 0, 0, (void*)&SwigPyBuiltin__Exiv2__HttpIo_clientdata, 0}; @@ -11018,6 +11610,7 @@ static swig_type_info _swigt__p_unsigned_short = {"_p_unsigned_short", "uint16_t static swig_type_info *swig_type_initial[] = { &_swigt__p_ErrorCode, &_swigt__p_Exiv2__BasicIo, + &_swigt__p_Exiv2__CurlIo, &_swigt__p_Exiv2__DataBuf, &_swigt__p_Exiv2__FileIo, &_swigt__p_Exiv2__HttpIo, @@ -11041,12 +11634,13 @@ static swig_type_info *swig_type_initial[] = { }; static swig_cast_info _swigc__p_ErrorCode[] = { {&_swigt__p_ErrorCode, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_Exiv2__BasicIo[] = { {&_swigt__p_Exiv2__BasicIo, 0, 0, 0}, {&_swigt__p_Exiv2__FileIo, _p_Exiv2__FileIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__HttpIo, _p_Exiv2__HttpIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__MemIo, _p_Exiv2__MemIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__RemoteIo, _p_Exiv2__RemoteIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__XPathIo, _p_Exiv2__XPathIoTo_p_Exiv2__BasicIo, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Exiv2__BasicIo[] = { {&_swigt__p_Exiv2__BasicIo, 0, 0, 0}, {&_swigt__p_Exiv2__CurlIo, _p_Exiv2__CurlIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__FileIo, _p_Exiv2__FileIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__HttpIo, _p_Exiv2__HttpIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__MemIo, _p_Exiv2__MemIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__RemoteIo, _p_Exiv2__RemoteIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__XPathIo, _p_Exiv2__XPathIoTo_p_Exiv2__BasicIo, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Exiv2__CurlIo[] = { {&_swigt__p_Exiv2__CurlIo, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__DataBuf[] = { {&_swigt__p_Exiv2__DataBuf, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__FileIo[] = { {&_swigt__p_Exiv2__FileIo, 0, 0, 0}, {&_swigt__p_Exiv2__XPathIo, _p_Exiv2__XPathIoTo_p_Exiv2__FileIo, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__HttpIo[] = { {&_swigt__p_Exiv2__HttpIo, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__MemIo[] = { {&_swigt__p_Exiv2__MemIo, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_Exiv2__RemoteIo[] = { {&_swigt__p_Exiv2__RemoteIo, 0, 0, 0}, {&_swigt__p_Exiv2__HttpIo, _p_Exiv2__HttpIoTo_p_Exiv2__RemoteIo, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Exiv2__RemoteIo[] = { {&_swigt__p_Exiv2__RemoteIo, 0, 0, 0}, {&_swigt__p_Exiv2__CurlIo, _p_Exiv2__CurlIoTo_p_Exiv2__RemoteIo, 0, 0}, {&_swigt__p_Exiv2__HttpIo, _p_Exiv2__HttpIoTo_p_Exiv2__RemoteIo, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__XPathIo[] = { {&_swigt__p_Exiv2__XPathIo, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_SwigPyObject[] = { {&_swigt__p_SwigPyObject, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; @@ -11066,6 +11660,7 @@ static swig_cast_info _swigc__p_unsigned_short[] = { {&_swigt__p_unsigned_short static swig_cast_info *swig_cast_initial[] = { _swigc__p_ErrorCode, _swigc__p_Exiv2__BasicIo, + _swigc__p_Exiv2__CurlIo, _swigc__p_Exiv2__DataBuf, _swigc__p_Exiv2__FileIo, _swigc__p_Exiv2__HttpIo, @@ -11776,6 +12371,40 @@ SWIG_init(void) { SwigPyBuiltin_AddPublicSymbol(public_interface, "HttpIo"); d = md; + /* type 'Exiv2::CurlIo' */ + builtin_pytype = (PyTypeObject *)&SwigPyBuiltin__Exiv2__CurlIo_type; + builtin_pytype->tp_dict = d = PyDict_New(); + SwigPyBuiltin_SetMetaType(builtin_pytype, metatype); + builtin_pytype->tp_new = PyType_GenericNew; + builtin_base_count = 0; + builtin_basetype = SWIG_MangledTypeQuery("_p_Exiv2__RemoteIo"); + if (builtin_basetype && builtin_basetype->clientdata && ((SwigPyClientData *) builtin_basetype->clientdata)->pytype) { + builtin_bases[builtin_base_count++] = ((SwigPyClientData *) builtin_basetype->clientdata)->pytype; + } else { + PyErr_SetString(PyExc_TypeError, "Could not create type 'CurlIo' as base 'Exiv2::RemoteIo' has not been initialized.\n"); +#if PY_VERSION_HEX >= 0x03000000 + return NULL; +#else + return; +#endif + } + builtin_bases[builtin_base_count] = NULL; + SwigPyBuiltin_InitBases(builtin_pytype, builtin_bases); + PyDict_SetItemString(d, "this", this_descr); + PyDict_SetItemString(d, "thisown", thisown_descr); + if (PyType_Ready(builtin_pytype) < 0) { + PyErr_SetString(PyExc_TypeError, "Could not create type 'CurlIo'."); +#if PY_VERSION_HEX >= 0x03000000 + return NULL; +#else + return; +#endif + } + Py_INCREF(builtin_pytype); + PyModule_AddObject(m, "CurlIo", (PyObject *)builtin_pytype); + SwigPyBuiltin_AddPublicSymbol(public_interface, "CurlIo"); + d = md; + /* Initialize threading */ SWIG_PYTHON_INITIALIZE_THREADS; #if PY_VERSION_HEX >= 0x03000000 diff --git a/src/swig-0_28_2/image_wrap.cxx b/src/swig-0_28_2/image_wrap.cxx index 9689dc3..14b7683 100644 --- a/src/swig-0_28_2/image_wrap.cxx +++ b/src/swig-0_28_2/image_wrap.cxx @@ -3930,75 +3930,76 @@ SwigPyBuiltin_iternextfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) { #define SWIGTYPE_p_Exiv2__AsciiValue swig_types[2] #define SWIGTYPE_p_Exiv2__BasicIo swig_types[3] #define SWIGTYPE_p_Exiv2__CommentValue swig_types[4] -#define SWIGTYPE_p_Exiv2__DataBuf swig_types[5] -#define SWIGTYPE_p_Exiv2__DataSet swig_types[6] -#define SWIGTYPE_p_Exiv2__DataValue swig_types[7] -#define SWIGTYPE_p_Exiv2__DateValue swig_types[8] -#define SWIGTYPE_p_Exiv2__ExifData swig_types[9] -#define SWIGTYPE_p_Exiv2__ExifKey swig_types[10] -#define SWIGTYPE_p_Exiv2__FileIo swig_types[11] -#define SWIGTYPE_p_Exiv2__GroupInfo swig_types[12] -#define SWIGTYPE_p_Exiv2__HttpIo swig_types[13] -#define SWIGTYPE_p_Exiv2__Image swig_types[14] -#define SWIGTYPE_p_Exiv2__ImageFactory swig_types[15] -#define SWIGTYPE_p_Exiv2__IptcData swig_types[16] -#define SWIGTYPE_p_Exiv2__IptcKey swig_types[17] -#define SWIGTYPE_p_Exiv2__Key swig_types[18] -#define SWIGTYPE_p_Exiv2__LangAltValue swig_types[19] -#define SWIGTYPE_p_Exiv2__MemIo swig_types[20] -#define SWIGTYPE_p_Exiv2__RemoteIo swig_types[21] -#define SWIGTYPE_p_Exiv2__StringValue swig_types[22] -#define SWIGTYPE_p_Exiv2__StringValueBase swig_types[23] -#define SWIGTYPE_p_Exiv2__TagInfo swig_types[24] -#define SWIGTYPE_p_Exiv2__TimeValue swig_types[25] -#define SWIGTYPE_p_Exiv2__Value swig_types[26] -#define SWIGTYPE_p_Exiv2__ValueTypeT_double_t swig_types[27] -#define SWIGTYPE_p_Exiv2__ValueTypeT_float_t swig_types[28] -#define SWIGTYPE_p_Exiv2__ValueTypeT_int16_t_t swig_types[29] -#define SWIGTYPE_p_Exiv2__ValueTypeT_int32_t_t swig_types[30] -#define SWIGTYPE_p_Exiv2__ValueTypeT_std__pairT_int32_t_int32_t_t_t swig_types[31] -#define SWIGTYPE_p_Exiv2__ValueTypeT_std__pairT_uint32_t_uint32_t_t_t swig_types[32] -#define SWIGTYPE_p_Exiv2__ValueTypeT_uint16_t_t swig_types[33] -#define SWIGTYPE_p_Exiv2__ValueTypeT_uint32_t_t swig_types[34] -#define SWIGTYPE_p_Exiv2__XPathIo swig_types[35] -#define SWIGTYPE_p_Exiv2__XmpArrayValue swig_types[36] -#define SWIGTYPE_p_Exiv2__XmpData swig_types[37] -#define SWIGTYPE_p_Exiv2__XmpKey swig_types[38] -#define SWIGTYPE_p_Exiv2__XmpPropertyInfo swig_types[39] -#define SWIGTYPE_p_Exiv2__XmpTextValue swig_types[40] -#define SWIGTYPE_p_Exiv2__XmpValue swig_types[41] -#define SWIGTYPE_p_IptcData_iterator swig_types[42] -#define SWIGTYPE_p_IptcData_iterator_base swig_types[43] -#define SWIGTYPE_p_SwigPyObject swig_types[44] -#define SWIGTYPE_p_ValueType swig_types[45] -#define SWIGTYPE_p_XmpData_iterator swig_types[46] -#define SWIGTYPE_p_XmpData_iterator_base swig_types[47] -#define SWIGTYPE_p_allocator_type swig_types[48] -#define SWIGTYPE_p_char swig_types[49] -#define SWIGTYPE_p_const_iterator swig_types[50] -#define SWIGTYPE_p_difference_type swig_types[51] -#define SWIGTYPE_p_first_type swig_types[52] -#define SWIGTYPE_p_int swig_types[53] -#define SWIGTYPE_p_iterator swig_types[54] -#define SWIGTYPE_p_key_type swig_types[55] -#define SWIGTYPE_p_long_long swig_types[56] -#define SWIGTYPE_p_mapped_type swig_types[57] -#define SWIGTYPE_p_second_type swig_types[58] -#define SWIGTYPE_p_short swig_types[59] -#define SWIGTYPE_p_signed_char swig_types[60] -#define SWIGTYPE_p_size_type swig_types[61] -#define SWIGTYPE_p_std__listT_Exiv2__Exifdatum_t swig_types[62] -#define SWIGTYPE_p_std__pairT_int32_t_int32_t_t swig_types[63] -#define SWIGTYPE_p_std__pairT_uint32_t_uint32_t_t swig_types[64] -#define SWIGTYPE_p_std__vectorT_Exiv2__Iptcdatum_std__allocatorT_Exiv2__Iptcdatum_t_t swig_types[65] -#define SWIGTYPE_p_std__vectorT_Exiv2__Xmpdatum_std__allocatorT_Exiv2__Xmpdatum_t_t swig_types[66] -#define SWIGTYPE_p_unsigned_char swig_types[67] -#define SWIGTYPE_p_unsigned_int swig_types[68] -#define SWIGTYPE_p_unsigned_long_long swig_types[69] -#define SWIGTYPE_p_unsigned_short swig_types[70] -#define SWIGTYPE_p_value_type swig_types[71] -static swig_type_info *swig_types[73]; -static swig_module_info swig_module = {swig_types, 72, 0, 0, 0, 0}; +#define SWIGTYPE_p_Exiv2__CurlIo swig_types[5] +#define SWIGTYPE_p_Exiv2__DataBuf swig_types[6] +#define SWIGTYPE_p_Exiv2__DataSet swig_types[7] +#define SWIGTYPE_p_Exiv2__DataValue swig_types[8] +#define SWIGTYPE_p_Exiv2__DateValue swig_types[9] +#define SWIGTYPE_p_Exiv2__ExifData swig_types[10] +#define SWIGTYPE_p_Exiv2__ExifKey swig_types[11] +#define SWIGTYPE_p_Exiv2__FileIo swig_types[12] +#define SWIGTYPE_p_Exiv2__GroupInfo swig_types[13] +#define SWIGTYPE_p_Exiv2__HttpIo swig_types[14] +#define SWIGTYPE_p_Exiv2__Image swig_types[15] +#define SWIGTYPE_p_Exiv2__ImageFactory swig_types[16] +#define SWIGTYPE_p_Exiv2__IptcData swig_types[17] +#define SWIGTYPE_p_Exiv2__IptcKey swig_types[18] +#define SWIGTYPE_p_Exiv2__Key swig_types[19] +#define SWIGTYPE_p_Exiv2__LangAltValue swig_types[20] +#define SWIGTYPE_p_Exiv2__MemIo swig_types[21] +#define SWIGTYPE_p_Exiv2__RemoteIo swig_types[22] +#define SWIGTYPE_p_Exiv2__StringValue swig_types[23] +#define SWIGTYPE_p_Exiv2__StringValueBase swig_types[24] +#define SWIGTYPE_p_Exiv2__TagInfo swig_types[25] +#define SWIGTYPE_p_Exiv2__TimeValue swig_types[26] +#define SWIGTYPE_p_Exiv2__Value swig_types[27] +#define SWIGTYPE_p_Exiv2__ValueTypeT_double_t swig_types[28] +#define SWIGTYPE_p_Exiv2__ValueTypeT_float_t swig_types[29] +#define SWIGTYPE_p_Exiv2__ValueTypeT_int16_t_t swig_types[30] +#define SWIGTYPE_p_Exiv2__ValueTypeT_int32_t_t swig_types[31] +#define SWIGTYPE_p_Exiv2__ValueTypeT_std__pairT_int32_t_int32_t_t_t swig_types[32] +#define SWIGTYPE_p_Exiv2__ValueTypeT_std__pairT_uint32_t_uint32_t_t_t swig_types[33] +#define SWIGTYPE_p_Exiv2__ValueTypeT_uint16_t_t swig_types[34] +#define SWIGTYPE_p_Exiv2__ValueTypeT_uint32_t_t swig_types[35] +#define SWIGTYPE_p_Exiv2__XPathIo swig_types[36] +#define SWIGTYPE_p_Exiv2__XmpArrayValue swig_types[37] +#define SWIGTYPE_p_Exiv2__XmpData swig_types[38] +#define SWIGTYPE_p_Exiv2__XmpKey swig_types[39] +#define SWIGTYPE_p_Exiv2__XmpPropertyInfo swig_types[40] +#define SWIGTYPE_p_Exiv2__XmpTextValue swig_types[41] +#define SWIGTYPE_p_Exiv2__XmpValue swig_types[42] +#define SWIGTYPE_p_IptcData_iterator swig_types[43] +#define SWIGTYPE_p_IptcData_iterator_base swig_types[44] +#define SWIGTYPE_p_SwigPyObject swig_types[45] +#define SWIGTYPE_p_ValueType swig_types[46] +#define SWIGTYPE_p_XmpData_iterator swig_types[47] +#define SWIGTYPE_p_XmpData_iterator_base swig_types[48] +#define SWIGTYPE_p_allocator_type swig_types[49] +#define SWIGTYPE_p_char swig_types[50] +#define SWIGTYPE_p_const_iterator swig_types[51] +#define SWIGTYPE_p_difference_type swig_types[52] +#define SWIGTYPE_p_first_type swig_types[53] +#define SWIGTYPE_p_int swig_types[54] +#define SWIGTYPE_p_iterator swig_types[55] +#define SWIGTYPE_p_key_type swig_types[56] +#define SWIGTYPE_p_long_long swig_types[57] +#define SWIGTYPE_p_mapped_type swig_types[58] +#define SWIGTYPE_p_second_type swig_types[59] +#define SWIGTYPE_p_short swig_types[60] +#define SWIGTYPE_p_signed_char swig_types[61] +#define SWIGTYPE_p_size_type swig_types[62] +#define SWIGTYPE_p_std__listT_Exiv2__Exifdatum_t swig_types[63] +#define SWIGTYPE_p_std__pairT_int32_t_int32_t_t swig_types[64] +#define SWIGTYPE_p_std__pairT_uint32_t_uint32_t_t swig_types[65] +#define SWIGTYPE_p_std__vectorT_Exiv2__Iptcdatum_std__allocatorT_Exiv2__Iptcdatum_t_t swig_types[66] +#define SWIGTYPE_p_std__vectorT_Exiv2__Xmpdatum_std__allocatorT_Exiv2__Xmpdatum_t_t swig_types[67] +#define SWIGTYPE_p_unsigned_char swig_types[68] +#define SWIGTYPE_p_unsigned_int swig_types[69] +#define SWIGTYPE_p_unsigned_long_long swig_types[70] +#define SWIGTYPE_p_unsigned_short swig_types[71] +#define SWIGTYPE_p_value_type swig_types[72] +static swig_type_info *swig_types[74]; +static swig_module_info swig_module = {swig_types, 73, 0, 0, 0, 0}; #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) @@ -4197,6 +4198,19 @@ SWIG_FromCharPtr(const char *cptr) #include "exiv2/exiv2.hpp" +#ifndef EXV_USE_CURL +namespace Exiv2 { + class CurlIo : public RemoteIo { + public: + CurlIo(const std::string& url, size_t blockSize=0) { + throw std::runtime_error( + "CurlIo not enabled in linked libexiv2"); + }; + }; +} +#endif + + #include @@ -4697,6 +4711,10 @@ static swig_type_info* basicio_subtype(Exiv2::BasicIo* ptr) { else if (dynamic_cast(ptr)) { if (dynamic_cast(ptr)) return SWIGTYPE_p_Exiv2__HttpIo; + + else if (dynamic_cast(ptr)) + return SWIGTYPE_p_Exiv2__CurlIo; + else return SWIGTYPE_p_Exiv2__RemoteIo; } @@ -7874,6 +7892,9 @@ SWIGINTERN SwigPyClientData SwigPyBuiltin__Exiv2__ImageFactory_clientdata = {0, /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ +static void *_p_Exiv2__CurlIoTo_p_Exiv2__BasicIo(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((Exiv2::BasicIo *) (Exiv2::RemoteIo *) ((Exiv2::CurlIo *) x)); +} static void *_p_Exiv2__FileIoTo_p_Exiv2__BasicIo(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((Exiv2::BasicIo *) ((Exiv2::FileIo *) x)); } @@ -7901,6 +7922,9 @@ static void *_p_Exiv2__IptcKeyTo_p_Exiv2__Key(void *x, int *SWIGUNUSEDPARM(newme static void *_p_Exiv2__XmpKeyTo_p_Exiv2__Key(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((Exiv2::Key *) ((Exiv2::XmpKey *) x)); } +static void *_p_Exiv2__CurlIoTo_p_Exiv2__RemoteIo(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((Exiv2::RemoteIo *) ((Exiv2::CurlIo *) x)); +} static void *_p_Exiv2__HttpIoTo_p_Exiv2__RemoteIo(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((Exiv2::RemoteIo *) ((Exiv2::HttpIo *) x)); } @@ -7984,6 +8008,7 @@ static swig_type_info _swigt__p_ExifData_iterator_base = {"_p_ExifData_iterator_ static swig_type_info _swigt__p_Exiv2__AsciiValue = {"_p_Exiv2__AsciiValue", "Exiv2::AsciiValue *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Exiv2__BasicIo = {"_p_Exiv2__BasicIo", "Exiv2::BasicIo *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Exiv2__CommentValue = {"_p_Exiv2__CommentValue", "Exiv2::CommentValue *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_Exiv2__CurlIo = {"_p_Exiv2__CurlIo", "Exiv2::CurlIo *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Exiv2__DataBuf = {"_p_Exiv2__DataBuf", "Exiv2::DataBuf *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Exiv2__DataSet = {"_p_Exiv2__DataSet", "Exiv2::DataSet *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Exiv2__DataValue = {"_p_Exiv2__DataValue", "Exiv2::DataValue *", 0, 0, (void*)0, 0}; @@ -8058,6 +8083,7 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_Exiv2__AsciiValue, &_swigt__p_Exiv2__BasicIo, &_swigt__p_Exiv2__CommentValue, + &_swigt__p_Exiv2__CurlIo, &_swigt__p_Exiv2__DataBuf, &_swigt__p_Exiv2__DataSet, &_swigt__p_Exiv2__DataValue, @@ -8130,8 +8156,9 @@ static swig_type_info *swig_type_initial[] = { static swig_cast_info _swigc__p_ExifData_iterator[] = { {&_swigt__p_ExifData_iterator, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_ExifData_iterator_base[] = { {&_swigt__p_ExifData_iterator_base, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__AsciiValue[] = { {&_swigt__p_Exiv2__AsciiValue, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_Exiv2__BasicIo[] = { {&_swigt__p_Exiv2__BasicIo, 0, 0, 0}, {&_swigt__p_Exiv2__FileIo, _p_Exiv2__FileIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__HttpIo, _p_Exiv2__HttpIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__MemIo, _p_Exiv2__MemIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__RemoteIo, _p_Exiv2__RemoteIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__XPathIo, _p_Exiv2__XPathIoTo_p_Exiv2__BasicIo, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Exiv2__BasicIo[] = { {&_swigt__p_Exiv2__BasicIo, 0, 0, 0}, {&_swigt__p_Exiv2__CurlIo, _p_Exiv2__CurlIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__FileIo, _p_Exiv2__FileIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__HttpIo, _p_Exiv2__HttpIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__MemIo, _p_Exiv2__MemIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__RemoteIo, _p_Exiv2__RemoteIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__XPathIo, _p_Exiv2__XPathIoTo_p_Exiv2__BasicIo, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__CommentValue[] = { {&_swigt__p_Exiv2__CommentValue, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Exiv2__CurlIo[] = { {&_swigt__p_Exiv2__CurlIo, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__DataBuf[] = { {&_swigt__p_Exiv2__DataBuf, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__DataSet[] = { {&_swigt__p_Exiv2__DataSet, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__DataValue[] = { {&_swigt__p_Exiv2__DataValue, 0, 0, 0},{0, 0, 0, 0}}; @@ -8148,7 +8175,7 @@ static swig_cast_info _swigc__p_Exiv2__IptcKey[] = { {&_swigt__p_Exiv2__IptcKey static swig_cast_info _swigc__p_Exiv2__Key[] = { {&_swigt__p_Exiv2__Key, 0, 0, 0}, {&_swigt__p_Exiv2__ExifKey, _p_Exiv2__ExifKeyTo_p_Exiv2__Key, 0, 0}, {&_swigt__p_Exiv2__IptcKey, _p_Exiv2__IptcKeyTo_p_Exiv2__Key, 0, 0}, {&_swigt__p_Exiv2__XmpKey, _p_Exiv2__XmpKeyTo_p_Exiv2__Key, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__LangAltValue[] = { {&_swigt__p_Exiv2__LangAltValue, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__MemIo[] = { {&_swigt__p_Exiv2__MemIo, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_Exiv2__RemoteIo[] = { {&_swigt__p_Exiv2__RemoteIo, 0, 0, 0}, {&_swigt__p_Exiv2__HttpIo, _p_Exiv2__HttpIoTo_p_Exiv2__RemoteIo, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Exiv2__RemoteIo[] = { {&_swigt__p_Exiv2__RemoteIo, 0, 0, 0}, {&_swigt__p_Exiv2__CurlIo, _p_Exiv2__CurlIoTo_p_Exiv2__RemoteIo, 0, 0}, {&_swigt__p_Exiv2__HttpIo, _p_Exiv2__HttpIoTo_p_Exiv2__RemoteIo, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__StringValue[] = { {&_swigt__p_Exiv2__StringValue, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__StringValueBase[] = { {&_swigt__p_Exiv2__StringValueBase, 0, 0, 0}, {&_swigt__p_Exiv2__AsciiValue, _p_Exiv2__AsciiValueTo_p_Exiv2__StringValueBase, 0, 0}, {&_swigt__p_Exiv2__CommentValue, _p_Exiv2__CommentValueTo_p_Exiv2__StringValueBase, 0, 0}, {&_swigt__p_Exiv2__StringValue, _p_Exiv2__StringValueTo_p_Exiv2__StringValueBase, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__TagInfo[] = { {&_swigt__p_Exiv2__TagInfo, 0, 0, 0},{0, 0, 0, 0}}; @@ -8206,6 +8233,7 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_Exiv2__AsciiValue, _swigc__p_Exiv2__BasicIo, _swigc__p_Exiv2__CommentValue, + _swigc__p_Exiv2__CurlIo, _swigc__p_Exiv2__DataBuf, _swigc__p_Exiv2__DataSet, _swigc__p_Exiv2__DataValue, diff --git a/src/swig-0_28_2/preview_wrap.cxx b/src/swig-0_28_2/preview_wrap.cxx index 2dc743f..1c8de1d 100644 --- a/src/swig-0_28_2/preview_wrap.cxx +++ b/src/swig-0_28_2/preview_wrap.cxx @@ -3932,75 +3932,76 @@ SwigPyBuiltin_iternextfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) { #define SWIGTYPE_p_Exiv2__AsciiValue swig_types[2] #define SWIGTYPE_p_Exiv2__BasicIo swig_types[3] #define SWIGTYPE_p_Exiv2__CommentValue swig_types[4] -#define SWIGTYPE_p_Exiv2__DataBuf swig_types[5] -#define SWIGTYPE_p_Exiv2__DataSet swig_types[6] -#define SWIGTYPE_p_Exiv2__DataValue swig_types[7] -#define SWIGTYPE_p_Exiv2__DateValue swig_types[8] -#define SWIGTYPE_p_Exiv2__ExifKey swig_types[9] -#define SWIGTYPE_p_Exiv2__FileIo swig_types[10] -#define SWIGTYPE_p_Exiv2__GroupInfo swig_types[11] -#define SWIGTYPE_p_Exiv2__HttpIo swig_types[12] -#define SWIGTYPE_p_Exiv2__Image swig_types[13] -#define SWIGTYPE_p_Exiv2__IptcKey swig_types[14] -#define SWIGTYPE_p_Exiv2__Key swig_types[15] -#define SWIGTYPE_p_Exiv2__LangAltValue swig_types[16] -#define SWIGTYPE_p_Exiv2__MemIo swig_types[17] -#define SWIGTYPE_p_Exiv2__PreviewImage swig_types[18] -#define SWIGTYPE_p_Exiv2__PreviewManager swig_types[19] -#define SWIGTYPE_p_Exiv2__PreviewProperties swig_types[20] -#define SWIGTYPE_p_Exiv2__RemoteIo swig_types[21] -#define SWIGTYPE_p_Exiv2__StringValue swig_types[22] -#define SWIGTYPE_p_Exiv2__StringValueBase swig_types[23] -#define SWIGTYPE_p_Exiv2__TagInfo swig_types[24] -#define SWIGTYPE_p_Exiv2__TimeValue swig_types[25] -#define SWIGTYPE_p_Exiv2__Value swig_types[26] -#define SWIGTYPE_p_Exiv2__ValueTypeT_double_t swig_types[27] -#define SWIGTYPE_p_Exiv2__ValueTypeT_float_t swig_types[28] -#define SWIGTYPE_p_Exiv2__ValueTypeT_int16_t_t swig_types[29] -#define SWIGTYPE_p_Exiv2__ValueTypeT_int32_t_t swig_types[30] -#define SWIGTYPE_p_Exiv2__ValueTypeT_std__pairT_int32_t_int32_t_t_t swig_types[31] -#define SWIGTYPE_p_Exiv2__ValueTypeT_std__pairT_uint32_t_uint32_t_t_t swig_types[32] -#define SWIGTYPE_p_Exiv2__ValueTypeT_uint16_t_t swig_types[33] -#define SWIGTYPE_p_Exiv2__ValueTypeT_uint32_t_t swig_types[34] -#define SWIGTYPE_p_Exiv2__XPathIo swig_types[35] -#define SWIGTYPE_p_Exiv2__XmpArrayValue swig_types[36] -#define SWIGTYPE_p_Exiv2__XmpKey swig_types[37] -#define SWIGTYPE_p_Exiv2__XmpPropertyInfo swig_types[38] -#define SWIGTYPE_p_Exiv2__XmpTextValue swig_types[39] -#define SWIGTYPE_p_Exiv2__XmpValue swig_types[40] -#define SWIGTYPE_p_IptcData_iterator swig_types[41] -#define SWIGTYPE_p_IptcData_iterator_base swig_types[42] -#define SWIGTYPE_p_SwigPyObject swig_types[43] -#define SWIGTYPE_p_ValueType swig_types[44] -#define SWIGTYPE_p_XmpData_iterator swig_types[45] -#define SWIGTYPE_p_XmpData_iterator_base swig_types[46] -#define SWIGTYPE_p_allocator_type swig_types[47] -#define SWIGTYPE_p_char swig_types[48] -#define SWIGTYPE_p_const_iterator swig_types[49] -#define SWIGTYPE_p_difference_type swig_types[50] -#define SWIGTYPE_p_first_type swig_types[51] -#define SWIGTYPE_p_int swig_types[52] -#define SWIGTYPE_p_iterator swig_types[53] -#define SWIGTYPE_p_key_type swig_types[54] -#define SWIGTYPE_p_long_long swig_types[55] -#define SWIGTYPE_p_mapped_type swig_types[56] -#define SWIGTYPE_p_second_type swig_types[57] -#define SWIGTYPE_p_short swig_types[58] -#define SWIGTYPE_p_signed_char swig_types[59] -#define SWIGTYPE_p_size_type swig_types[60] -#define SWIGTYPE_p_std__listT_Exiv2__Exifdatum_t swig_types[61] -#define SWIGTYPE_p_std__pairT_int32_t_int32_t_t swig_types[62] -#define SWIGTYPE_p_std__pairT_uint32_t_uint32_t_t swig_types[63] -#define SWIGTYPE_p_std__vectorT_Exiv2__Iptcdatum_std__allocatorT_Exiv2__Iptcdatum_t_t swig_types[64] -#define SWIGTYPE_p_std__vectorT_Exiv2__PreviewProperties_t swig_types[65] -#define SWIGTYPE_p_std__vectorT_Exiv2__Xmpdatum_std__allocatorT_Exiv2__Xmpdatum_t_t swig_types[66] -#define SWIGTYPE_p_unsigned_char swig_types[67] -#define SWIGTYPE_p_unsigned_int swig_types[68] -#define SWIGTYPE_p_unsigned_long_long swig_types[69] -#define SWIGTYPE_p_unsigned_short swig_types[70] -#define SWIGTYPE_p_value_type swig_types[71] -static swig_type_info *swig_types[73]; -static swig_module_info swig_module = {swig_types, 72, 0, 0, 0, 0}; +#define SWIGTYPE_p_Exiv2__CurlIo swig_types[5] +#define SWIGTYPE_p_Exiv2__DataBuf swig_types[6] +#define SWIGTYPE_p_Exiv2__DataSet swig_types[7] +#define SWIGTYPE_p_Exiv2__DataValue swig_types[8] +#define SWIGTYPE_p_Exiv2__DateValue swig_types[9] +#define SWIGTYPE_p_Exiv2__ExifKey swig_types[10] +#define SWIGTYPE_p_Exiv2__FileIo swig_types[11] +#define SWIGTYPE_p_Exiv2__GroupInfo swig_types[12] +#define SWIGTYPE_p_Exiv2__HttpIo swig_types[13] +#define SWIGTYPE_p_Exiv2__Image swig_types[14] +#define SWIGTYPE_p_Exiv2__IptcKey swig_types[15] +#define SWIGTYPE_p_Exiv2__Key swig_types[16] +#define SWIGTYPE_p_Exiv2__LangAltValue swig_types[17] +#define SWIGTYPE_p_Exiv2__MemIo swig_types[18] +#define SWIGTYPE_p_Exiv2__PreviewImage swig_types[19] +#define SWIGTYPE_p_Exiv2__PreviewManager swig_types[20] +#define SWIGTYPE_p_Exiv2__PreviewProperties swig_types[21] +#define SWIGTYPE_p_Exiv2__RemoteIo swig_types[22] +#define SWIGTYPE_p_Exiv2__StringValue swig_types[23] +#define SWIGTYPE_p_Exiv2__StringValueBase swig_types[24] +#define SWIGTYPE_p_Exiv2__TagInfo swig_types[25] +#define SWIGTYPE_p_Exiv2__TimeValue swig_types[26] +#define SWIGTYPE_p_Exiv2__Value swig_types[27] +#define SWIGTYPE_p_Exiv2__ValueTypeT_double_t swig_types[28] +#define SWIGTYPE_p_Exiv2__ValueTypeT_float_t swig_types[29] +#define SWIGTYPE_p_Exiv2__ValueTypeT_int16_t_t swig_types[30] +#define SWIGTYPE_p_Exiv2__ValueTypeT_int32_t_t swig_types[31] +#define SWIGTYPE_p_Exiv2__ValueTypeT_std__pairT_int32_t_int32_t_t_t swig_types[32] +#define SWIGTYPE_p_Exiv2__ValueTypeT_std__pairT_uint32_t_uint32_t_t_t swig_types[33] +#define SWIGTYPE_p_Exiv2__ValueTypeT_uint16_t_t swig_types[34] +#define SWIGTYPE_p_Exiv2__ValueTypeT_uint32_t_t swig_types[35] +#define SWIGTYPE_p_Exiv2__XPathIo swig_types[36] +#define SWIGTYPE_p_Exiv2__XmpArrayValue swig_types[37] +#define SWIGTYPE_p_Exiv2__XmpKey swig_types[38] +#define SWIGTYPE_p_Exiv2__XmpPropertyInfo swig_types[39] +#define SWIGTYPE_p_Exiv2__XmpTextValue swig_types[40] +#define SWIGTYPE_p_Exiv2__XmpValue swig_types[41] +#define SWIGTYPE_p_IptcData_iterator swig_types[42] +#define SWIGTYPE_p_IptcData_iterator_base swig_types[43] +#define SWIGTYPE_p_SwigPyObject swig_types[44] +#define SWIGTYPE_p_ValueType swig_types[45] +#define SWIGTYPE_p_XmpData_iterator swig_types[46] +#define SWIGTYPE_p_XmpData_iterator_base swig_types[47] +#define SWIGTYPE_p_allocator_type swig_types[48] +#define SWIGTYPE_p_char swig_types[49] +#define SWIGTYPE_p_const_iterator swig_types[50] +#define SWIGTYPE_p_difference_type swig_types[51] +#define SWIGTYPE_p_first_type swig_types[52] +#define SWIGTYPE_p_int swig_types[53] +#define SWIGTYPE_p_iterator swig_types[54] +#define SWIGTYPE_p_key_type swig_types[55] +#define SWIGTYPE_p_long_long swig_types[56] +#define SWIGTYPE_p_mapped_type swig_types[57] +#define SWIGTYPE_p_second_type swig_types[58] +#define SWIGTYPE_p_short swig_types[59] +#define SWIGTYPE_p_signed_char swig_types[60] +#define SWIGTYPE_p_size_type swig_types[61] +#define SWIGTYPE_p_std__listT_Exiv2__Exifdatum_t swig_types[62] +#define SWIGTYPE_p_std__pairT_int32_t_int32_t_t swig_types[63] +#define SWIGTYPE_p_std__pairT_uint32_t_uint32_t_t swig_types[64] +#define SWIGTYPE_p_std__vectorT_Exiv2__Iptcdatum_std__allocatorT_Exiv2__Iptcdatum_t_t swig_types[65] +#define SWIGTYPE_p_std__vectorT_Exiv2__PreviewProperties_t swig_types[66] +#define SWIGTYPE_p_std__vectorT_Exiv2__Xmpdatum_std__allocatorT_Exiv2__Xmpdatum_t_t swig_types[67] +#define SWIGTYPE_p_unsigned_char swig_types[68] +#define SWIGTYPE_p_unsigned_int swig_types[69] +#define SWIGTYPE_p_unsigned_long_long swig_types[70] +#define SWIGTYPE_p_unsigned_short swig_types[71] +#define SWIGTYPE_p_value_type swig_types[72] +static swig_type_info *swig_types[74]; +static swig_module_info swig_module = {swig_types, 73, 0, 0, 0, 0}; #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) @@ -4199,6 +4200,19 @@ SWIG_FromCharPtr(const char *cptr) #include "exiv2/exiv2.hpp" +#ifndef EXV_USE_CURL +namespace Exiv2 { + class CurlIo : public RemoteIo { + public: + CurlIo(const std::string& url, size_t blockSize=0) { + throw std::runtime_error( + "CurlIo not enabled in linked libexiv2"); + }; + }; +} +#endif + + #include @@ -7432,6 +7446,9 @@ SWIGINTERN SwigPyClientData SwigPyBuiltin__Exiv2__PreviewManager_clientdata = {0 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ +static void *_p_Exiv2__CurlIoTo_p_Exiv2__BasicIo(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((Exiv2::BasicIo *) (Exiv2::RemoteIo *) ((Exiv2::CurlIo *) x)); +} static void *_p_Exiv2__FileIoTo_p_Exiv2__BasicIo(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((Exiv2::BasicIo *) ((Exiv2::FileIo *) x)); } @@ -7459,6 +7476,9 @@ static void *_p_Exiv2__IptcKeyTo_p_Exiv2__Key(void *x, int *SWIGUNUSEDPARM(newme static void *_p_Exiv2__XmpKeyTo_p_Exiv2__Key(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((Exiv2::Key *) ((Exiv2::XmpKey *) x)); } +static void *_p_Exiv2__CurlIoTo_p_Exiv2__RemoteIo(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((Exiv2::RemoteIo *) ((Exiv2::CurlIo *) x)); +} static void *_p_Exiv2__HttpIoTo_p_Exiv2__RemoteIo(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((Exiv2::RemoteIo *) ((Exiv2::HttpIo *) x)); } @@ -7542,6 +7562,7 @@ static swig_type_info _swigt__p_ExifData_iterator_base = {"_p_ExifData_iterator_ static swig_type_info _swigt__p_Exiv2__AsciiValue = {"_p_Exiv2__AsciiValue", "Exiv2::AsciiValue *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Exiv2__BasicIo = {"_p_Exiv2__BasicIo", "Exiv2::BasicIo *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Exiv2__CommentValue = {"_p_Exiv2__CommentValue", "Exiv2::CommentValue *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_Exiv2__CurlIo = {"_p_Exiv2__CurlIo", "Exiv2::CurlIo *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Exiv2__DataBuf = {"_p_Exiv2__DataBuf", "Exiv2::DataBuf *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Exiv2__DataSet = {"_p_Exiv2__DataSet", "Exiv2::DataSet *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Exiv2__DataValue = {"_p_Exiv2__DataValue", "Exiv2::DataValue *", 0, 0, (void*)0, 0}; @@ -7616,6 +7637,7 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_Exiv2__AsciiValue, &_swigt__p_Exiv2__BasicIo, &_swigt__p_Exiv2__CommentValue, + &_swigt__p_Exiv2__CurlIo, &_swigt__p_Exiv2__DataBuf, &_swigt__p_Exiv2__DataSet, &_swigt__p_Exiv2__DataValue, @@ -7688,8 +7710,9 @@ static swig_type_info *swig_type_initial[] = { static swig_cast_info _swigc__p_ExifData_iterator[] = { {&_swigt__p_ExifData_iterator, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_ExifData_iterator_base[] = { {&_swigt__p_ExifData_iterator_base, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__AsciiValue[] = { {&_swigt__p_Exiv2__AsciiValue, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_Exiv2__BasicIo[] = { {&_swigt__p_Exiv2__BasicIo, 0, 0, 0}, {&_swigt__p_Exiv2__FileIo, _p_Exiv2__FileIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__HttpIo, _p_Exiv2__HttpIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__MemIo, _p_Exiv2__MemIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__RemoteIo, _p_Exiv2__RemoteIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__XPathIo, _p_Exiv2__XPathIoTo_p_Exiv2__BasicIo, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Exiv2__BasicIo[] = { {&_swigt__p_Exiv2__BasicIo, 0, 0, 0}, {&_swigt__p_Exiv2__CurlIo, _p_Exiv2__CurlIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__FileIo, _p_Exiv2__FileIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__HttpIo, _p_Exiv2__HttpIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__MemIo, _p_Exiv2__MemIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__RemoteIo, _p_Exiv2__RemoteIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__XPathIo, _p_Exiv2__XPathIoTo_p_Exiv2__BasicIo, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__CommentValue[] = { {&_swigt__p_Exiv2__CommentValue, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Exiv2__CurlIo[] = { {&_swigt__p_Exiv2__CurlIo, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__DataBuf[] = { {&_swigt__p_Exiv2__DataBuf, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__DataSet[] = { {&_swigt__p_Exiv2__DataSet, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__DataValue[] = { {&_swigt__p_Exiv2__DataValue, 0, 0, 0},{0, 0, 0, 0}}; @@ -7706,7 +7729,7 @@ static swig_cast_info _swigc__p_Exiv2__MemIo[] = { {&_swigt__p_Exiv2__MemIo, 0, static swig_cast_info _swigc__p_Exiv2__PreviewImage[] = { {&_swigt__p_Exiv2__PreviewImage, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__PreviewManager[] = { {&_swigt__p_Exiv2__PreviewManager, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__PreviewProperties[] = { {&_swigt__p_Exiv2__PreviewProperties, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_Exiv2__RemoteIo[] = { {&_swigt__p_Exiv2__RemoteIo, 0, 0, 0}, {&_swigt__p_Exiv2__HttpIo, _p_Exiv2__HttpIoTo_p_Exiv2__RemoteIo, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Exiv2__RemoteIo[] = { {&_swigt__p_Exiv2__RemoteIo, 0, 0, 0}, {&_swigt__p_Exiv2__CurlIo, _p_Exiv2__CurlIoTo_p_Exiv2__RemoteIo, 0, 0}, {&_swigt__p_Exiv2__HttpIo, _p_Exiv2__HttpIoTo_p_Exiv2__RemoteIo, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__StringValue[] = { {&_swigt__p_Exiv2__StringValue, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__StringValueBase[] = { {&_swigt__p_Exiv2__StringValueBase, 0, 0, 0}, {&_swigt__p_Exiv2__AsciiValue, _p_Exiv2__AsciiValueTo_p_Exiv2__StringValueBase, 0, 0}, {&_swigt__p_Exiv2__CommentValue, _p_Exiv2__CommentValueTo_p_Exiv2__StringValueBase, 0, 0}, {&_swigt__p_Exiv2__StringValue, _p_Exiv2__StringValueTo_p_Exiv2__StringValueBase, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Exiv2__TagInfo[] = { {&_swigt__p_Exiv2__TagInfo, 0, 0, 0},{0, 0, 0, 0}}; @@ -7764,6 +7787,7 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_Exiv2__AsciiValue, _swigc__p_Exiv2__BasicIo, _swigc__p_Exiv2__CommentValue, + _swigc__p_Exiv2__CurlIo, _swigc__p_Exiv2__DataBuf, _swigc__p_Exiv2__DataSet, _swigc__p_Exiv2__DataValue, diff --git a/src/swig-0_28_2/version_wrap.cxx b/src/swig-0_28_2/version_wrap.cxx index 65699f5..261bda8 100644 --- a/src/swig-0_28_2/version_wrap.cxx +++ b/src/swig-0_28_2/version_wrap.cxx @@ -4263,6 +4263,7 @@ static PyObject* versionInfo() { bool video = false; bool unicode = false; bool webready = false; + bool curl = false; #ifdef EXV_ENABLE_NLS nls = true; #endif @@ -4275,13 +4276,17 @@ static PyObject* versionInfo() { #ifdef EXV_ENABLE_WEBREADY webready = true; #endif - return Py_BuildValue("{ss,sN,sN,sN,sN,sN}", +#ifdef EXV_USE_CURL + curl = true; +#endif + return Py_BuildValue("{ss,sN,sN,sN,sN,sN,sN}", "version", Exiv2::version(), "EXV_ENABLE_NLS", PyBool_FromLong(nls), "EXV_ENABLE_BMFF", PyBool_FromLong(bmff), "EXV_ENABLE_VIDEO", PyBool_FromLong(video), "EXV_UNICODE_PATH", PyBool_FromLong(unicode), - "EXV_ENABLE_WEBREADY", PyBool_FromLong(webready)); + "EXV_ENABLE_WEBREADY", PyBool_FromLong(webready), + "EXV_USE_CURL", PyBool_FromLong(curl)); }; diff --git a/tests/test_basicio.py b/tests/test_basicio.py index 5f5e639..bf76299 100644 --- a/tests/test_basicio.py +++ b/tests/test_basicio.py @@ -33,6 +33,29 @@ def setUpClass(cls): cls.image_path = os.path.join(test_dir, 'image_02.jpg') cls.data = b'The quick brown fox jumps over the lazy dog' + @unittest.skipUnless(exiv2.versionInfo()['EXV_USE_CURL'], + 'CurlIo not included') + def test_CurlIo(self): + https_image = ('https://raw.githubusercontent.com/jim-easterbrook' + '/python-exiv2/main/tests/image_02.jpg') + io = exiv2.CurlIo(https_image) + self.assertIsInstance(io, exiv2.CurlIo) + self.assertEqual(io.error(), False) + self.assertEqual(io.path(), https_image) + self.assertEqual(io.size(), 0) + io = exiv2.ImageFactory.createIo(https_image) + self.assertIsInstance(io, exiv2.CurlIo) + self.assertEqual(io.error(), False) + self.assertEqual(io.path(), https_image) + self.assertEqual(io.size(), 0) + # open and close + self.assertEqual(io.isopen(), False) + self.assertEqual(io.open(), 0) + self.assertEqual(io.size(), 15125) + self.assertEqual(io.isopen(), True) + self.assertEqual(io.close(), 0) + self.assertEqual(io.isopen(), True) + def test_FileIo(self): # most functions are tested in test_MemIo io = exiv2.FileIo(self.image_path) diff --git a/tests/test_value.py b/tests/test_value.py index 48b6953..b05def9 100644 --- a/tests/test_value.py +++ b/tests/test_value.py @@ -152,7 +152,7 @@ def test_AsciiValue(self): def test_CommentValue(self): raw_text = 'The quick brown fox jumps over the lazy dog. àéīöûç' data = b'UNICODE\x00' + bytes(raw_text, 'utf-16-le') - if exiv2.testVersion(0, 27, 4): + if exiv2.testVersion(0, 27, 2): text = 'charset=Unicode ' + raw_text else: text = 'charset="Unicode" ' + raw_text diff --git a/utils/build_swig.py b/utils/build_swig.py index 052535d..a4fbbf8 100644 --- a/utils/build_swig.py +++ b/utils/build_swig.py @@ -52,12 +52,10 @@ def main(): if swig_version < (4, 1, 0): print('SWIG version 4.1.0 or later required') return 1 - # get version to SWIG - if len(sys.argv) < 2 or len(sys.argv) > 3: - print('Usage: %s path ["minimal"]' % sys.argv[0]) + # get source to SWIG + if len(sys.argv) != 2: + print('Usage: %s path' % sys.argv[0]) return 1 - # minimal build? - minimal = len(sys.argv) >= 3 and sys.argv[2] == 'minimal' # get config platform = sys.platform if platform == 'win32' and 'GCC' in sys.version: @@ -75,21 +73,25 @@ def main(): exiv2_version = get_version(incl_dir) # get exiv2 build options options = { - 'EXV_UNICODE_PATH' : False, + 'EXV_ENABLE_WEBREADY': False, + 'EXV_USE_CURL': False, } - if not minimal: - with open(os.path.join(incl_dir, 'exv_conf.h')) as cnf: - for line in cnf.readlines(): - words = line.split() - for key in options: - if key not in line: - continue - if words[1] != key: - continue - if words[0] == '#define': - options[key] = True - elif words[0] == '#undef': - options[key] = False + with open(os.path.join(incl_dir, 'exv_conf.h')) as cnf: + for line in cnf.readlines(): + words = line.split() + for key in options: + if key not in line: + continue + if words[1] != key: + continue + if words[0] == '#define': + options[key] = True + elif words[0] == '#undef': + options[key] = False + for key in options: + if not options[key]: + print(f'WARNING: option {key} is not set.' + ' Some functionality will not be available to Python.') # get python-exiv2 version with open('README.rst') as rst: py_exiv2_version = rst.readline().split()[-1]