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 |
UBNXI & | operator= (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 |
gnsstk::BinexData::UBNXI::UBNXI | ( | ) |
Copy constructor.
Definition at line 112 of file BinexData.hpp.
gnsstk::BinexData::UBNXI::UBNXI | ( | unsigned long | ul | ) |
Constructor with unsigned long initialization value.
FFStreamError |
Definition at line 84 of file BinexData.cpp.
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.
inBuffer | Sequence of bytes to decode |
offset | Offset into inBuffer at which to decode |
littleEndian | Byte order of the encoded bytes |
FFStreamError |
Definition at line 119 of file BinexData.cpp.
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.
outBuffer | Sequence of encoded bytes |
offset | Offset into outBuffer at which to encode |
littleEndian | Optional flag indicating byte order of the encoded bytes |
Definition at line 155 of file BinexData.cpp.
|
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.
|
inline |
Returns the value of the UBNXI as an unsigned long.
Definition at line 192 of file BinexData.hpp.
Compares two UBNXI's for inequality.
Definition at line 147 of file BinexData.hpp.
Returns whether this UBNXI is less than the other.
Definition at line 156 of file BinexData.hpp.
Returns whether this UBNXI is less than or equal to the other.
Definition at line 165 of file BinexData.hpp.
Copies another UBNXI.
Definition at line 127 of file BinexData.hpp.
Compares two UBNXI's for equality.
Definition at line 138 of file BinexData.hpp.
Returns whether this UBNXI is greater than the other.
Definition at line 174 of file BinexData.hpp.
Returns whether this UBNXI is greater than or equal to the other.
Definition at line 183 of file BinexData.hpp.
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.
strm | Stream from which to read |
outBuffer | Optional buffer to receive copy of raw input |
offset | Offset into outBuffer at which to copy input |
reverseBytes | Optional flag indicating whether the input bytes are reversed |
littleEndian | Optional flag indicating byte order of input |
FFStreamError |
Definition at line 268 of file BinexData.cpp.
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.
strm | Stream in which to write |
outBuffer | Optional buffer to receive copy of raw output |
offset | Offset into outBuffer at which to copy output |
reverseBytes | Optional flag indicating whether the output bytes should be reversed |
littleEndian | Optional flag indicating byte order of output |
FFStreamError |
Definition at line 331 of file BinexData.cpp.
|
static |
536870911
Definition at line 102 of file BinexData.hpp.
|
static |
0
Definition at line 101 of file BinexData.hpp.
|
static |
Definition at line 100 of file BinexData.hpp.
|
protected |
Definition at line 283 of file BinexData.hpp.
|
protected |
Definition at line 282 of file BinexData.hpp.