Beispiel #1
0
void TwoDAFile::readRows2a(Common::SeekableReadStream &twoda,
                           Common::StreamTokenizer &tokenize) {

	/* And now read the individual cells in the rows. */

	size_t columnCount = _headers.size();

	while (!twoda.eos()) {
		TwoDARow *row = new TwoDARow(*this);

		// Skip the first token, which is the row index. It's implicit in the data anyway
		tokenize.skipToken(twoda);

		// Read all the cells in the row
		size_t count = tokenize.getTokens(twoda, row->_data, columnCount, columnCount);

		// And move to the next line
		tokenize.nextChunk(twoda);

		if (count == 0) {
			// Ignore empty lines
			delete row;
			continue;
		}

		_rows.push_back(row);
	}
}
Beispiel #2
0
void TwoDAFile::readRows2a(Common::SeekableReadStream &twoda,
                           Common::StreamTokenizer &tokenize) {

	uint32 columnCount = _headers.size();

	while (!twoda.eos()) {
		TwoDARow *row = new TwoDARow(*this);

		tokenize.skipToken(twoda);

		int count = tokenize.getTokens(twoda, row->_data, columnCount, columnCount);

		tokenize.nextChunk(twoda);

		if (count == 0) {
			// Ignore empty lines
			delete row;
			continue;
		}

		_rows.push_back(row);
	}
}