comparison Sources/Autogenerated/sdk_OrthancPluginWorklistQuery.methods.h @ 129:5643e97d9367 fix-leak

reproducible code generation
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 30 Aug 2023 11:40:22 +0200
parents
children e9be3c9294d4
comparison
equal deleted inserted replaced
128:5b59ebc267e1 129:5643e97d9367
1 // Actual implementation of the methods
2 static PyObject *sdk_OrthancPluginWorklistQuery_OrthancPluginWorklistIsMatch(
3 sdk_OrthancPluginWorklistQuery_Object* self, PyObject *args)
4 {
5 PythonLock::LogCall("Calling method OrthancPluginWorklistIsMatch() on object of class OrthancPluginWorklistQuery");
6
7 if (self->object_ == NULL)
8 {
9 PyErr_SetString(PyExc_ValueError, "Invalid object");
10 return NULL;
11 }
12
13 Py_buffer arg0;
14
15 if (!PyArg_ParseTuple(args, "s*", &arg0))
16 {
17 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
18 return NULL;
19 }
20 long value = OrthancPluginWorklistIsMatch(OrthancPlugins::GetGlobalContext(), self->object_, arg0.buf, arg0.len);
21 PyBuffer_Release(&arg0);
22 return PyLong_FromLong(value);
23 }
24
25 static PyObject *sdk_OrthancPluginWorklistQuery_OrthancPluginWorklistGetDicomQuery(
26 sdk_OrthancPluginWorklistQuery_Object* self, PyObject *args)
27 {
28 PythonLock::LogCall("Calling method OrthancPluginWorklistGetDicomQuery() on object of class OrthancPluginWorklistQuery");
29
30 if (self->object_ == NULL)
31 {
32 PyErr_SetString(PyExc_ValueError, "Invalid object");
33 return NULL;
34 }
35
36
37 OrthancPlugins::MemoryBuffer buffer;
38 OrthancPluginErrorCode code = OrthancPluginWorklistGetDicomQuery(OrthancPlugins::GetGlobalContext(), *buffer, self->object_);
39
40 if (code == OrthancPluginErrorCode_Success)
41 {
42 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize());
43 }
44 else
45 {
46 PythonLock::RaiseException(code);
47 return NULL;
48 }
49 }
50