aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/PySide6/templates/common.xml
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside6/PySide6/templates/common.xml')
-rw-r--r--sources/pyside6/PySide6/templates/common.xml27
1 files changed, 27 insertions, 0 deletions
diff --git a/sources/pyside6/PySide6/templates/common.xml b/sources/pyside6/PySide6/templates/common.xml
new file mode 100644
index 000000000..44ed931e7
--- /dev/null
+++ b/sources/pyside6/PySide6/templates/common.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+-->
+<typesystem>
+ <template name="const_char_pybuffer">
+ PyObject *%out = Shiboken::Buffer::newObject(%in, size);
+ </template>
+
+ <template name="pybuffer_const_char">
+ Py_ssize_t bufferLen;
+ char *%out = reinterpret_cast&lt;char*&gt;(Shiboken::Buffer::getPointer(%PYARG_1, &amp;bufferLen));
+ </template>
+
+ <template name="uint_remove">
+ uint %out = bufferLen;
+ </template>
+
+ <template name="pybytes_const_uchar">
+ const uchar *%out = reinterpret_cast&lt;const uchar*>(PyBytes_AS_STRING(%PYARG_1));
+ </template>
+
+ <template name="pybytes_uint">
+ uint %out = static_cast&lt;uint>(PyBytes_Size(%PYARG_1));
+ </template>
+</typesystem>