##// END OF EJS Templates
added PySide/PyQt compatible read/write methods...
florianlink -
r195:c6fc2f0a1749
parent child
Show More
@@ -1823,6 +1823,9
1823 1823 <object-type name="QDynamicPropertyChangeEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DynamicPropertyChange"/>
1824 1824
1825 1825 <object-type name="QDataStream">
1826 <extra-includes>
1827 <include file-name="PythonQtConversion.h" location="global"/>
1828 </extra-includes>
1826 1829 <modify-function signature="setDevice(QIODevice*)">
1827 1830 <modify-argument index="1">
1828 1831 <reference-count action="set" variable-name="__rcDevice"/>
@@ -1880,185 +1883,78
1880 1883 <modify-function signature="operator&gt;&gt;(signed char&amp;)" remove="all"/>
1881 1884 <modify-function signature="operator&lt;&lt;(signed char)" remove="all"/>
1882 1885
1883 <modify-function signature="operator&lt;&lt;(bool)">
1884 <rename to="writeBoolean"/>
1885 <modify-argument index="0" replace-value="this"/>
1886 </modify-function>
1887 <modify-function signature="operator&lt;&lt;(unsigned char)">
1888 <modify-argument index="0" replace-value="this"/>
1889 <rename to="writeByte"/>
1890 </modify-function>
1891 <modify-function signature="operator&lt;&lt;(int)">
1892 <rename to="writeInt"/>
1893 <modify-argument index="0" replace-value="this"/>
1894 </modify-function>
1895 <modify-function signature="operator&lt;&lt;(qint64)">
1896 <rename to="writeLongLong"/>
1897 <modify-argument index="0" replace-value="this"/>
1898 </modify-function>
1899 <modify-function signature="operator&lt;&lt;(float)">
1900 <rename to="writeFloat"/>
1901 <modify-argument index="0" replace-value="this"/>
1902 </modify-function>
1903 <modify-function signature="operator&lt;&lt;(double)">
1904 <rename to="writeDouble"/>
1905 <modify-argument index="0" replace-value="this"/>
1906 </modify-function>
1907 <modify-function signature="operator&lt;&lt;(short)">
1908 <rename to="writeShort"/>
1909 <modify-argument index="0" replace-value="this"/>
1910 </modify-function>
1911
1912 <modify-function signature="operator&gt;&gt;(bool &amp;)">
1913 <rename to="readBoolean"/>
1914 <modify-argument index="1">
1915 <remove-argument/>
1916 <conversion-rule class="native">
1917 bool __result;
1918 bool &amp; %out% = __result;
1919 </conversion-rule>
1920 </modify-argument>
1921 <modify-argument index="0" replace-value="void">
1922 <conversion-rule class="native">
1923 bool %out% = __result;
1924 </conversion-rule>
1925 </modify-argument>
1926 </modify-function>
1927 <modify-function signature="operator&gt;&gt;(unsigned char &amp;)">
1928 <rename to="readByte"/>
1929 <modify-argument index="1">
1930 <remove-argument/>
1931 <conversion-rule class="native">
1932 unsigned char __result;
1933 unsigned char &amp; %out% = __result;
1934 </conversion-rule>
1935 </modify-argument>
1936 <modify-argument index="0" replace-value="void">
1937 <conversion-rule class="native">
1938 int %out% = __result;
1939 </conversion-rule>
1940 </modify-argument>
1941 </modify-function>
1942 <modify-function signature="operator&gt;&gt;(int &amp;)">
1943 <rename to="readInt"/>
1944 <modify-argument index="1">
1945 <remove-argument/>
1946 <conversion-rule class="native">
1947 int __result;
1948 int &amp; %out% = __result;
1949 </conversion-rule>
1950 </modify-argument>
1951 <modify-argument index="0" replace-value="void">
1952 <conversion-rule class="native">
1953 int %out% = __result;
1954 </conversion-rule>
1955 </modify-argument>
1956 </modify-function>
1957 <modify-function signature="operator&gt;&gt;(uint &amp;)">
1958 <rename to="readUInt"/>
1959 <modify-argument index="1">
1960 <remove-argument/>
1961 <conversion-rule class="native">
1962 uint __result;
1963 uint &amp; %out% = __result;
1964 </conversion-rule>
1965 </modify-argument>
1966 <modify-argument index="0" replace-value="void">
1967 <conversion-rule class="native">
1968 uint %out% = __result;
1969 </conversion-rule>
1970 </modify-argument>
1971 </modify-function>
1972 <modify-function signature="operator&gt;&gt;(qint64 &amp;)">
1973 <rename to="readLongLong"/>
1974 <modify-argument index="1">
1975 <remove-argument/>
1976 <conversion-rule class="native">
1977 qint64 __result;
1978 qint64 &amp; %out% = __result;
1979 </conversion-rule>
1980 </modify-argument>
1981 <modify-argument index="0" replace-value="void">
1982 <conversion-rule class="native">
1983 qint64 %out% = __result;
1984 </conversion-rule>
1985 </modify-argument>
1986 </modify-function>
1987 <modify-function signature="operator&gt;&gt;(unsigned long long &amp;)">
1988 <rename to="readULongLong"/>
1989 <modify-argument index="1">
1990 <remove-argument/>
1991 <conversion-rule class="native">
1992 unsigned long long __result;
1993 unsigned long long &amp; %out% = __result;
1994 </conversion-rule>
1995 </modify-argument>
1996 <modify-argument index="0" replace-value="void">
1997 <conversion-rule class="native">
1998 unsigned long long %out% = __result;
1999 </conversion-rule>
2000 </modify-argument>
2001 </modify-function>
2002 <modify-function signature="operator&gt;&gt;(float &amp;)">
2003 <rename to="readFloat"/>
2004 <modify-argument index="1">
2005 <remove-argument/>
2006 <conversion-rule class="native">
2007 float __result;
2008 float &amp; %out% = __result;
2009 </conversion-rule>
2010 </modify-argument>
2011 <modify-argument index="0" replace-value="void">
2012 <conversion-rule class="native">
2013 float %out% = __result;
2014 </conversion-rule>
2015 </modify-argument>
2016 </modify-function>
2017 <modify-function signature="operator&gt;&gt;(double &amp;)">
2018 <rename to="readDouble"/>
2019 <modify-argument index="1">
2020 <remove-argument/>
2021 <conversion-rule class="native">
2022 double __result;
2023 double &amp; %out% = __result;
2024 </conversion-rule>
2025 </modify-argument>
2026 <modify-argument index="0" replace-value="void">
2027 <conversion-rule class="native">
2028 double %out% = __result;
2029 </conversion-rule>
2030 </modify-argument>
2031 </modify-function>
2032 <modify-function signature="operator&gt;&gt;(short &amp;)">
2033 <rename to="readShort"/>
2034 <modify-argument index="1">
2035 <remove-argument/>
2036 <conversion-rule class="native">
2037 short __result;
2038 short &amp; %out% = __result;
2039 </conversion-rule>
2040 </modify-argument>
2041 <modify-argument index="0" replace-value="void">
2042 <conversion-rule class="native">
2043 short %out% = __result;
2044 </conversion-rule>
2045 </modify-argument>
2046 </modify-function>
2047 <modify-function signature="operator&gt;&gt;(unsigned short &amp;)">
2048 <rename to="readUShort"/>
2049 <modify-argument index="1">
2050 <remove-argument/>
2051 <conversion-rule class="native">
2052 unsigned short __result;
2053 unsigned short &amp; %out% = __result;
2054 </conversion-rule>
2055 </modify-argument>
2056 <modify-argument index="0" replace-value="void">
2057 <conversion-rule class="native">
2058 unsigned short %out% = __result;
2059 </conversion-rule>
2060 </modify-argument>
2061 </modify-function>
1886 <modify-function signature="operator&lt;&lt;(bool)" remove="all"/>
1887 <modify-function signature="operator&lt;&lt;(unsigned char)" remove="all"/>
1888 <modify-function signature="operator&lt;&lt;(int)" remove="all"/>
1889 <modify-function signature="operator&lt;&lt;(qint64)" remove="all"/>
1890 <modify-function signature="operator&lt;&lt;(float)" remove="all"/>
1891 <modify-function signature="operator&lt;&lt;(double)" remove="all"/>
1892 <modify-function signature="operator&lt;&lt;(short)" remove="all"/>
1893
1894 <modify-function signature="operator&gt;&gt;(bool &amp;)" remove="all"/>
1895 <modify-function signature="operator&gt;&gt;(unsigned char &amp;)" remove="all"/>
1896 <modify-function signature="operator&gt;&gt;(int &amp;)" remove="all"/>
1897 <modify-function signature="operator&gt;&gt;(uint &amp;)" remove="all"/>
1898 <modify-function signature="operator&gt;&gt;(qint64 &amp;)" remove="all"/>
1899 <modify-function signature="operator&gt;&gt;(unsigned long long &amp;)" remove="all"/>
1900 <modify-function signature="operator&gt;&gt;(float &amp;)" remove="all"/>
1901 <modify-function signature="operator&gt;&gt;(double &amp;)" remove="all"/>
1902 <modify-function signature="operator&gt;&gt;(short &amp;)" remove="all"/>
1903 <modify-function signature="operator&gt;&gt;(unsigned short &amp;)" remove="all"/>
1904
1905 <inject-code class="pywrap-h">
1906 QString readQString(QDataStream* d) { QString r; (*d) &gt;&gt; r; return r; }
1907 QString readString(QDataStream* d) { QString r; (*d) &gt;&gt; r; return r; }
1908 QChar readQChar(QDataStream* d) { QChar r; (*d) &gt;&gt; r; return r; }
1909 QStringList readQStringList(QDataStream* d) { QStringList r; (*d) &gt;&gt; r; return r; }
1910 QVariant readQVariant(QDataStream* d) { QVariant r; (*d) &gt;&gt; r; return r; }
1911 bool readBool(QDataStream* d) { bool r; (*d) &gt;&gt; r; return r; }
1912 qint8 readInt8(QDataStream* d) { qint8 r; (*d) &gt;&gt; r; return r; }
1913 quint8 readUInt8(QDataStream* d) { quint8 r; (*d) &gt;&gt; r; return r; }
1914 qint16 readInt16(QDataStream* d) { qint16 r; (*d) &gt;&gt; r; return r; }
1915 quint16 readUInt16(QDataStream* d) { quint16 r; (*d) &gt;&gt; r; return r; }
1916 qint32 readInt32(QDataStream* d) { qint32 r; (*d) &gt;&gt; r; return r; }
1917 quint32 readUInt32(QDataStream* d) { quint32 r; (*d) &gt;&gt; r; return r; }
1918 qint64 readInt64(QDataStream* d) { qint64 r; (*d) &gt;&gt; r; return r; }
1919 quint64 readUInt64(QDataStream* d) { quint64 r; (*d) &gt;&gt; r; return r; }
1920 float readFloat(QDataStream* d) { float r; (*d) &gt;&gt; r; return r; }
1921 double readDouble(QDataStream* d) { double r; (*d) &gt;&gt; r; return r; }
1922
1923 void writeQString(QDataStream* d, const QString&amp; v) { (*d) &lt;&lt; v; }
1924 void writeString(QDataStream* d, const QString&amp; v) { (*d) &lt;&lt; v; }
1925 void writeQChar(QDataStream* d, const QChar&amp; v) { (*d) &lt;&lt; v; }
1926 void writeQStringList(QDataStream* d, const QStringList&amp; v) { (*d) &lt;&lt; v; }
1927 void writeQVariant(QDataStream* d, const QVariant&amp; v) { (*d) &lt;&lt; v; }
1928 void writeBool(QDataStream* d, bool v) { (*d) &lt;&lt; v; }
1929 void writeInt8(QDataStream* d, qint8 v) { (*d) &lt;&lt; v; }
1930 void writeUInt8(QDataStream* d, quint8 v) { (*d) &lt;&lt; v; }
1931 void writeInt16(QDataStream* d, qint16 v) { (*d) &lt;&lt; v; }
1932 void writeUInt16(QDataStream* d, quint16 v) { (*d) &lt;&lt; v; }
1933 void writeInt32(QDataStream* d, qint32 v) { (*d) &lt;&lt; v; }
1934 void writeUInt32(QDataStream* d, quint32 v) { (*d) &lt;&lt; v; }
1935 void writeInt64(QDataStream* d, qint64 v) { (*d) &lt;&lt; v; }
1936 void writeUInt64(QDataStream* d, quint64 v) { (*d) &lt;&lt; v; }
1937 void writeFloat(QDataStream* d, float v) { (*d) &lt;&lt; v; }
1938 void writeDouble(QDataStream* d, double v) { (*d) &lt;&lt; v; }
1939
1940 int writeRawData(QDataStream* d, PyObject* o) {
1941 bool ok;
1942 QByteArray r = PythonQtConv::PyObjGetBytes(o, false, ok);
1943 return (*d).writeRawData(r.constData(), r.size());
1944 }
1945
1946 PyObject* readRawData(QDataStream* d, int len) {
1947 QByteArray r;
1948 r.resize(len);
1949 int result = d-&gt;readRawData(r.data(), r.size());
1950 if (result&gt;=0) {
1951 return PyString_FromStringAndSize(r.data(), result);
1952 } else {
1953 Py_INCREF(Py_None);
1954 return Py_None;
1955 }
1956 }
1957 </inject-code>
2062 1958 </object-type>
2063 1959
2064 1960 <object-type name="QFSFileEngine">
General Comments 0
You need to be logged in to leave comments. Login now