ss
FATFileHandle.h@0:9296bb2a98a8, 2016-12-02 (annotated)
- Committer:
- cha45689
- Date:
- Fri Dec 02 19:37:14 2016 +0000
- Revision:
- 0:9296bb2a98a8
ss
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
cha45689 | 0:9296bb2a98a8 | 1 | /* mbed Microcontroller Library |
cha45689 | 0:9296bb2a98a8 | 2 | * Copyright (c) 2006-2012 ARM Limited |
cha45689 | 0:9296bb2a98a8 | 3 | * |
cha45689 | 0:9296bb2a98a8 | 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
cha45689 | 0:9296bb2a98a8 | 5 | * of this software and associated documentation files (the "Software"), to deal |
cha45689 | 0:9296bb2a98a8 | 6 | * in the Software without restriction, including without limitation the rights |
cha45689 | 0:9296bb2a98a8 | 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
cha45689 | 0:9296bb2a98a8 | 8 | * copies of the Software, and to permit persons to whom the Software is |
cha45689 | 0:9296bb2a98a8 | 9 | * furnished to do so, subject to the following conditions: |
cha45689 | 0:9296bb2a98a8 | 10 | * |
cha45689 | 0:9296bb2a98a8 | 11 | * The above copyright notice and this permission notice shall be included in |
cha45689 | 0:9296bb2a98a8 | 12 | * all copies or substantial portions of the Software. |
cha45689 | 0:9296bb2a98a8 | 13 | * |
cha45689 | 0:9296bb2a98a8 | 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
cha45689 | 0:9296bb2a98a8 | 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
cha45689 | 0:9296bb2a98a8 | 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
cha45689 | 0:9296bb2a98a8 | 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
cha45689 | 0:9296bb2a98a8 | 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
cha45689 | 0:9296bb2a98a8 | 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
cha45689 | 0:9296bb2a98a8 | 20 | * SOFTWARE. |
cha45689 | 0:9296bb2a98a8 | 21 | */ |
cha45689 | 0:9296bb2a98a8 | 22 | #ifndef MBED_FATFILEHANDLE_H |
cha45689 | 0:9296bb2a98a8 | 23 | #define MBED_FATFILEHANDLE_H |
cha45689 | 0:9296bb2a98a8 | 24 | |
cha45689 | 0:9296bb2a98a8 | 25 | #include "FileHandle.h" |
cha45689 | 0:9296bb2a98a8 | 26 | |
cha45689 | 0:9296bb2a98a8 | 27 | using namespace mbed; |
cha45689 | 0:9296bb2a98a8 | 28 | |
cha45689 | 0:9296bb2a98a8 | 29 | class FATFileHandle : public FileHandle { |
cha45689 | 0:9296bb2a98a8 | 30 | public: |
cha45689 | 0:9296bb2a98a8 | 31 | |
cha45689 | 0:9296bb2a98a8 | 32 | FATFileHandle(FIL fh); |
cha45689 | 0:9296bb2a98a8 | 33 | virtual int close(); |
cha45689 | 0:9296bb2a98a8 | 34 | virtual ssize_t write(const void* buffer, size_t length); |
cha45689 | 0:9296bb2a98a8 | 35 | virtual ssize_t read(void* buffer, size_t length); |
cha45689 | 0:9296bb2a98a8 | 36 | virtual int isatty(); |
cha45689 | 0:9296bb2a98a8 | 37 | virtual off_t lseek(off_t position, int whence); |
cha45689 | 0:9296bb2a98a8 | 38 | virtual int fsync(); |
cha45689 | 0:9296bb2a98a8 | 39 | virtual off_t flen(); |
cha45689 | 0:9296bb2a98a8 | 40 | |
cha45689 | 0:9296bb2a98a8 | 41 | protected: |
cha45689 | 0:9296bb2a98a8 | 42 | |
cha45689 | 0:9296bb2a98a8 | 43 | FIL _fh; |
cha45689 | 0:9296bb2a98a8 | 44 | |
cha45689 | 0:9296bb2a98a8 | 45 | }; |
cha45689 | 0:9296bb2a98a8 | 46 | |
cha45689 | 0:9296bb2a98a8 | 47 | #endif |
cha45689 | 0:9296bb2a98a8 | 48 |