mbed-os

Fork of mbed-os by erkin yucel

Committer:
elessair
Date:
Sun Oct 23 15:10:02 2016 +0000
Revision:
0:f269e3021894
Initial commit

Who changed what in which revision?

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