mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2025-01-11 17:29:57 +00:00
42b1b7dc53
Signed-off-by: Adrian.Conlon <adrian.conlon@gmail.com>
41 lines
717 B
C++
41 lines
717 B
C++
#include "stdafx.h"
|
|
#include "FuseTest.h"
|
|
|
|
void Fuse::Test::read(std::ifstream& file) {
|
|
|
|
finish = false;
|
|
do {
|
|
std::getline(file, description);
|
|
finish = file.eof();
|
|
} while (description.empty() && !finish);
|
|
|
|
if (finish)
|
|
return;
|
|
|
|
registerState.read(file);
|
|
|
|
bool complete = false;
|
|
do {
|
|
MemoryDatum memoryDatum;
|
|
memoryDatum.read(file);
|
|
complete = memoryDatum.finished();
|
|
if (!complete)
|
|
memoryData.push_back(memoryDatum);
|
|
} while (!complete);
|
|
}
|
|
|
|
void Fuse::Test::write(std::ofstream& file) {
|
|
|
|
file << description << std::endl;
|
|
|
|
registerState.write(file);
|
|
file << std::endl;
|
|
|
|
for (auto memoryDatum : memoryData) {
|
|
memoryDatum.write(file);
|
|
file << std::endl;
|
|
}
|
|
|
|
file << -1 << std::endl;
|
|
}
|