Пример #1
0
static void saveOrLoadCommonArray(Common::ReadStream &stream, A &array) {
	uint count = stream.readUint16LE();
	if (count == array.size()) {
		for (uint i = 0; i < count; ++i) {
			saveOrLoad(stream, array[i]);
		}
	}
}
Пример #2
0
/*-----------------------------------------------------------------------
 * BtPage
 *-----------------------------------------------------------------------*/
void BtPage::readBTree(Common::ReadStream &s) {
	_header._count = s.readUint16LE();
	_header._down = s.readUint16LE();

	if (_header._down == kBtValNone) {
		// Leaf list
		for (int i = 0; i < kBtLeafCount; ++i) {
			s.read(_leaf[i]._key, kBtKeySize);
			_leaf[i]._pos = s.readUint32LE();
			_leaf[i]._size = s.readUint16LE();
		}
	} else {
		// Root index
		for (int i = 0; i < kBtInnerCount; ++i) {
			s.read(_inner[i]._key, kBtKeySize);
			_inner[i]._down = s.readUint16LE();
		}
	}
}
Пример #3
0
static void saveOrLoad(Common::ReadStream &stream, uint16 &i) {
	i = stream.readUint16LE();
}