1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- #ifndef MBED_FILESYSTEMLIKE_H
- #define MBED_FILESYSTEMLIKE_H
- #include "platform/platform.h"
- #include "platform/FileSystemHandle.h"
- #include "platform/FileHandle.h"
- #include "platform/DirHandle.h"
- #include "platform/NonCopyable.h"
- namespace mbed {
- class FileSystemLike : public FileSystemHandle, public FileBase, private NonCopyable<FileSystemLike> {
- public:
-
- FileSystemLike(const char *name = NULL) : FileBase(name, FileSystemPathType) {}
- virtual ~FileSystemLike() {}
-
- using FileSystemHandle::open;
-
- MBED_DEPRECATED_SINCE("mbed-os-5.5",
- "Replaced by `int open(FileHandle **, ...)` for propagating error codes")
- FileHandle *open(const char *path, int flags)
- {
- FileHandle *file;
- int err = open(&file, path, flags);
- return err ? NULL : file;
- }
-
- MBED_DEPRECATED_SINCE("mbed-os-5.5",
- "Replaced by `int open(DirHandle **, ...)` for propagating error codes")
- DirHandle *opendir(const char *path)
- {
- DirHandle *dir;
- int err = open(&dir, path);
- return err ? NULL : dir;
- }
- };
- }
- #endif
|