123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- #ifndef MBED_FILEBASE_H
- #define MBED_FILEBASE_H
- typedef int FILEHANDLE;
- #include <cstdio>
- #include <cstring>
- #include "platform/platform.h"
- #include "platform/SingletonPtr.h"
- #include "platform/PlatformMutex.h"
- #include "platform/NonCopyable.h"
- namespace mbed {
- typedef enum {
- FilePathType,
- FileSystemPathType
- } PathType;
- class FileBase : private NonCopyable<FileBase> {
- public:
- FileBase(const char *name, PathType t);
- virtual ~FileBase();
- const char *getName(void);
- PathType getPathType(void);
- static FileBase *lookup(const char *name, unsigned int len);
- static FileBase *get(int n);
-
- private:
- static FileBase *_head;
- static SingletonPtr<PlatformMutex> _mutex;
- FileBase *_next;
- const char *const _name;
- const PathType _path_type;
- };
- }
- #endif
|