37#if !defined(Q_MOC_RUN) || defined(ITOMCOMMONQT_MOC)
42 inline ito::int8 getInt8(
const uchar **ppval);
43 inline ito::uint8 getUInt8(
const uchar **ppval);
44 inline ito::int16 getInt16LE(
const uchar **ppval);
45 inline ito::int16 getInt16BE(
const uchar **ppval);
46 inline ito::uint16 getUInt16LE(
const uchar **ppval);
47 inline ito::uint16 getUInt16BE(
const uchar **ppval);
48 inline ito::int32 getInt32LE(
const uchar **ppval);
49 inline ito::int16 getInt16BE(
const uchar **ppval);
50 inline ito::uint32 getUInt32LE(
const uchar **ppval);
51 inline ito::uint32 getUInt32BE(
const uchar **ppval);
52 inline qint64 getInt64LE(
const uchar **ppval);
53 inline qint64 getInt64BE(
const uchar **ppval);
54 inline quint64 getUInt64LE(
const uchar **ppval);
55 inline quint64 getUInt64BE(
const uchar **ppval);
56 inline ito::float32 getFloat32LE(
const uchar **ppval);
57 inline ito::float32 getFloat32BE(
const uchar **ppval);
58 inline ito::float64 getFloat64LE(
const uchar **ppval);
59 inline ito::float64 getFloat64BE(
const uchar **ppval);
61 inline ito::int16 swapInt16(ito::int16 val);
62 inline ito::uint16 swapUInt16(ito::uint16 val);
63 inline ito::int32 swapInt32(ito::int32 val);
64 inline ito::uint32 swapUInt32(ito::uint32 val);
65 inline ito::float32 swapFloat32(ito::float32 val);
69 ito::RetVal ITOMCOMMONQT_EXPORT readFromDevice(QIODevice *device,
char *data, qint64 numBytes);
74 inline ito::int8 getInt8(
const uchar **ppval)
76 const ito::int8 *pval = (
const ito::int8*)(*ppval);
78 *ppval +=
sizeof(ito::uint8);
83 inline ito::uint8 getUInt8(
const uchar **ppval)
85 const ito::uint8 *pval = (
const ito::uint8*)(*ppval);
87 *ppval +=
sizeof(ito::uint8);
92 inline ito::int16 getInt16LE(
const uchar **ppval)
94 const ito::int16 *pval = (
const ito::int16*)(*ppval);
95 ito::int16 v = qFromLittleEndian(*pval);
96 *ppval +=
sizeof(ito::int16);
101 inline ito::int16 getInt16BE(
const uchar **ppval)
103 const ito::int16 *pval = (
const ito::int16*)(*ppval);
104 ito::int16 v = qFromBigEndian(*pval);
105 *ppval +=
sizeof(ito::int16);
110 inline ito::uint16 getUInt16LE(
const uchar **ppval)
112 const ito::uint16 *pval = (
const ito::uint16*)(*ppval);
113 ito::uint16 v = qFromLittleEndian(*pval);
114 *ppval +=
sizeof(ito::uint16);
119 inline ito::uint16 getUInt16BE(
const uchar **ppval)
121 const ito::uint16 *pval = (
const ito::uint16*)(*ppval);
122 ito::uint16 v = qFromBigEndian(*pval);
123 *ppval +=
sizeof(ito::uint16);
128 inline ito::int32 getInt32LE(
const uchar **ppval)
130 const ito::int32 *pval = (
const ito::int32*)(*ppval);
131 ito::int32 v = qFromLittleEndian(*pval);
132 *ppval +=
sizeof(ito::int32);
137 inline ito::int32 getInt32BE(
const uchar **ppval)
139 const ito::int32 *pval = (
const ito::int32*)(*ppval);
140 ito::int32 v = qFromBigEndian(*pval);
141 *ppval +=
sizeof(ito::int32);
146 inline ito::uint32 getUInt32LE(
const uchar **ppval)
148 const ito::uint32 *pval = (
const ito::uint32*)(*ppval);
149 ito::uint32 v = qFromLittleEndian(*pval);
150 *ppval +=
sizeof(ito::uint32);
155 inline ito::uint32 getUInt32BE(
const uchar **ppval)
157 const ito::uint32 *pval = (
const ito::uint32*)(*ppval);
158 ito::uint32 v = qFromBigEndian(*pval);
159 *ppval +=
sizeof(ito::uint32);
164 inline qint64 getInt64LE(
const uchar **ppval)
166 const qint64 *pval = (
const qint64*)(*ppval);
167 qint64 v = qFromLittleEndian(*pval);
168 *ppval +=
sizeof(qint64);
173 inline qint64 getInt64BE(
const uchar **ppval)
175 const qint64 *pval = (
const qint64*)(*ppval);
176 qint64 v = qFromBigEndian(*pval);
177 *ppval +=
sizeof(qint64);
182 inline quint64 getUInt64LE(
const uchar **ppval)
184 const quint64 *pval = (
const quint64*)(*ppval);
185 quint64 v = qFromLittleEndian(*pval);
186 *ppval +=
sizeof(quint64);
191 inline quint64 getUInt64BE(
const uchar **ppval)
193 const quint64 *pval = (
const quint64*)(*ppval);
194 quint64 v = qFromBigEndian(*pval);
195 *ppval +=
sizeof(quint64);
200 inline ito::float32 getFloat32LE(
const uchar **ppval)
208#if (Q_BYTE_ORDER == Q_LITTLE_ENDIAN)
209 memcpy(z.pp, *ppval,
sizeof(ito::float32));
211 z.pp[0] = (*ppval)[3];
212 z.pp[1] = (*ppval)[2];
213 z.pp[2] = (*ppval)[1];
214 z.pp[3] = (*ppval)[0];
216 *ppval +=
sizeof(ito::float32);
221 inline ito::float32 getFloat32BE(
const uchar **ppval)
229#if (Q_BYTE_ORDER == Q_BIG_ENDIAN)
230 memcpy(z.pp, *ppval,
sizeof(ito::float32));
232 z.pp[0] = (*ppval)[3];
233 z.pp[1] = (*ppval)[2];
234 z.pp[2] = (*ppval)[1];
235 z.pp[3] = (*ppval)[0];
237 *ppval +=
sizeof(ito::float32);
242 inline ito::float64 getFloat64LE(
const uchar **ppval)
250#if (Q_BYTE_ORDER == Q_LITTLE_ENDIAN)
251 memcpy(z.pp, *ppval,
sizeof(ito::float64));
253 z.pp[0] = (*ppval)[7];
254 z.pp[1] = (*ppval)[6];
255 z.pp[2] = (*ppval)[5];
256 z.pp[3] = (*ppval)[4];
257 z.pp[4] = (*ppval)[3];
258 z.pp[5] = (*ppval)[2];
259 z.pp[6] = (*ppval)[1];
260 z.pp[7] = (*ppval)[0];
262 *ppval +=
sizeof(ito::float64);
267 inline ito::float64 getFloat64BE(
const uchar **ppval)
275#if (Q_BYTE_ORDER == Q_BIG_ENDIAN)
276 memcpy(z.pp, *ppval,
sizeof(ito::float64));
278 z.pp[0] = (*ppval)[7];
279 z.pp[1] = (*ppval)[6];
280 z.pp[2] = (*ppval)[5];
281 z.pp[3] = (*ppval)[4];
282 z.pp[4] = (*ppval)[3];
283 z.pp[5] = (*ppval)[2];
284 z.pp[6] = (*ppval)[1];
285 z.pp[7] = (*ppval)[0];
287 *ppval +=
sizeof(ito::float64);
296 inline ito::uint16 swapUInt16(ito::uint16 val)
305 for (
int teller = 0; teller<2; ++teller){
306 uint16out.sa[teller] = temp.sa[1 - teller];
308 return uint16out.res;
312 inline ito::int16 swapInt16(ito::int16 val)
321 for (
int teller = 0; teller<2; ++teller){
322 int16out.sa[teller] = temp.sa[1 - teller];
328 inline ito::uint32 swapUInt32(ito::uint32 val)
337 for (
int teller = 0; teller<4; ++teller){
338 uint32out.sa[teller] = temp.sa[3 - teller];
340 return uint32out.res;
344 inline ito::int32 swapInt32(ito::int32 val)
353 for (
int teller = 0; teller<4; ++teller){
354 int32out.sa[teller] = temp.sa[3 - teller];
360 inline ito::float32 swapFloat32(ito::float32 val)
370 float32out.pp[0] = temp.pp[3];
371 float32out.pp[1] = temp.pp[2];
372 float32out.pp[2] = temp.pp[1];
373 float32out.pp[3] = temp.pp[0];
388 float64out.pp[0] = temp.pp[7];
389 float64out.pp[1] = temp.pp[6];
390 float64out.pp[2] = temp.pp[5];
391 float64out.pp[3] = temp.pp[4];
392 float64out.pp[4] = temp.pp[3];
393 float64out.pp[5] = temp.pp[2];
394 float64out.pp[6] = temp.pp[1];
395 float64out.pp[7] = temp.pp[0];
Class for managing status values (like errors or warning)
Definition retVal.h:54
Definition apiFunctionsGraph.cpp:40
ito::float64 swapFloat64(ito::float64 val)
reads exactly numBytes from device into data and returns an error if less or no data is available
Definition fileUtils.h:378