Alek Boving / SDFileSystem8
Committer:
alekboving
Date:
Thu Nov 12 15:20:15 2020 +0000
Revision:
0:83e8ad3d9a65
initial commit

Who changed what in which revision?

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