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_FATFILEHANDLE_H
mkistler 0:812e8b0b2832 23 #define MBED_FATFILEHANDLE_H
mkistler 0:812e8b0b2832 24
mkistler 0:812e8b0b2832 25 #include "FileHandle.h"
mkistler 0:812e8b0b2832 26
mkistler 0:812e8b0b2832 27 using namespace mbed;
mkistler 0:812e8b0b2832 28
mkistler 0:812e8b0b2832 29 class FATFileHandle : public FileHandle {
mkistler 0:812e8b0b2832 30 public:
mkistler 0:812e8b0b2832 31
mkistler 0:812e8b0b2832 32 FATFileHandle(FIL fh);
mkistler 0:812e8b0b2832 33 virtual int close();
mkistler 0:812e8b0b2832 34 virtual ssize_t write(const void* buffer, size_t length);
mkistler 0:812e8b0b2832 35 virtual ssize_t read(void* buffer, size_t length);
mkistler 0:812e8b0b2832 36 virtual int isatty();
mkistler 0:812e8b0b2832 37 virtual off_t lseek(off_t position, int whence);
mkistler 0:812e8b0b2832 38 virtual int fsync();
mkistler 0:812e8b0b2832 39 virtual off_t flen();
mkistler 0:812e8b0b2832 40
mkistler 0:812e8b0b2832 41 virtual off_t seek(off_t position, int whence) { return lseek(position, whence); }
mkistler 0:812e8b0b2832 42 virtual off_t size() { return flen(); }
mkistler 0:812e8b0b2832 43
mkistler 0:812e8b0b2832 44 protected:
mkistler 0:812e8b0b2832 45
mkistler 0:812e8b0b2832 46 FIL _fh;
mkistler 0:812e8b0b2832 47
mkistler 0:812e8b0b2832 48 };
mkistler 0:812e8b0b2832 49
mkistler 0:812e8b0b2832 50 #endif