cartobase  5.0.5
carto::ByteSwapper Class Reference

#include <cartobase/type/byte_order.h>

Public Member Functions

 ByteSwapper (int bo=byteOrder())
 
 ByteSwapper (const std::string &bos)
 
bool isSwapped () const
 
bool setSwapped (bool s)
 
void reorder (short &p) const
 
void reorder (unsigned short &p) const
 
void reorder (int &p) const
 
void reorder (unsigned int &p) const
 
void reorder (long &p) const
 
void reorder (unsigned long &p) const
 
void reorder (long long &p) const
 
void reorder (unsigned long long &p) const
 
void reorder (float &p) const
 
void reorder (double &p) const
 
void reorder (long double &p) const
 
std::istream & read (std::istream &, short &p) const
 
std::istream & read (std::istream &, unsigned short &p) const
 
std::istream & read (std::istream &, int &p) const
 
std::istream & read (std::istream &, unsigned int &p) const
 
std::istream & read (std::istream &, long &p) const
 
std::istream & read (std::istream &, unsigned long &p) const
 
std::istream & read (std::istream &, long long &p) const
 
std::istream & read (std::istream &, unsigned long long &p) const
 
std::istream & read (std::istream &, float &p) const
 
std::istream & read (std::istream &, double &p) const
 
std::istream & read (std::istream &, long double &p) const
 
std::ostream & write (std::ostream &, short &p) const
 
std::ostream & write (std::ostream &, unsigned short &p) const
 
std::ostream & write (std::ostream &, int &p) const
 
std::ostream & write (std::ostream &, unsigned int &p) const
 
std::ostream & write (std::ostream &, long &p) const
 
std::ostream & write (std::ostream &, unsigned long &p) const
 
std::ostream & write (std::ostream &, long long &p) const
 
std::ostream & write (std::ostream &, unsigned long long &p) const
 
std::ostream & write (std::ostream &, float &p) const
 
std::ostream & write (std::ostream &, double &p) const
 
std::ostream & write (std::ostream &, long double &p) const
 

Detailed Description

Definition at line 60 of file byte_order.h.

Constructor & Destructor Documentation

◆ ByteSwapper() [1/2]

carto::ByteSwapper::ByteSwapper ( int  bo = byteOrder())

◆ ByteSwapper() [2/2]

carto::ByteSwapper::ByteSwapper ( const std::string &  bos)

Member Function Documentation

◆ isSwapped()

bool carto::ByteSwapper::isSwapped ( ) const
inline

Definition at line 69 of file byte_order.h.

◆ read() [1/11]

std::istream & carto::ByteSwapper::read ( std::istream &  in,
short &  p 
) const
inline

Definition at line 243 of file byte_order.h.

Referenced by setSwapped().

◆ read() [2/11]

std::istream & carto::ByteSwapper::read ( std::istream &  in,
unsigned short &  p 
) const
inline

Definition at line 253 of file byte_order.h.

◆ read() [3/11]

std::istream & carto::ByteSwapper::read ( std::istream &  in,
int &  p 
) const
inline

Definition at line 263 of file byte_order.h.

◆ read() [4/11]

std::istream & carto::ByteSwapper::read ( std::istream &  in,
unsigned int &  p 
) const
inline

Definition at line 273 of file byte_order.h.

◆ read() [5/11]

std::istream & carto::ByteSwapper::read ( std::istream &  in,
long &  p 
) const
inline

Definition at line 283 of file byte_order.h.

◆ read() [6/11]

std::istream & carto::ByteSwapper::read ( std::istream &  in,
unsigned long &  p 
) const
inline

Definition at line 293 of file byte_order.h.

◆ read() [7/11]

std::istream & carto::ByteSwapper::read ( std::istream &  in,
long long &  p 
) const
inline

Definition at line 303 of file byte_order.h.

◆ read() [8/11]

std::istream & carto::ByteSwapper::read ( std::istream &  in,
unsigned long long &  p 
) const
inline

Definition at line 313 of file byte_order.h.

◆ read() [9/11]

std::istream & carto::ByteSwapper::read ( std::istream &  in,
float &  p 
) const
inline

Definition at line 322 of file byte_order.h.

◆ read() [10/11]

std::istream & carto::ByteSwapper::read ( std::istream &  in,
double &  p 
) const
inline

Definition at line 331 of file byte_order.h.

◆ read() [11/11]

std::istream & carto::ByteSwapper::read ( std::istream &  in,
long double &  p 
) const
inline

Definition at line 341 of file byte_order.h.

◆ reorder() [1/11]

void carto::ByteSwapper::reorder ( short &  p) const
inline

Definition at line 187 of file byte_order.h.

Referenced by setSwapped().

◆ reorder() [2/11]

void carto::ByteSwapper::reorder ( unsigned short &  p) const
inline

Definition at line 192 of file byte_order.h.

◆ reorder() [3/11]

void carto::ByteSwapper::reorder ( int &  p) const
inline

Definition at line 197 of file byte_order.h.

◆ reorder() [4/11]

void carto::ByteSwapper::reorder ( unsigned int &  p) const
inline

Definition at line 202 of file byte_order.h.

◆ reorder() [5/11]

void carto::ByteSwapper::reorder ( long &  p) const
inline

Definition at line 207 of file byte_order.h.

◆ reorder() [6/11]

void carto::ByteSwapper::reorder ( unsigned long &  p) const
inline

Definition at line 212 of file byte_order.h.

◆ reorder() [7/11]

void carto::ByteSwapper::reorder ( long long &  p) const
inline

Definition at line 217 of file byte_order.h.

◆ reorder() [8/11]

void carto::ByteSwapper::reorder ( unsigned long long &  p) const
inline

Definition at line 222 of file byte_order.h.

◆ reorder() [9/11]

void carto::ByteSwapper::reorder ( float &  p) const
inline

Definition at line 227 of file byte_order.h.

◆ reorder() [10/11]

void carto::ByteSwapper::reorder ( double &  p) const
inline

Definition at line 232 of file byte_order.h.

◆ reorder() [11/11]

void carto::ByteSwapper::reorder ( long double &  p) const
inline

Definition at line 237 of file byte_order.h.

◆ setSwapped()

bool carto::ByteSwapper::setSwapped ( bool  s)
inline

Definition at line 70 of file byte_order.h.

References read(), reorder(), and write().

◆ write() [1/11]

std::ostream & carto::ByteSwapper::write ( std::ostream &  out,
short &  p 
) const
inline

Definition at line 351 of file byte_order.h.

Referenced by setSwapped().

◆ write() [2/11]

std::ostream & carto::ByteSwapper::write ( std::ostream &  out,
unsigned short &  p 
) const
inline

Definition at line 361 of file byte_order.h.

◆ write() [3/11]

std::ostream & carto::ByteSwapper::write ( std::ostream &  out,
int &  p 
) const
inline

Definition at line 371 of file byte_order.h.

◆ write() [4/11]

std::ostream & carto::ByteSwapper::write ( std::ostream &  out,
unsigned int &  p 
) const
inline

Definition at line 381 of file byte_order.h.

◆ write() [5/11]

std::ostream & carto::ByteSwapper::write ( std::ostream &  out,
long &  p 
) const
inline

Definition at line 391 of file byte_order.h.

◆ write() [6/11]

std::ostream & carto::ByteSwapper::write ( std::ostream &  out,
unsigned long &  p 
) const
inline

Definition at line 401 of file byte_order.h.

◆ write() [7/11]

std::ostream & carto::ByteSwapper::write ( std::ostream &  out,
long long &  p 
) const
inline

Definition at line 421 of file byte_order.h.

◆ write() [8/11]

std::ostream & carto::ByteSwapper::write ( std::ostream &  out,
unsigned long long &  p 
) const
inline

Definition at line 411 of file byte_order.h.

◆ write() [9/11]

std::ostream & carto::ByteSwapper::write ( std::ostream &  out,
float &  p 
) const
inline

Definition at line 431 of file byte_order.h.

◆ write() [10/11]

std::ostream & carto::ByteSwapper::write ( std::ostream &  out,
double &  p 
) const
inline

Definition at line 441 of file byte_order.h.

◆ write() [11/11]

std::ostream & carto::ByteSwapper::write ( std::ostream &  out,
long double &  p 
) const
inline

Definition at line 451 of file byte_order.h.


The documentation for this class was generated from the following file: