Skip to content

Commit 6d331e6

Browse files
Remove redundant XmpArrayValue.__getitem__ method
1 parent a5a40f1 commit 6d331e6

3 files changed

Lines changed: 7 additions & 90 deletions

File tree

src/interface/value.i

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ RAW_STRING_DATA(Exiv2::XmpTextValue)
515515
%feature("python:slot", "sq_length", functype="lenfunc")
516516
Exiv2::XmpArrayValue::count;
517517
%feature("python:slot", "sq_item", functype="ssizeargfunc")
518-
Exiv2::XmpArrayValue::__getitem__;
518+
Exiv2::XmpArrayValue::toString;
519519
%typemap(default) Exiv2::TypeId typeId_xmpBag {$1 = Exiv2::xmpBag;}
520520
%template() std::vector<std::string>;
521521
%extend Exiv2::XmpArrayValue {
@@ -537,9 +537,6 @@ RAW_STRING_DATA(Exiv2::XmpTextValue)
537537
XmpArrayValue(Exiv2::TypeId typeId_xmpBag) {
538538
return new Exiv2::XmpArrayValue(typeId_xmpBag);
539539
}
540-
std::string __getitem__(long idx) {
541-
return $self->toString(idx);
542-
}
543540
PyObject* append(std::string value) {
544541
int error = $self->read(value);
545542
if (error)

src/swig-0_27_7/value_wrap.cxx

Lines changed: 3 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -6476,9 +6476,6 @@ SWIGINTERN Exiv2::XmpArrayValue *new_Exiv2_XmpArrayValue__SWIG_0(std::vector< st
64766476
SWIGINTERN Exiv2::XmpArrayValue *new_Exiv2_XmpArrayValue__SWIG_1(Exiv2::TypeId typeId_xmpBag){
64776477
return new Exiv2::XmpArrayValue(typeId_xmpBag);
64786478
}
6479-
SWIGINTERN std::string Exiv2_XmpArrayValue___getitem__(Exiv2::XmpArrayValue *self,long idx){
6480-
return self->toString(idx);
6481-
}
64826479
SWIGINTERN PyObject *Exiv2_XmpArrayValue_append(Exiv2::XmpArrayValue *self,std::string value){
64836480
int error = self->read(value);
64846481
if (error)
@@ -12075,42 +12072,6 @@ SWIGINTERN int _wrap_new_XmpArrayValue(PyObject *self, PyObject *args, PyObject
1207512072
}
1207612073

1207712074

12078-
SWIGINTERN PyObject *_wrap_XmpArrayValue___getitem__(PyObject *self, PyObject *args) {
12079-
PyObject *resultobj = 0;
12080-
Exiv2::XmpArrayValue *arg1 = (Exiv2::XmpArrayValue *) 0 ;
12081-
long arg2 ;
12082-
void *argp1 = 0 ;
12083-
int res1 = 0 ;
12084-
long val2 ;
12085-
int ecode2 = 0 ;
12086-
PyObject * obj1 = 0 ;
12087-
std::string result;
12088-
12089-
if (!PyArg_UnpackTuple(args, "XmpArrayValue___getitem__", 1, 1, &obj1)) SWIG_fail;
12090-
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Exiv2__XmpArrayValue, 0 | 0 );
12091-
if (!SWIG_IsOK(res1)) {
12092-
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "XmpArrayValue___getitem__" "', argument " "1"" of type '" "Exiv2::XmpArrayValue *""'");
12093-
}
12094-
arg1 = reinterpret_cast< Exiv2::XmpArrayValue * >(argp1);
12095-
ecode2 = SWIG_AsVal_long(obj1, &val2);
12096-
if (!SWIG_IsOK(ecode2)) {
12097-
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "XmpArrayValue___getitem__" "', argument " "2"" of type '" "long""'");
12098-
}
12099-
arg2 = static_cast< long >(val2);
12100-
12101-
if (arg2 < 0 || arg2 >= static_cast< long >(arg1->count())) {
12102-
PyErr_Format(PyExc_IndexError, "index %d out of range", arg2);
12103-
SWIG_fail;
12104-
}
12105-
12106-
result = Exiv2_XmpArrayValue___getitem__(arg1,arg2);
12107-
resultobj = SWIG_From_std_string(static_cast< std::string >(result));
12108-
return resultobj;
12109-
fail:
12110-
return NULL;
12111-
}
12112-
12113-
1211412075
SWIGINTERN PyObject *_wrap_XmpArrayValue_append(PyObject *self, PyObject *args) {
1211512076
PyObject *resultobj = 0;
1211612077
Exiv2::XmpArrayValue *arg1 = (Exiv2::XmpArrayValue *) 0 ;
@@ -12165,7 +12126,7 @@ SWIGINTERN PyObject *_wrap_delete_XmpArrayValue(PyObject *self, PyObject *args)
1216512126

1216612127
SWIGPY_LENFUNC_CLOSURE(_wrap_XmpArrayValue_count) /* defines _wrap_XmpArrayValue_count_lenfunc_closure */
1216712128

12168-
SWIGPY_SSIZEARGFUNC_CLOSURE(_wrap_XmpArrayValue___getitem__) /* defines _wrap_XmpArrayValue___getitem___ssizeargfunc_closure */
12129+
SWIGPY_SSIZEARGFUNC_CLOSURE(_wrap_XmpArrayValue_toString) /* defines _wrap_XmpArrayValue_toString_ssizeargfunc_closure */
1216912130

1217012131
SWIGPY_DESTRUCTOR_CLOSURE(_wrap_delete_XmpArrayValue) /* defines _wrap_delete_XmpArrayValue_destructor_closure */
1217112132

@@ -27959,7 +27920,6 @@ SWIGINTERN PyMethodDef SwigPyBuiltin__Exiv2__XmpArrayValue_methods[] = {
2795927920
"Notes: The output of this method cannot directly be used as the parameter\n"
2796027921
" for read().\n"
2796127922
"" },
27962-
{ "__getitem__", _wrap_XmpArrayValue___getitem__, METH_VARARGS, "" },
2796327923
{ "append", _wrap_XmpArrayValue_append, METH_VARARGS, "" },
2796427924
{ NULL, NULL, 0, NULL } /* Sentinel */
2796527925
};
@@ -28138,7 +28098,7 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__XmpArrayValue_type = {
2813828098
_wrap_XmpArrayValue_count_lenfunc_closure, /* sq_length */
2813928099
(binaryfunc) 0, /* sq_concat */
2814028100
(ssizeargfunc) 0, /* sq_repeat */
28141-
_wrap_XmpArrayValue___getitem___ssizeargfunc_closure, /* sq_item */
28101+
_wrap_XmpArrayValue_toString_ssizeargfunc_closure, /* sq_item */
2814228102
#if PY_VERSION_HEX >= 0x03000000
2814328103
(void *) 0, /* was_sq_slice */
2814428104
#else
@@ -28280,7 +28240,7 @@ static PyTypeObject *SwigPyBuiltin__Exiv2__XmpArrayValue_type_create(PyTypeObjec
2828028240
{ Py_sq_length, (void *)_wrap_XmpArrayValue_count_lenfunc_closure },
2828128241
{ Py_sq_concat, (void *)(binaryfunc) 0 },
2828228242
{ Py_sq_repeat, (void *)(ssizeargfunc) 0 },
28283-
{ Py_sq_item, (void *)_wrap_XmpArrayValue___getitem___ssizeargfunc_closure },
28243+
{ Py_sq_item, (void *)_wrap_XmpArrayValue_toString_ssizeargfunc_closure },
2828428244
{ Py_sq_ass_item, (void *)(ssizeobjargproc) 0 },
2828528245
{ Py_sq_contains, (void *)(objobjproc) 0 },
2828628246
{ Py_sq_inplace_concat, (void *)(binaryfunc) 0 },

src/swig-0_28_5/value_wrap.cxx

Lines changed: 3 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -6646,9 +6646,6 @@ SWIGINTERN Exiv2::XmpArrayValue *new_Exiv2_XmpArrayValue__SWIG_0(std::vector< st
66466646
SWIGINTERN Exiv2::XmpArrayValue *new_Exiv2_XmpArrayValue__SWIG_1(Exiv2::TypeId typeId_xmpBag){
66476647
return new Exiv2::XmpArrayValue(typeId_xmpBag);
66486648
}
6649-
SWIGINTERN std::string Exiv2_XmpArrayValue___getitem__(Exiv2::XmpArrayValue *self,long idx){
6650-
return self->toString(idx);
6651-
}
66526649
SWIGINTERN PyObject *Exiv2_XmpArrayValue_append(Exiv2::XmpArrayValue *self,std::string value){
66536650
int error = self->read(value);
66546651
if (error)
@@ -12393,42 +12390,6 @@ SWIGINTERN int _wrap_new_XmpArrayValue(PyObject *self, PyObject *args, PyObject
1239312390
}
1239412391

1239512392

12396-
SWIGINTERN PyObject *_wrap_XmpArrayValue___getitem__(PyObject *self, PyObject *args) {
12397-
PyObject *resultobj = 0;
12398-
Exiv2::XmpArrayValue *arg1 = (Exiv2::XmpArrayValue *) 0 ;
12399-
long arg2 ;
12400-
void *argp1 = 0 ;
12401-
int res1 = 0 ;
12402-
long val2 ;
12403-
int ecode2 = 0 ;
12404-
PyObject * obj1 = 0 ;
12405-
std::string result;
12406-
12407-
if (!PyArg_UnpackTuple(args, "XmpArrayValue___getitem__", 1, 1, &obj1)) SWIG_fail;
12408-
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Exiv2__XmpArrayValue, 0 | 0 );
12409-
if (!SWIG_IsOK(res1)) {
12410-
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "XmpArrayValue___getitem__" "', argument " "1"" of type '" "Exiv2::XmpArrayValue *""'");
12411-
}
12412-
arg1 = reinterpret_cast< Exiv2::XmpArrayValue * >(argp1);
12413-
ecode2 = SWIG_AsVal_long(obj1, &val2);
12414-
if (!SWIG_IsOK(ecode2)) {
12415-
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "XmpArrayValue___getitem__" "', argument " "2"" of type '" "long""'");
12416-
}
12417-
arg2 = static_cast< long >(val2);
12418-
12419-
if (arg2 < 0 || arg2 >= static_cast< long >(arg1->count())) {
12420-
PyErr_Format(PyExc_IndexError, "index %d out of range", arg2);
12421-
SWIG_fail;
12422-
}
12423-
12424-
result = Exiv2_XmpArrayValue___getitem__(arg1,arg2);
12425-
resultobj = SWIG_From_std_string(static_cast< std::string >(result));
12426-
return resultobj;
12427-
fail:
12428-
return NULL;
12429-
}
12430-
12431-
1243212393
SWIGINTERN PyObject *_wrap_XmpArrayValue_append(PyObject *self, PyObject *args) {
1243312394
PyObject *resultobj = 0;
1243412395
Exiv2::XmpArrayValue *arg1 = (Exiv2::XmpArrayValue *) 0 ;
@@ -12483,7 +12444,7 @@ SWIGINTERN PyObject *_wrap_delete_XmpArrayValue(PyObject *self, PyObject *args)
1248312444

1248412445
SWIGPY_LENFUNC_CLOSURE(_wrap_XmpArrayValue_count) /* defines _wrap_XmpArrayValue_count_lenfunc_closure */
1248512446

12486-
SWIGPY_SSIZEARGFUNC_CLOSURE(_wrap_XmpArrayValue___getitem__) /* defines _wrap_XmpArrayValue___getitem___ssizeargfunc_closure */
12447+
SWIGPY_SSIZEARGFUNC_CLOSURE(_wrap_XmpArrayValue_toString) /* defines _wrap_XmpArrayValue_toString_ssizeargfunc_closure */
1248712448

1248812449
SWIGPY_DESTRUCTOR_CLOSURE(_wrap_delete_XmpArrayValue) /* defines _wrap_delete_XmpArrayValue_destructor_closure */
1248912450

@@ -28369,7 +28330,6 @@ SWIGINTERN PyMethodDef SwigPyBuiltin__Exiv2__XmpArrayValue_methods[] = {
2836928330
"Notes: The output of this method cannot directly be used as the parameter\n"
2837028331
" for read().\n"
2837128332
"" },
28372-
{ "__getitem__", _wrap_XmpArrayValue___getitem__, METH_VARARGS, "" },
2837328333
{ "append", _wrap_XmpArrayValue_append, METH_VARARGS, "" },
2837428334
{ NULL, NULL, 0, NULL } /* Sentinel */
2837528335
};
@@ -28548,7 +28508,7 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__XmpArrayValue_type = {
2854828508
_wrap_XmpArrayValue_count_lenfunc_closure, /* sq_length */
2854928509
(binaryfunc) 0, /* sq_concat */
2855028510
(ssizeargfunc) 0, /* sq_repeat */
28551-
_wrap_XmpArrayValue___getitem___ssizeargfunc_closure, /* sq_item */
28511+
_wrap_XmpArrayValue_toString_ssizeargfunc_closure, /* sq_item */
2855228512
#if PY_VERSION_HEX >= 0x03000000
2855328513
(void *) 0, /* was_sq_slice */
2855428514
#else
@@ -28690,7 +28650,7 @@ static PyTypeObject *SwigPyBuiltin__Exiv2__XmpArrayValue_type_create(PyTypeObjec
2869028650
{ Py_sq_length, (void *)_wrap_XmpArrayValue_count_lenfunc_closure },
2869128651
{ Py_sq_concat, (void *)(binaryfunc) 0 },
2869228652
{ Py_sq_repeat, (void *)(ssizeargfunc) 0 },
28693-
{ Py_sq_item, (void *)_wrap_XmpArrayValue___getitem___ssizeargfunc_closure },
28653+
{ Py_sq_item, (void *)_wrap_XmpArrayValue_toString_ssizeargfunc_closure },
2869428654
{ Py_sq_ass_item, (void *)(ssizeobjargproc) 0 },
2869528655
{ Py_sq_contains, (void *)(objobjproc) 0 },
2869628656
{ Py_sq_inplace_concat, (void *)(binaryfunc) 0 },

0 commit comments

Comments
 (0)