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