2016-01-07 08:14:33 +00:00
|
|
|
#pragma once
|
2015-07-14 09:32:43 +00:00
|
|
|
|
|
|
|
namespace nall { namespace Beat {
|
|
|
|
|
|
|
|
struct File : file {
|
|
|
|
using file::file;
|
|
|
|
auto read() -> uint8_t override;
|
|
|
|
auto write(uint8_t) -> void override;
|
|
|
|
Hash::CRC32 checksum;
|
|
|
|
};
|
|
|
|
|
|
|
|
auto File::read() -> uint8_t {
|
|
|
|
uint8_t data = file::read();
|
2016-10-27 21:16:58 +00:00
|
|
|
checksum.input(data);
|
2015-07-14 09:32:43 +00:00
|
|
|
return data;
|
|
|
|
}
|
|
|
|
|
|
|
|
auto File::write(uint8_t data) -> void {
|
2016-10-27 21:16:58 +00:00
|
|
|
checksum.input(data);
|
2015-07-14 09:32:43 +00:00
|
|
|
return file::write(data);
|
|
|
|
}
|
|
|
|
|
|
|
|
}}
|