Retrieving numbers

The functions of this set let you retrieve numbers from the input file. Internally, all of them are very simple: the result of the byte reader (with the requested bitness) is directly passed to the corresponding low-level number conversion function. The net result of this combination is very handy - you don't have to worry about any low-level details and just get the requested number.

Name of each function consists of three parts:

All these functions take into account the currently chosen byte-reordering mode set by Intel() or Motorola() functions. Here's an example. Let's suppose that the next four bytes at the current location of the input file are 12 34 56 78 and you're going to retrieve a 32-bit wide unsigned integer number with the GetUI32() function. Then, in case of Intel() byte reordering you'll get 0x78563412 and in case of Motorola() the number will be equal to 0x12345678.

The "Get" functions advance the current position in the input file. The "Peek" functions do not, thus letting you to preview the numbers without actually retrieving them.

"I" functions perform signed expansion of the input data. "UI" functions expand the input data by setting the upper bits to zero.

Num = GetI8()
Num = GetUI8()
Num = PeekI8()
Num = PeekUI8()
 
Num = GetI16()
Num = GetUI16()
Num = PeekI16()
Num = PeekUI16()


Num = GetI32()
Num = GetUI32()
Num = PeekI32()
Num = PeekUI32()
 
NumLo, NumHi = GetI64()
NumLo, NumHi = GetUI64()
NumLo, NumHi = PeekI64()
NumLo, NumHi = PeekUI64()
 
Num = GetR32()
Num = PeekR32()

Num = GetR64()
Num = PeekR64()

Num = GetR80()
Num = PeekR80()

Please note that 64-bit integer functions (GetI64(), GetUI64(), PeekI64() and PeekUI64()) actually return two 32-bit numbers - the low and the high part of the resulting 64-bit wide integer.

GetR80() and PeekR80() functions internally cast their output (C long double type) to C double type so if the number is really big and does not fit the double range, an erroneous data may be returned.