Madeline Kistler / SDFileSystem2
Committer:
mkistler
Date:
Tue Nov 17 20:30:08 2020 +0000
Revision:
0:812e8b0b2832
Final draft.

Who changed what in which revision?

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