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