Final
FATDirHandle.h@0:e126ae11d20b, 2019-11-06 (annotated)
- Committer:
- jbeason3
- Date:
- Wed Nov 06 04:53:44 2019 +0000
- Revision:
- 0:e126ae11d20b
Final
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jbeason3 | 0:e126ae11d20b | 1 | /* mbed Microcontroller Library |
jbeason3 | 0:e126ae11d20b | 2 | * Copyright (c) 2006-2012 ARM Limited |
jbeason3 | 0:e126ae11d20b | 3 | * |
jbeason3 | 0:e126ae11d20b | 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
jbeason3 | 0:e126ae11d20b | 5 | * of this software and associated documentation files (the "Software"), to deal |
jbeason3 | 0:e126ae11d20b | 6 | * in the Software without restriction, including without limitation the rights |
jbeason3 | 0:e126ae11d20b | 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
jbeason3 | 0:e126ae11d20b | 8 | * copies of the Software, and to permit persons to whom the Software is |
jbeason3 | 0:e126ae11d20b | 9 | * furnished to do so, subject to the following conditions: |
jbeason3 | 0:e126ae11d20b | 10 | * |
jbeason3 | 0:e126ae11d20b | 11 | * The above copyright notice and this permission notice shall be included in |
jbeason3 | 0:e126ae11d20b | 12 | * all copies or substantial portions of the Software. |
jbeason3 | 0:e126ae11d20b | 13 | * |
jbeason3 | 0:e126ae11d20b | 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
jbeason3 | 0:e126ae11d20b | 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
jbeason3 | 0:e126ae11d20b | 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
jbeason3 | 0:e126ae11d20b | 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
jbeason3 | 0:e126ae11d20b | 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
jbeason3 | 0:e126ae11d20b | 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
jbeason3 | 0:e126ae11d20b | 20 | * SOFTWARE. |
jbeason3 | 0:e126ae11d20b | 21 | */ |
jbeason3 | 0:e126ae11d20b | 22 | #ifndef MBED_FATDIRHANDLE_H |
jbeason3 | 0:e126ae11d20b | 23 | #define MBED_FATDIRHANDLE_H |
jbeason3 | 0:e126ae11d20b | 24 | |
jbeason3 | 0:e126ae11d20b | 25 | #include "DirHandle.h" |
jbeason3 | 0:e126ae11d20b | 26 | |
jbeason3 | 0:e126ae11d20b | 27 | using namespace mbed; |
jbeason3 | 0:e126ae11d20b | 28 | |
jbeason3 | 0:e126ae11d20b | 29 | class FATDirHandle : public DirHandle { |
jbeason3 | 0:e126ae11d20b | 30 | |
jbeason3 | 0:e126ae11d20b | 31 | public: |
jbeason3 | 0:e126ae11d20b | 32 | FATDirHandle(const FATFS_DIR &the_dir); |
jbeason3 | 0:e126ae11d20b | 33 | virtual int closedir(); |
jbeason3 | 0:e126ae11d20b | 34 | virtual struct dirent *readdir(); |
jbeason3 | 0:e126ae11d20b | 35 | virtual void rewinddir(); |
jbeason3 | 0:e126ae11d20b | 36 | virtual off_t telldir(); |
jbeason3 | 0:e126ae11d20b | 37 | virtual void seekdir(off_t location); |
jbeason3 | 0:e126ae11d20b | 38 | |
jbeason3 | 0:e126ae11d20b | 39 | virtual ssize_t read(struct dirent *ent); |
jbeason3 | 0:e126ae11d20b | 40 | virtual int close() { return closedir(); }; |
jbeason3 | 0:e126ae11d20b | 41 | virtual void seek(off_t offset) { seekdir(offset); }; |
jbeason3 | 0:e126ae11d20b | 42 | virtual off_t tell() { return telldir(); }; |
jbeason3 | 0:e126ae11d20b | 43 | virtual void rewind() { rewinddir(); }; |
jbeason3 | 0:e126ae11d20b | 44 | |
jbeason3 | 0:e126ae11d20b | 45 | private: |
jbeason3 | 0:e126ae11d20b | 46 | FATFS_DIR dir; |
jbeason3 | 0:e126ae11d20b | 47 | struct dirent cur_entry; |
jbeason3 | 0:e126ae11d20b | 48 | |
jbeason3 | 0:e126ae11d20b | 49 | }; |
jbeason3 | 0:e126ae11d20b | 50 | |
jbeason3 | 0:e126ae11d20b | 51 | #endif |