| 1 | /* mbed Microcontroller Library - FATFileHandle |
| 2 | * Copyright (c) 2008, sford |
| 3 | */ |
| 4 | |
| 5 | #ifndef MBED_FATFILEHANDLE_H |
| 6 | #define MBED_FATFILEHANDLE_H |
| 7 | |
| 8 | #include "FileHandle.h" |
| 9 | #include "ff.h" |
| 10 | |
| 11 | namespace mbed { |
| 12 | |
| 13 | class FATFileHandle : public FileHandle { |
| 14 | public: |
| 15 | |
| 16 | FATFileHandle(FIL fh); |
| 17 | virtual int close(); |
| 18 | virtual ssize_t write(const void* buffer, size_t length); |
| 19 | virtual ssize_t read(void* buffer, size_t length); |
| 20 | virtual int isatty(); |
| 21 | virtual off_t lseek(off_t position, int whence); |
| 22 | virtual int fsync(); |
| 23 | virtual off_t flen(); |
| 24 | |
| 25 | protected: |
| 26 | |
| 27 | FIL _fh; |
| 28 | |
| 29 | }; |
| 30 | |
| 31 | } |
| 32 | |
| 33 | #endif |