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