18 #include "qgis_core.h" 44 mutable unsigned char *mP;
45 unsigned char *mStart;
48 void verifyBound(
int size )
const;
50 template<
typename T>
void read( T &v )
const 52 verifyBound(
sizeof v );
53 memcpy( &v, mP,
sizeof v );
57 template<
typename T>
void write( T &v )
const 59 verifyBound(
sizeof v );
60 memcpy( mP, &v,
sizeof v );
64 void write(
const QByteArray &data )
const 66 verifyBound( data.length() );
67 memcpy( mP, data.constData(), data.length() );
101 inline operator unsigned char *()
const {
return mP; }
SIP_SKIP 130 mutable unsigned char *
mP;
139 void verifyBound(
int size )
const SIP_SKIP;
145 template<
typename T>
void read( T &v )
const SIP_SKIP
147 verifyBound(
sizeof v );
148 memcpy( &v, mP,
sizeof( v ) );
176 inline void operator+=(
int n ) { verifyBound( n ); mP += n; } SIP_SKIP
179 inline operator const unsigned char *()
const {
return mP; } SIP_SKIP
185 inline int remaining()
const {
return mEnd - mP; } SIP_SKIP
188 template<
typename T>
void endian_swap( T &value )
const SIP_SKIP
190 char *data =
reinterpret_cast<char *
>( &value );
191 std::size_t n =
sizeof( value );
192 for ( std::size_t i = 0, m = n / 2; i < m; ++i )
194 std::swap( data[i], data[n - 1 - i] );
199 #endif // QGSWKBPTR_H const QgsWkbPtr & operator>>(int &v) const
const QgsWkbPtr & operator>>(double &v) const
int remaining() const
remaining
QgsWkbException(QString const &what)
const QgsConstWkbPtr & operator>>(char &v) const
QgsWkbPtr & operator<<(const QByteArray &data)
Append data from a byte array.
QgsWkbPtr & operator<<(QgsWkbTypes::Type v)
Writes a WKB type value to the pointer.
const QgsConstWkbPtr & operator>>(float &r) const
QDataStream & operator>>(QDataStream &in, QgsFeature &feature)
Reads a feature from stream in into feature. QGIS version compatibility is not guaranteed.
const QgsWkbPtr & operator>>(float &r) const
QgsWkbPtr & operator<<(unsigned int v)
Writes an unsigned int to the pointer.
QgsWkbPtr & operator<<(int v)
Writes an int to the pointer.
int writtenSize() const
writtenSize
const QgsWkbPtr & operator>>(char &v) const
Type
The WKB type describes the number of dimensions a geometry has.
const QgsConstWkbPtr & operator>>(double &v) const
QgsWkbTypes::Type mWkbType
Custom exception class for Wkb related exceptions.
QgsWkbPtr & operator<<(float r)
Writes a float to the pointer.
int remaining() const
remaining
const QgsConstWkbPtr & operator>>(int &v) const
const QgsConstWkbPtr & operator>>(unsigned int &v) const
QgsWkbPtr & operator<<(char v)
Writes a char to the pointer.
const QgsWkbPtr & operator>>(unsigned int &v) const
void read(T &v) const
Read a value.
Defines a QGIS exception class.
const QgsWkbPtr & operator>>(QgsWkbTypes::Type &v) const
QgsWkbPtr & operator<<(double v)
Writes a double to the pointer.