1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-16 00:43:00 +03:00

FileSystem: interface changes and some additions

- rename mount to begin to be more in line with other libraries
- add rename and remove methods
- remove freestanding functions (mount,open,openDir) from public API until that part is ready
- fix resource leak in SPIFFSDirImpl
This commit is contained in:
Ivan Grokhotkov
2015-07-30 13:44:34 +03:00
parent 544734bdc5
commit 4aa8e1b8d5
4 changed files with 153 additions and 40 deletions

View File

@ -50,6 +50,7 @@ enum AccessMode {
class DirImpl {
public:
virtual ~DirImpl() { }
virtual FileImplPtr openFile(OpenMode openMode, AccessMode accessMode) = 0;
virtual const char* fileName() = 0;
virtual bool next() = 0;
@ -57,9 +58,11 @@ public:
class FSImpl {
public:
virtual bool begin() = 0;
virtual FileImplPtr open(const char* path, OpenMode openMode, AccessMode accessMode) = 0;
virtual DirImplPtr openDir(const char* path) = 0;
virtual bool mount() = 0;
virtual bool rename(const char* pathFrom, const char* pathTo) = 0;
virtual bool remove(const char* path) = 0;
};