Service/FS: Mark FileBackend's Write as non-const
This commit is contained in:
parent
ca2b6c6c8e
commit
714206e4ce
9 changed files with 9 additions and 12 deletions
|
@ -35,8 +35,7 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
ResultVal<size_t> Write(u64 offset, size_t length, bool flush,
|
||||
const u8* buffer) const override {
|
||||
ResultVal<size_t> Write(u64 offset, size_t length, bool flush, const u8* buffer) override {
|
||||
if (offset > size) {
|
||||
return ERR_WRITE_BEYOND_END;
|
||||
} else if (offset == size) {
|
||||
|
|
|
@ -206,7 +206,7 @@ ResultVal<size_t> NCCHFile::Read(const u64 offset, const size_t length, u8* buff
|
|||
}
|
||||
|
||||
ResultVal<size_t> NCCHFile::Write(const u64 offset, const size_t length, const bool flush,
|
||||
const u8* buffer) const {
|
||||
const u8* buffer) {
|
||||
LOG_ERROR(Service_FS, "Attempted to write to NCCH file");
|
||||
// TODO(shinyquagsire23): Find error code
|
||||
return MakeResult<size_t>(0);
|
||||
|
|
|
@ -54,7 +54,7 @@ public:
|
|||
NCCHFile(std::vector<u8> buffer) : file_buffer(buffer) {}
|
||||
|
||||
ResultVal<size_t> Read(u64 offset, size_t length, u8* buffer) const override;
|
||||
ResultVal<size_t> Write(u64 offset, size_t length, bool flush, const u8* buffer) const override;
|
||||
ResultVal<size_t> Write(u64 offset, size_t length, bool flush, const u8* buffer) override;
|
||||
u64 GetSize() const override;
|
||||
bool SetSize(u64 size) const override;
|
||||
bool Close() const override {
|
||||
|
|
|
@ -51,8 +51,7 @@ public:
|
|||
return MakeResult<size_t>(data->size());
|
||||
}
|
||||
|
||||
ResultVal<size_t> Write(u64 offset, size_t length, bool flush,
|
||||
const u8* buffer) const override {
|
||||
ResultVal<size_t> Write(u64 offset, size_t length, bool flush, const u8* buffer) override {
|
||||
LOG_ERROR(Service_FS, "The file is read-only!");
|
||||
return ERROR_UNSUPPORTED_OPEN_FLAGS;
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ ResultVal<size_t> DiskFile::Read(const u64 offset, const size_t length, u8* buff
|
|||
}
|
||||
|
||||
ResultVal<size_t> DiskFile::Write(const u64 offset, const size_t length, const bool flush,
|
||||
const u8* buffer) const {
|
||||
const u8* buffer) {
|
||||
if (!mode.write_flag)
|
||||
return ERROR_INVALID_OPEN_FLAGS;
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ public:
|
|||
}
|
||||
|
||||
ResultVal<size_t> Read(u64 offset, size_t length, u8* buffer) const override;
|
||||
ResultVal<size_t> Write(u64 offset, size_t length, bool flush, const u8* buffer) const override;
|
||||
ResultVal<size_t> Write(u64 offset, size_t length, bool flush, const u8* buffer) override;
|
||||
u64 GetSize() const override;
|
||||
bool SetSize(u64 size) const override;
|
||||
bool Close() const override;
|
||||
|
|
|
@ -35,8 +35,7 @@ public:
|
|||
* @param buffer Buffer to read data from
|
||||
* @return Number of bytes written, or error code
|
||||
*/
|
||||
virtual ResultVal<size_t> Write(u64 offset, size_t length, bool flush,
|
||||
const u8* buffer) const = 0;
|
||||
virtual ResultVal<size_t> Write(u64 offset, size_t length, bool flush, const u8* buffer) = 0;
|
||||
|
||||
/**
|
||||
* Get the size of the file in bytes
|
||||
|
|
|
@ -94,7 +94,7 @@ ResultVal<size_t> IVFCFile::Read(const u64 offset, const size_t length, u8* buff
|
|||
}
|
||||
|
||||
ResultVal<size_t> IVFCFile::Write(const u64 offset, const size_t length, const bool flush,
|
||||
const u8* buffer) const {
|
||||
const u8* buffer) {
|
||||
LOG_ERROR(Service_FS, "Attempted to write to IVFC file");
|
||||
// TODO(Subv): Find error code
|
||||
return MakeResult<size_t>(0);
|
||||
|
|
|
@ -56,7 +56,7 @@ public:
|
|||
: romfs_file(file), data_offset(offset), data_size(size) {}
|
||||
|
||||
ResultVal<size_t> Read(u64 offset, size_t length, u8* buffer) const override;
|
||||
ResultVal<size_t> Write(u64 offset, size_t length, bool flush, const u8* buffer) const override;
|
||||
ResultVal<size_t> Write(u64 offset, size_t length, bool flush, const u8* buffer) override;
|
||||
u64 GetSize() const override;
|
||||
bool SetSize(u64 size) const override;
|
||||
bool Close() const override {
|
||||
|
|
Loading…
Reference in a new issue