1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
-
- #ifndef MBED_FILEBASE_H
- #define MBED_FILEBASE_H
-
- typedef int FILEHANDLE;
-
- #include <stdio.h>
-
- #if defined(__ARMCC_VERSION) || defined(__ICCARM__)
- # define O_RDONLY 0
- # define O_WRONLY 1
- # define O_RDWR 2
- # define O_CREAT 0x0200
- # define O_TRUNC 0x0400
- # define O_APPEND 0x0008
-
- # define NAME_MAX 255
-
- typedef int mode_t;
- typedef int ssize_t;
- typedef long off_t;
-
- #else
- # include <sys/fcntl.h>
- # include <sys/types.h>
- # include <sys/syslimits.h>
- #endif
-
- #include "platform.h"
-
- namespace mbed {
-
- typedef enum {
- FilePathType,
- FileSystemPathType
- } PathType;
-
- class 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);
-
- protected:
- static FileBase *_head;
-
- FileBase *_next;
- const char *_name;
- PathType _path_type;
-
-
- private:
- FileBase(const FileBase&);
- FileBase & operator = (const FileBase&);
- };
-
- }
-
- #endif
|