Skip to content

Commit 1818f90

Browse files
Cleaner way to ignore CurlIo and SshIo
1 parent f122a83 commit 1818f90

File tree

10 files changed

+321
-475
lines changed

10 files changed

+321
-475
lines changed

src/interface/basicio.i

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@
4141
// Catch all C++ exceptions
4242
EXCEPTION()
4343

44-
%fragment("EXV_USE_CURL");
45-
%fragment("EXV_USE_SSH");
4644
%fragment("EXV_ENABLE_FILESYSTEM");
4745

4846
UNIQUE_PTR(Exiv2::BasicIo);
@@ -96,11 +94,13 @@ the same interface.
9694
const char* ioType() {
9795
if (dynamic_cast<Exiv2::MemIo*>($self))
9896
return "MemIo";
97+
%#ifdef EXV_ENABLE_FILESYSTEM
9998
else if (dynamic_cast<Exiv2::FileIo*>($self)) {
10099
if (dynamic_cast<Exiv2::XPathIo*>($self))
101100
return "XPathIo";
102101
return "FileIo";
103102
}
103+
%#endif
104104
else if (dynamic_cast<Exiv2::RemoteIo*>($self)) {
105105
if (dynamic_cast<Exiv2::HttpIo*>($self))
106106
return "HttpIo";
@@ -264,4 +264,6 @@ DEPRECATED_ENUM(BasicIo, Position, "Seek starting positions.",
264264
%ignore Exiv2::XPathIo;
265265
%ignore EXV_XPATH_MEMIO;
266266

267+
#undef EXV_USE_CURL
268+
#undef EXV_USE_SSH
267269
%include "exiv2/basicio.hpp"

src/interface/image.i

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ IMPORT_ENUM(MetadataId)
4646
// Catch all C++ exceptions
4747
EXCEPTION()
4848

49-
%fragment("EXV_USE_CURL");
50-
%fragment("EXV_USE_SSH");
5149
%fragment("EXV_ENABLE_FILESYSTEM");
5250
EXV_ENABLE_FILESYSTEM_FUNCTION(Exiv2::ImageFactory::create(
5351
ImageType, const std::string&))

src/interface/preview.i

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ For Exif thumbnail images see the :py:class:`ExifThumb` class.";
4242
// Catch all C++ exceptions
4343
EXCEPTION()
4444

45-
%fragment("EXV_USE_CURL");
46-
%fragment("EXV_USE_SSH");
4745
%fragment("EXV_ENABLE_FILESYSTEM");
4846
EXV_ENABLE_FILESYSTEM_FUNCTION(Exiv2::PreviewImage::writeFile)
4947

src/interface/shared/exv_options.i

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// python-exiv2 - Python interface to libexiv2
22
// http://github.com/jim-easterbrook/python-exiv2
3-
// Copyright (C) 2024 Jim Easterbrook [email protected]
3+
// Copyright (C) 2025 Jim Easterbrook [email protected]
44
//
55
// This file is part of python-exiv2. python-exiv2 is free software: you can
66
// redistribute it and/or modify it under the terms of the GNU General Public
@@ -16,24 +16,6 @@
1616
// along with python-exiv2. If not, see <http://www.gnu.org/licenses/>.
1717

1818

19-
// Fragment to define Exiv2::CurlIo if EXV_USE_CURL is OFF
20-
%fragment("EXV_USE_CURL", "header") %{
21-
#ifndef EXV_USE_CURL
22-
namespace Exiv2 {
23-
class CurlIo : public RemoteIo {};
24-
}
25-
#endif // EXV_USE_CURL
26-
%}
27-
28-
// Fragment to define Exiv2::SshIo if EXV_USE_SSH is OFF
29-
%fragment("EXV_USE_SSH", "header") %{
30-
#ifndef EXV_USE_SSH
31-
namespace Exiv2 {
32-
class SshIo : public RemoteIo {};
33-
}
34-
#endif // EXV_USE_SSH
35-
%}
36-
3719
// Fragment to set EXV_ENABLE_FILESYSTEM on old libexiv2 versions
3820
%fragment("set_EXV_ENABLE_FILESYSTEM", "header") %{
3921
#if !EXIV2_TEST_VERSION(0, 28, 3)

src/swig-0_27_7/basicio_wrap.cxx

Lines changed: 26 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -3990,29 +3990,28 @@ SwigPyBuiltin_iternextfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) {
39903990
/* -------- TYPES TABLE (BEGIN) -------- */
39913991

39923992
#define SWIGTYPE_p_Exiv2__BasicIo swig_types[0]
3993-
#define SWIGTYPE_p_Exiv2__CurlIo swig_types[1]
3994-
#define SWIGTYPE_p_Exiv2__DataBuf swig_types[2]
3995-
#define SWIGTYPE_p_Exiv2__FileIo swig_types[3]
3996-
#define SWIGTYPE_p_Exiv2__HttpIo swig_types[4]
3997-
#define SWIGTYPE_p_Exiv2__MemIo swig_types[5]
3998-
#define SWIGTYPE_p_Exiv2__RemoteIo swig_types[6]
3999-
#define SWIGTYPE_p_Exiv2__XPathIo swig_types[7]
4000-
#define SWIGTYPE_p_SwigPyObject swig_types[8]
4001-
#define SWIGTYPE_p_char swig_types[9]
4002-
#define SWIGTYPE_p_first_type swig_types[10]
4003-
#define SWIGTYPE_p_int swig_types[11]
4004-
#define SWIGTYPE_p_long_long swig_types[12]
4005-
#define SWIGTYPE_p_second_type swig_types[13]
4006-
#define SWIGTYPE_p_short swig_types[14]
4007-
#define SWIGTYPE_p_signed_char swig_types[15]
4008-
#define SWIGTYPE_p_std__pairT_int32_t_int32_t_t swig_types[16]
4009-
#define SWIGTYPE_p_std__pairT_uint32_t_uint32_t_t swig_types[17]
4010-
#define SWIGTYPE_p_unsigned_char swig_types[18]
4011-
#define SWIGTYPE_p_unsigned_int swig_types[19]
4012-
#define SWIGTYPE_p_unsigned_long_long swig_types[20]
4013-
#define SWIGTYPE_p_unsigned_short swig_types[21]
4014-
static swig_type_info *swig_types[23];
4015-
static swig_module_info swig_module = {swig_types, 22, 0, 0, 0, 0};
3993+
#define SWIGTYPE_p_Exiv2__DataBuf swig_types[1]
3994+
#define SWIGTYPE_p_Exiv2__FileIo swig_types[2]
3995+
#define SWIGTYPE_p_Exiv2__HttpIo swig_types[3]
3996+
#define SWIGTYPE_p_Exiv2__MemIo swig_types[4]
3997+
#define SWIGTYPE_p_Exiv2__RemoteIo swig_types[5]
3998+
#define SWIGTYPE_p_Exiv2__XPathIo swig_types[6]
3999+
#define SWIGTYPE_p_SwigPyObject swig_types[7]
4000+
#define SWIGTYPE_p_char swig_types[8]
4001+
#define SWIGTYPE_p_first_type swig_types[9]
4002+
#define SWIGTYPE_p_int swig_types[10]
4003+
#define SWIGTYPE_p_long_long swig_types[11]
4004+
#define SWIGTYPE_p_second_type swig_types[12]
4005+
#define SWIGTYPE_p_short swig_types[13]
4006+
#define SWIGTYPE_p_signed_char swig_types[14]
4007+
#define SWIGTYPE_p_std__pairT_int32_t_int32_t_t swig_types[15]
4008+
#define SWIGTYPE_p_std__pairT_uint32_t_uint32_t_t swig_types[16]
4009+
#define SWIGTYPE_p_unsigned_char swig_types[17]
4010+
#define SWIGTYPE_p_unsigned_int swig_types[18]
4011+
#define SWIGTYPE_p_unsigned_long_long swig_types[19]
4012+
#define SWIGTYPE_p_unsigned_short swig_types[20]
4013+
static swig_type_info *swig_types[22];
4014+
static swig_module_info swig_module = {swig_types, 21, 0, 0, 0, 0};
40164015
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
40174016
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
40184017

@@ -4334,20 +4333,6 @@ static void _set_python_exception() {
43344333
};
43354334

43364335

4337-
#ifndef EXV_USE_CURL
4338-
namespace Exiv2 {
4339-
class CurlIo : public RemoteIo {};
4340-
}
4341-
#endif // EXV_USE_CURL
4342-
4343-
4344-
#ifndef EXV_USE_SSH
4345-
namespace Exiv2 {
4346-
class SshIo : public RemoteIo {};
4347-
}
4348-
#endif // EXV_USE_SSH
4349-
4350-
43514336
#if !EXIV2_TEST_VERSION(0, 28, 3)
43524337
#define EXV_ENABLE_FILESYSTEM
43534338
#endif
@@ -4876,11 +4861,13 @@ SWIGINTERNINLINE PyObject*
48764861
SWIGINTERN char const *Exiv2_BasicIo_ioType(Exiv2::BasicIo *self){
48774862
if (dynamic_cast<Exiv2::MemIo*>(self))
48784863
return "MemIo";
4864+
#ifdef EXV_ENABLE_FILESYSTEM
48794865
else if (dynamic_cast<Exiv2::FileIo*>(self)) {
48804866
if (dynamic_cast<Exiv2::XPathIo*>(self))
48814867
return "XPathIo";
48824868
return "FileIo";
48834869
}
4870+
#endif
48844871
else if (dynamic_cast<Exiv2::RemoteIo*>(self)) {
48854872
if (dynamic_cast<Exiv2::HttpIo*>(self))
48864873
return "HttpIo";
@@ -6437,9 +6424,6 @@ SWIGINTERN SwigPyClientData SwigPyBuiltin__Exiv2__BasicIo_clientdata = {0, 0, 0,
64376424

64386425
/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
64396426

6440-
static void *_p_Exiv2__CurlIoTo_p_Exiv2__BasicIo(void *x, int *SWIGUNUSEDPARM(newmemory)) {
6441-
return (void *)((Exiv2::BasicIo *) (Exiv2::RemoteIo *) ((Exiv2::CurlIo *) x));
6442-
}
64436427
static void *_p_Exiv2__FileIoTo_p_Exiv2__BasicIo(void *x, int *SWIGUNUSEDPARM(newmemory)) {
64446428
return (void *)((Exiv2::BasicIo *) ((Exiv2::FileIo *) x));
64456429
}
@@ -6458,14 +6442,10 @@ static void *_p_Exiv2__XPathIoTo_p_Exiv2__BasicIo(void *x, int *SWIGUNUSEDPARM(n
64586442
static void *_p_Exiv2__XPathIoTo_p_Exiv2__FileIo(void *x, int *SWIGUNUSEDPARM(newmemory)) {
64596443
return (void *)((Exiv2::FileIo *) ((Exiv2::XPathIo *) x));
64606444
}
6461-
static void *_p_Exiv2__CurlIoTo_p_Exiv2__RemoteIo(void *x, int *SWIGUNUSEDPARM(newmemory)) {
6462-
return (void *)((Exiv2::RemoteIo *) ((Exiv2::CurlIo *) x));
6463-
}
64646445
static void *_p_Exiv2__HttpIoTo_p_Exiv2__RemoteIo(void *x, int *SWIGUNUSEDPARM(newmemory)) {
64656446
return (void *)((Exiv2::RemoteIo *) ((Exiv2::HttpIo *) x));
64666447
}
64676448
static swig_type_info _swigt__p_Exiv2__BasicIo = {"_p_Exiv2__BasicIo", "Exiv2::BasicIo *", 0, 0, (void*)&SwigPyBuiltin__Exiv2__BasicIo_clientdata, 0};
6468-
static swig_type_info _swigt__p_Exiv2__CurlIo = {"_p_Exiv2__CurlIo", 0, 0, 0, 0, 0};
64696449
static swig_type_info _swigt__p_Exiv2__HttpIo = {"_p_Exiv2__HttpIo", 0, 0, 0, 0, 0};
64706450
static swig_type_info _swigt__p_Exiv2__MemIo = {"_p_Exiv2__MemIo", 0, 0, 0, 0, 0};
64716451
static swig_type_info _swigt__p_Exiv2__XPathIo = {"_p_Exiv2__XPathIo", 0, 0, 0, 0, 0};
@@ -6489,7 +6469,6 @@ static swig_type_info _swigt__p_unsigned_short = {"_p_unsigned_short", "uint16_t
64896469

64906470
static swig_type_info *swig_type_initial[] = {
64916471
&_swigt__p_Exiv2__BasicIo,
6492-
&_swigt__p_Exiv2__CurlIo,
64936472
&_swigt__p_Exiv2__DataBuf,
64946473
&_swigt__p_Exiv2__FileIo,
64956474
&_swigt__p_Exiv2__HttpIo,
@@ -6512,14 +6491,13 @@ static swig_type_info *swig_type_initial[] = {
65126491
&_swigt__p_unsigned_short,
65136492
};
65146493

6515-
static swig_cast_info _swigc__p_Exiv2__CurlIo[] = {{&_swigt__p_Exiv2__CurlIo, 0, 0, 0},{0, 0, 0, 0}};
65166494
static swig_cast_info _swigc__p_Exiv2__HttpIo[] = {{&_swigt__p_Exiv2__HttpIo, 0, 0, 0},{0, 0, 0, 0}};
65176495
static swig_cast_info _swigc__p_Exiv2__MemIo[] = {{&_swigt__p_Exiv2__MemIo, 0, 0, 0},{0, 0, 0, 0}};
65186496
static swig_cast_info _swigc__p_Exiv2__XPathIo[] = {{&_swigt__p_Exiv2__XPathIo, 0, 0, 0},{0, 0, 0, 0}};
6519-
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}};
6497+
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}};
65206498
static swig_cast_info _swigc__p_Exiv2__DataBuf[] = { {&_swigt__p_Exiv2__DataBuf, 0, 0, 0},{0, 0, 0, 0}};
65216499
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}};
6522-
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}};
6500+
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}};
65236501
static swig_cast_info _swigc__p_SwigPyObject[] = { {&_swigt__p_SwigPyObject, 0, 0, 0},{0, 0, 0, 0}};
65246502
static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
65256503
static swig_cast_info _swigc__p_first_type[] = { {&_swigt__p_first_type, 0, 0, 0},{0, 0, 0, 0}};
@@ -6537,7 +6515,6 @@ static swig_cast_info _swigc__p_unsigned_short[] = { {&_swigt__p_unsigned_short
65376515

65386516
static swig_cast_info *swig_cast_initial[] = {
65396517
_swigc__p_Exiv2__BasicIo,
6540-
_swigc__p_Exiv2__CurlIo,
65416518
_swigc__p_Exiv2__DataBuf,
65426519
_swigc__p_Exiv2__FileIo,
65436520
_swigc__p_Exiv2__HttpIo,

0 commit comments

Comments
 (0)