improve filesystem API
This commit is contained in:
parent
8c87dafd5d
commit
a1b6e2ff89
@ -80,7 +80,7 @@ class HasFileSystemIF {
|
||||
|
||||
virtual bool isDirectory(const char* path) = 0;
|
||||
|
||||
virtual bool getFileSize(FilesystemParams params, uint64_t& fileSize) = 0;
|
||||
virtual ReturnValue_t getFileSize(FilesystemParams params, uint64_t& fileSize) = 0;
|
||||
|
||||
virtual bool fileExists(FilesystemParams params) = 0;
|
||||
|
||||
|
@ -185,10 +185,10 @@ ReturnValue_t HostFilesystem::getBaseFilename(FilesystemParams params, char *nam
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
bool HostFilesystem::getFileSize(FilesystemParams params, uint64_t &fileSize) {
|
||||
ReturnValue_t HostFilesystem::getFileSize(FilesystemParams params, uint64_t &fileSize) {
|
||||
if (!fileExists(params)) {
|
||||
return false;
|
||||
return HasFileSystemIF::FILE_DOES_NOT_EXIST;
|
||||
}
|
||||
fileSize = std::filesystem::file_size(params.path);
|
||||
return true;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ class HostFilesystem : public HasFileSystemIF {
|
||||
|
||||
ReturnValue_t getBaseFilename(FilesystemParams params, char *nameBuf, size_t maxLen,
|
||||
size_t &baseNameLen) override;
|
||||
virtual bool getFileSize(FilesystemParams params, uint64_t &fileSize) override;
|
||||
virtual ReturnValue_t getFileSize(FilesystemParams params, uint64_t &fileSize) override;
|
||||
bool isDirectory(const char *path) override;
|
||||
bool fileExists(FilesystemParams params) override;
|
||||
ReturnValue_t truncateFile(FilesystemParams params) override;
|
||||
|
Loading…
Reference in New Issue
Block a user