[ox/fs] Update FileStore interface
This commit is contained in:
parent
c8ff73b56e
commit
324e28e5f2
15
deps/ox/src/ox/fs/filestore/filestore.hpp
vendored
15
deps/ox/src/ox/fs/filestore/filestore.hpp
vendored
@ -35,16 +35,23 @@ class FileStore {
|
||||
|
||||
virtual Error write(InodeId_t id, void *data, FsSize_t dataLen, uint8_t fileType = 0) = 0;
|
||||
|
||||
virtual Error read(InodeId_t id, void *data, FsSize_t dataSize, FsSize_t *size) = 0;
|
||||
/**
|
||||
* @return error if the inode could not be removed or did not exist
|
||||
*/
|
||||
virtual Error remove(InodeId_t id) = 0;
|
||||
|
||||
virtual Error read(InodeId_t id, FsSize_t readStart, FsSize_t readSize, void *data, FsSize_t *size) = 0;
|
||||
virtual Error read(InodeId_t id, void *data, FsSize_t dataSize, FsSize_t *size = nullptr) = 0;
|
||||
|
||||
virtual Error read(InodeId_t id, FsSize_t readStart, FsSize_t readSize, void *data, FsSize_t *size = nullptr) = 0;
|
||||
|
||||
/**
|
||||
* @return data section of the requested file
|
||||
*/
|
||||
virtual const ptrarith::Ptr<uint8_t, std::size_t> read(InodeId_t id) = 0;
|
||||
|
||||
virtual StatInfo stat(InodeId_t id) = 0;
|
||||
virtual ValErr<StatInfo> stat(InodeId_t id) = 0;
|
||||
|
||||
virtual Error resize(std::size_t size, void *newBuff = nullptr) = 0;
|
||||
|
||||
virtual InodeId_t spaceNeeded(FsSize_t size) = 0;
|
||||
|
||||
@ -52,6 +59,8 @@ class FileStore {
|
||||
|
||||
virtual InodeId_t available() = 0;
|
||||
|
||||
virtual ValErr<InodeId_t> generateInodeId() = 0;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user