Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
gnsstk::BinexData::UBNXI Class Reference

Detailed Description

An unsigned integer stored using 1, 2, 3, or 4 bytes to represent integers from 0 to 536870911; used to represent BINEX record IDs, subrecord IDs, field IDs, and so on.

Definition at line 96 of file BinexData.hpp.

#include <BinexData.hpp>

Public Member Functions

size_t decode (const std::string &inBuffer, size_t offset=0, bool littleEndian=false)
 
size_t encode (std::string &outBuffer, size_t offset=0, bool littleEndian=false) const
 
size_t getSize () const
 
 operator unsigned long () const
 
bool operator!= (const UBNXI &other) const
 
bool operator< (const UBNXI &other) const
 
bool operator<= (const UBNXI &other) const
 
UBNXIoperator= (const UBNXI &right)
 
bool operator== (const UBNXI &other) const
 
bool operator> (const UBNXI &other) const
 
bool operator>= (const UBNXI &other) const
 
size_t read (std::istream &strm, std::string *outBuffer=NULL, size_t offset=0, bool reverseBytes=false, bool littleEndian=false)
 
 UBNXI ()
 4 More...
 
 UBNXI (const UBNXI &other)
 
 UBNXI (unsigned long ul)
 
size_t write (std::ostream &strm, std::string *outBuffer=NULL, size_t offset=0, bool reverseBytes=false, bool littleEndian=false) const
 

Static Public Attributes

static const GNSSTK_EXPORT unsigned char MAX_BYTES = 4
 536870911 More...
 
static const GNSSTK_EXPORT unsigned long MAX_VALUE = 536870911
 0 More...
 
static const GNSSTK_EXPORT unsigned long MIN_VALUE = 0
 

Protected Attributes

size_t size
 
unsigned long value
 

Constructor & Destructor Documentation

◆ UBNXI() [1/3]

gnsstk::BinexData::UBNXI::UBNXI ( )

4

Default constructor - sets value to 0.

Definition at line 77 of file BinexData.cpp.

◆ UBNXI() [2/3]

gnsstk::BinexData::UBNXI::UBNXI ( const UBNXI other)
inline

Copy constructor.

Definition at line 112 of file BinexData.hpp.

◆ UBNXI() [3/3]

gnsstk::BinexData::UBNXI::UBNXI ( unsigned long  ul)

Constructor with unsigned long initialization value.

Exceptions
FFStreamError

Definition at line 84 of file BinexData.cpp.

Member Function Documentation

◆ decode()

size_t gnsstk::BinexData::UBNXI::decode ( const std::string &  inBuffer,
size_t  offset = 0,
bool  littleEndian = false 
)

Attempts to decode a valid UBNXI from the contents of inBuffer. The contents of inBuffer are assumed to be in normal order (i.e. not reversed) but may be either big or little endian.

Parameters
inBufferSequence of bytes to decode
offsetOffset into inBuffer at which to decode
littleEndianByte order of the encoded bytes
Returns
Number of bytes decoded
Exceptions
FFStreamError

Definition at line 119 of file BinexData.cpp.

◆ encode()

size_t gnsstk::BinexData::UBNXI::encode ( std::string &  outBuffer,
size_t  offset = 0,
bool  littleEndian = false 
) const

Converts the UBNXI to a series of bytes placed in outBuffer. The bytes are output in normal order (i.e. not reversed) but may encode in either big or little endian format.

Parameters
outBufferSequence of encoded bytes
offsetOffset into outBuffer at which to encode
littleEndianOptional flag indicating byte order of the encoded bytes
Returns
Number of bytes used to encode

Definition at line 155 of file BinexData.cpp.

◆ getSize()

size_t gnsstk::BinexData::UBNXI::getSize ( ) const
inline

Returns the number of bytes required to represent the UBNXI. A size of 0 indicates an invalid or uninitialized UBNXI.

Definition at line 202 of file BinexData.hpp.

◆ operator unsigned long()

gnsstk::BinexData::UBNXI::operator unsigned long ( ) const
inline

Returns the value of the UBNXI as an unsigned long.

Definition at line 192 of file BinexData.hpp.

◆ operator!=()

bool gnsstk::BinexData::UBNXI::operator!= ( const UBNXI other) const
inline

Compares two UBNXI's for inequality.

Definition at line 147 of file BinexData.hpp.

◆ operator<()

bool gnsstk::BinexData::UBNXI::operator< ( const UBNXI other) const
inline

Returns whether this UBNXI is less than the other.

Definition at line 156 of file BinexData.hpp.

◆ operator<=()

bool gnsstk::BinexData::UBNXI::operator<= ( const UBNXI other) const
inline

Returns whether this UBNXI is less than or equal to the other.

Definition at line 165 of file BinexData.hpp.

◆ operator=()

UBNXI& gnsstk::BinexData::UBNXI::operator= ( const UBNXI right)
inline

Copies another UBNXI.

Definition at line 127 of file BinexData.hpp.

◆ operator==()

bool gnsstk::BinexData::UBNXI::operator== ( const UBNXI other) const
inline

Compares two UBNXI's for equality.

Definition at line 138 of file BinexData.hpp.

◆ operator>()

bool gnsstk::BinexData::UBNXI::operator> ( const UBNXI other) const
inline

Returns whether this UBNXI is greater than the other.

Definition at line 174 of file BinexData.hpp.

◆ operator>=()

bool gnsstk::BinexData::UBNXI::operator>= ( const UBNXI other) const
inline

Returns whether this UBNXI is greater than or equal to the other.

Definition at line 183 of file BinexData.hpp.

◆ read()

size_t gnsstk::BinexData::UBNXI::read ( std::istream &  strm,
std::string *  outBuffer = NULL,
size_t  offset = 0,
bool  reverseBytes = false,
bool  littleEndian = false 
)

Attempts to read a valid UBNXI from the specified input stream. The stream can be in reverse order and can be big or little endian. If the method succeeds, the number of bytes used to construct the UBNXI can be determined by calling the getSize() method.

Parameters
strmStream from which to read
outBufferOptional buffer to receive copy of raw input
offsetOffset into outBuffer at which to copy input
reverseBytesOptional flag indicating whether the input bytes are reversed
littleEndianOptional flag indicating byte order of input
Returns
Number of bytes removed from the input stream
Exceptions
FFStreamError
Todo:

Definition at line 268 of file BinexData.cpp.

◆ write()

size_t gnsstk::BinexData::UBNXI::write ( std::ostream &  strm,
std::string *  outBuffer = NULL,
size_t  offset = 0,
bool  reverseBytes = false,
bool  littleEndian = false 
) const

Attempts to write the UBNXI to the specified output stream. The stream can be output in reverse order and can be big or little endian. The method fails if the entire UBNXI cannot be written to the stream.

Parameters
strmStream in which to write
outBufferOptional buffer to receive copy of raw output
offsetOffset into outBuffer at which to copy output
reverseBytesOptional flag indicating whether the output bytes should be reversed
littleEndianOptional flag indicating byte order of output
Returns
Number of bytes added to the output stream
Exceptions
FFStreamError

Definition at line 331 of file BinexData.cpp.

Member Data Documentation

◆ MAX_BYTES

const unsigned char gnsstk::BinexData::UBNXI::MAX_BYTES = 4
static

536870911

Definition at line 102 of file BinexData.hpp.

◆ MAX_VALUE

const unsigned long gnsstk::BinexData::UBNXI::MAX_VALUE = 536870911
static

0

Definition at line 101 of file BinexData.hpp.

◆ MIN_VALUE

const unsigned long gnsstk::BinexData::UBNXI::MIN_VALUE = 0
static

Definition at line 100 of file BinexData.hpp.

◆ size

size_t gnsstk::BinexData::UBNXI::size
protected

Definition at line 283 of file BinexData.hpp.

◆ value

unsigned long gnsstk::BinexData::UBNXI::value
protected

Definition at line 282 of file BinexData.hpp.


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


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:44