comparison Sources/Autogenerated/sdk_OrthancPluginStorageArea.impl.h @ 131:c55b0583084b

integration fix-leak->mainline
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 30 Aug 2023 11:52:45 +0200
parents 65ec5597ec70 5643e97d9367
children 71d305c29cfa
comparison
equal deleted inserted replaced
130:a3f77cf16396 131:c55b0583084b
88 }; 88 };
89 89
90 90
91 91
92 92
93 // Actual implementation of the methods
94 static PyObject *sdk_OrthancPluginStorageArea_OrthancPluginStorageAreaCreate(
95 sdk_OrthancPluginStorageArea_Object* self, PyObject *args)
96 {
97 PythonLock::LogCall("Calling method OrthancPluginStorageAreaCreate() on object of class OrthancPluginStorageArea");
98
99 if (self->object_ == NULL)
100 {
101 PyErr_SetString(PyExc_ValueError, "Invalid object");
102 return NULL;
103 }
104
105 const char* arg0 = NULL;
106 Py_buffer arg1;
107 unsigned long long arg2 = 0;
108 long int arg3 = 0;
109
110 if (!PyArg_ParseTuple(args, "ss*Kl", &arg0, &arg1, &arg2, &arg3))
111 {
112 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (4 arguments expected)");
113 return NULL;
114 }
115 OrthancPluginErrorCode code = OrthancPluginStorageAreaCreate(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1.buf, arg2, static_cast<OrthancPluginContentType>(arg3));
116 PyBuffer_Release(&arg1);
117
118 if (code == OrthancPluginErrorCode_Success)
119 {
120 Py_INCREF(Py_None);
121 return Py_None;
122 }
123 else
124 {
125 PythonLock::RaiseException(code);
126 return NULL;
127 }
128 }
129
130 static PyObject *sdk_OrthancPluginStorageArea_OrthancPluginStorageAreaRead(
131 sdk_OrthancPluginStorageArea_Object* self, PyObject *args)
132 {
133 PythonLock::LogCall("Calling method OrthancPluginStorageAreaRead() on object of class OrthancPluginStorageArea");
134
135 if (self->object_ == NULL)
136 {
137 PyErr_SetString(PyExc_ValueError, "Invalid object");
138 return NULL;
139 }
140
141 const char* arg0 = NULL;
142 long int arg1 = 0;
143
144 if (!PyArg_ParseTuple(args, "sl", &arg0, &arg1))
145 {
146 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
147 return NULL;
148 }
149 OrthancPlugins::MemoryBuffer buffer;
150 OrthancPluginErrorCode code = OrthancPluginStorageAreaRead(OrthancPlugins::GetGlobalContext(), *buffer, self->object_, arg0, static_cast<OrthancPluginContentType>(arg1));
151
152 if (code == OrthancPluginErrorCode_Success)
153 {
154 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize());
155 }
156 else
157 {
158 PythonLock::RaiseException(code);
159 return NULL;
160 }
161 }
162
163 static PyObject *sdk_OrthancPluginStorageArea_OrthancPluginStorageAreaRemove(
164 sdk_OrthancPluginStorageArea_Object* self, PyObject *args)
165 {
166 PythonLock::LogCall("Calling method OrthancPluginStorageAreaRemove() on object of class OrthancPluginStorageArea");
167
168 if (self->object_ == NULL)
169 {
170 PyErr_SetString(PyExc_ValueError, "Invalid object");
171 return NULL;
172 }
173
174 const char* arg0 = NULL;
175 long int arg1 = 0;
176
177 if (!PyArg_ParseTuple(args, "sl", &arg0, &arg1))
178 {
179 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
180 return NULL;
181 }
182 OrthancPluginErrorCode code = OrthancPluginStorageAreaRemove(OrthancPlugins::GetGlobalContext(), self->object_, arg0, static_cast<OrthancPluginContentType>(arg1));
183
184
185 if (code == OrthancPluginErrorCode_Success)
186 {
187 Py_INCREF(Py_None);
188 return Py_None;
189 }
190 else
191 {
192 PythonLock::RaiseException(code);
193 return NULL;
194 }
195 }
196
197 static PyObject *sdk_OrthancPluginStorageArea_OrthancPluginReconstructMainDicomTags(
198 sdk_OrthancPluginStorageArea_Object* self, PyObject *args)
199 {
200 PythonLock::LogCall("Calling method OrthancPluginReconstructMainDicomTags() on object of class OrthancPluginStorageArea");
201
202 if (self->object_ == NULL)
203 {
204 PyErr_SetString(PyExc_ValueError, "Invalid object");
205 return NULL;
206 }
207
208 long int arg0 = 0;
209
210 if (!PyArg_ParseTuple(args, "l", &arg0))
211 {
212 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
213 return NULL;
214 }
215 OrthancPluginErrorCode code = OrthancPluginReconstructMainDicomTags(OrthancPlugins::GetGlobalContext(), self->object_, static_cast<OrthancPluginResourceType>(arg0));
216
217
218 if (code == OrthancPluginErrorCode_Success)
219 {
220 Py_INCREF(Py_None);
221 return Py_None;
222 }
223 else
224 {
225 PythonLock::RaiseException(code);
226 return NULL;
227 }
228 }
229
230
231
232 static void RegisterOrthancPluginStorageAreaClass(PyObject* module) 93 static void RegisterOrthancPluginStorageAreaClass(PyObject* module)
233 { 94 {
234 sdk_OrthancPluginStorageArea_Type.tp_new = PyType_GenericNew; 95 sdk_OrthancPluginStorageArea_Type.tp_new = PyType_GenericNew;
235 sdk_OrthancPluginStorageArea_Type.tp_flags = Py_TPFLAGS_DEFAULT; 96 sdk_OrthancPluginStorageArea_Type.tp_flags = Py_TPFLAGS_DEFAULT;
236 sdk_OrthancPluginStorageArea_Type.tp_doc = "Generated from Orthanc C class: OrthancPluginStorageArea"; 97 sdk_OrthancPluginStorageArea_Type.tp_doc = "Generated from Orthanc C class: OrthancPluginStorageArea";