lauren cloutier / SDFileSystem

Dependents:   cloutier_a8_gps_log

Committer:
laurencloutier
Date:
Tue Nov 17 22:06:26 2020 +0000
Revision:
0:a01a54336813
sd file system;

Who changed what in which revision?

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