|
resonance 1.0.1
|
Variable-length quantity, seven bits per byte, most significant group first. More...
#include <hxvarlennumber.h>
Public Member Functions | |
| HxVarLenNumber () | |
| Construct with the quantity unset, for Read() to fill. | |
| HxVarLenNumber (int nValue) | |
| Store a quantity for Write(). | |
| operator int () const | |
| Report the quantity. | |
| HxStream & | Write (HxStream &stream) const |
| Write the quantity. | |
| HxStream & | Read (HxStream &stream) |
| Read a quantity. | |
Public Attributes | |
| int | mValue |
Variable-length quantity, seven bits per byte, most significant group first.
The encoding is the one Standard MIDI Files use. Mid::Reader reads delta times and meta lengths through it, and the two string readers in HxStream's translation unit read their length prefixes through it. The object is the one word below. A routine of the class takes the word's address in a0. Its name comes from the debugging symbols of the North American demo release.
|
inline |
Construct with the quantity unset, for Read() to fill.
|
inlineexplicit |
Store a quantity for Write().
| nValue | The quantity. |
|
inline |
Report the quantity.
Write the quantity.
The groups are packed into one word, lowest group in the lowest byte and every higher group marked with the continuation bit, and the word's bytes are written lowest first through HxStream::WriteNum(). The value is shifted arithmetically. A negative value therefore never terminates. The shipped program does not call it.
| stream | The stream to write to. |
Read a quantity.
The value is cleared and each byte read through HxStream::ReadNum() adds its low seven bits after a seven-bit shift, until a byte with its top bit clear ends the quantity.
| stream | The stream to read from. |
| int HxVarLenNumber::mValue |
The quantity.