mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-18 23:29:49 +00:00
Lock all tape classes down to read-only.
This commit is contained in:
parent
0371b0507a
commit
0b5cd4c665
@ -60,7 +60,7 @@ namespace {
|
||||
}
|
||||
|
||||
CAS::CAS(const std::string &file_name) {
|
||||
Storage::FileHolder file(file_name);
|
||||
Storage::FileHolder file(file_name, FileHolder::FileMode::Read);
|
||||
|
||||
enum class Mode {
|
||||
Seeking,
|
||||
|
@ -16,7 +16,7 @@ using namespace Storage::Tape;
|
||||
|
||||
CSW::CSW(const std::string &file_name) :
|
||||
source_data_pointer_(0) {
|
||||
Storage::FileHolder file(file_name);
|
||||
Storage::FileHolder file(file_name, FileHolder::FileMode::Read);
|
||||
if(file.stats().st_size < 0x20) throw ErrorNotCSW;
|
||||
|
||||
// Check signature.
|
||||
|
@ -13,7 +13,7 @@
|
||||
using namespace Storage::Tape;
|
||||
|
||||
CommodoreTAP::CommodoreTAP(const std::string &file_name) :
|
||||
file_(file_name)
|
||||
file_(file_name, FileHolder::FileMode::Read)
|
||||
{
|
||||
if(!file_.check_signature("C64-TAPE-RAW"))
|
||||
throw ErrorNotCommodoreTAP;
|
||||
|
@ -13,7 +13,7 @@
|
||||
using namespace Storage::Tape;
|
||||
|
||||
OricTAP::OricTAP(const std::string &file_name) :
|
||||
file_(file_name)
|
||||
file_(file_name, FileHolder::FileMode::Read)
|
||||
{
|
||||
// Check for a sequence of at least three 0x16s followed by a 0x24.
|
||||
while(true) {
|
||||
|
@ -22,7 +22,7 @@ Log::Logger<Log::Source::TZX> logger;
|
||||
}
|
||||
|
||||
TZX::TZX(const std::string &file_name) :
|
||||
file_(file_name),
|
||||
file_(file_name, FileHolder::FileMode::Read),
|
||||
current_level_(false) {
|
||||
|
||||
// Check for signature followed by a 0x1a
|
||||
|
@ -49,7 +49,7 @@
|
||||
using namespace Storage::Tape;
|
||||
|
||||
PRG::PRG(const std::string &file_name) :
|
||||
file_(file_name)
|
||||
file_(file_name, FileHolder::FileMode::Read)
|
||||
{
|
||||
// There's really no way to validate other than that if this file is larger than 64kb,
|
||||
// of if load address + length > 65536 then it's broken.
|
||||
|
@ -12,7 +12,7 @@
|
||||
using namespace Storage::Tape;
|
||||
|
||||
ZX80O81P::ZX80O81P(const std::string &file_name) {
|
||||
Storage::FileHolder file(file_name);
|
||||
Storage::FileHolder file(file_name, FileHolder::FileMode::Read);
|
||||
|
||||
// Grab the actual file contents
|
||||
data_.resize(size_t(file.stats().st_size));
|
||||
|
Loading…
x
Reference in New Issue
Block a user