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