QGIS API Documentation  2.12.0-Lyon
qgswkbptr.cpp
Go to the documentation of this file.
1 #include "qgswkbptr.h"
2 
3 QgsConstWkbPtr::QgsConstWkbPtr( const unsigned char *p ): mEndianSwap( false )
4 {
5  mP = ( unsigned char * ) p;
6 }
7 
9 {
10  if ( !mP )
11  {
12  return QgsWKBTypes::Unknown;
13  }
14 
15  char wkbEndian;
16  ( *this ) >> wkbEndian;
17  mEndianSwap = ( wkbEndian != QgsApplication::endian() );
18 
19  QgsWKBTypes::Type wkbType;
20  ( *this ) >> wkbType;
21  if ( mEndianSwap )
22  {
23  QgsApplication::endian_swap( wkbType );
24  }
25  return wkbType;
26 }
static void endian_swap(T &value)
Swap the endianness of the specified value.
static endian_t endian()
Returns whether this machine uses big or little endian.
QgsWKBTypes::Type readHeader() const
Definition: qgswkbptr.cpp:8
QgsConstWkbPtr(const unsigned char *p)
Definition: qgswkbptr.cpp:3