![]() |
Repetier-Firmware
0.91
|
Base class for SdFile with Print and C++ streams. More...
#include <SdFat.h>
Public Member Functions | |
SdBaseFile () | |
SdBaseFile (const char *path, uint8_t oflag) | |
bool | getWriteError () |
void | clearWriteError () |
void | getpos (FatPos_t *pos) |
void | setpos (FatPos_t *pos) |
uint32_t | available () |
bool | close () |
bool | contiguousRange (uint32_t *bgnBlock, uint32_t *endBlock) |
bool | createContiguous (SdBaseFile *dirFile, const char *path, uint32_t size) |
uint32_t | curCluster () const |
uint32_t | curPosition () const |
bool | dirEntry (dir_t *dir) |
bool | exists (const char *name) |
int16_t | fgets (char *str, int16_t num, char *delim=0) |
uint32_t | fileSize () const |
uint32_t | firstCluster () const |
bool | getFilename (char *name) |
uint8_t | lfn_checksum (const unsigned char *pFCBName) |
bool | openParentReturnFile (SdBaseFile *dirFile, const char *path, uint8_t *dname, SdBaseFile *newParent, boolean bMakeDirs) |
bool | isDir () const |
bool | isFile () const |
bool | isOpen () const |
bool | isSubDir () const |
bool | isRoot () const |
void | ls (uint8_t flags=0, uint8_t indent=0) |
void | ls (uint8_t flags=0) |
bool | mkdir (SdBaseFile *dir, const char *path, bool pFlag=true) |
bool | makeDir (SdBaseFile *dir, const char *path) |
bool | open (SdBaseFile *dirFile, uint16_t index, uint8_t oflag) |
bool | open (SdBaseFile *dirFile, const char *path, uint8_t oflag) |
bool | open (const char *path, uint8_t oflag=O_READ) |
bool | openNext (SdBaseFile *dirFile, uint8_t oflag) |
bool | openRoot (SdVolume *vol) |
int8_t | readDir (dir_t &dir, char *longfilename) |
int | peek () |
bool | printCreateDateTime () |
bool | printModifyDateTime () |
int | printField (int16_t value, char term) |
int | printField (uint16_t value, char term) |
int | printField (int32_t value, char term) |
int | printField (uint32_t value, char term) |
bool | printName () |
int16_t | read () |
int | read (void *buf, size_t nbyte) |
int8_t | readDir (dir_t *dir, char *longfilename) |
bool | remove () |
void | rewind () |
bool | rename (SdBaseFile *dirFile, const char *newPath) |
bool | rmdir () |
bool | rmDir () |
bool | rmRfStar () |
bool | seekCur (int32_t offset) |
bool | seekEnd (int32_t offset=0) |
bool | seekSet (uint32_t pos) |
bool | sync () |
bool | timestamp (SdBaseFile *file) |
bool | timestamp (uint8_t flag, uint16_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second) |
uint8_t | type () const |
bool | truncate (uint32_t size) |
SdVolume * | volume () const |
int | write (const void *buf, size_t nbyte) |
bool | openParent (SdBaseFile *dir) |
bool | addCluster () |
cache_t * | addDirCluster () |
dir_t * | cacheDirEntry (uint8_t action) |
int8_t | lsPrintNext (uint8_t flags, uint8_t indent) |
bool | mkdir (SdBaseFile *parent, const uint8_t *dname) |
bool | open (SdBaseFile *dirFile, const uint8_t *dname, uint8_t oflag, bool bDir) |
bool | openCachedEntry (uint8_t cacheIndex, uint8_t oflags) |
dir_t * | readDirCache () |
dir_t * | readDirCacheSpecial () |
dir_t * | getLongFilename (dir_t *dir, char *longFilename, int8_t cVFATNeeded, uint32_t *pwIndexPos) |
bool | findSpace (dir_t *dir, int8_t cVFATNeeded, int8_t *pcVFATFound, uint32_t *pwIndexPos) |
uint8_t | lsRecursive (SdBaseFile *parent, uint8_t level, char *findFilename, SdBaseFile *pParentFound) |
bool | setDirSize () |
bool | contiguousRange (uint32_t &bgnBlock, uint32_t &endBlock) __attribute__((error("use contiguousRange(&bgnBlock |
bool | createContiguous (SdBaseFile &dirFile, const char *path, uint32_t size) __attribute__((error("use createContiguous(&bgnBlock |
bool | dirEntry (dir_t &dir) __attribute__((error("use dirEntry(&dir)"))) |
bool | mkdir (SdBaseFile &dir, const char *path) __attribute__((error("use mkdir(&dir |
bool | open (SdBaseFile &dirFile, const char *path, uint8_t oflag) __attribute__((error("use open(&dirFile |
bool | open (SdBaseFile &dirFile, const char *path) __attribute__((error("use open(&dirFile |
bool | open (SdBaseFile &dirFile, uint16_t index, uint8_t oflag) __attribute__((error("use open(&dirFile |
bool | openRoot (SdVolume &vol) __attribute__((error("use openRoot(&vol)"))) |
int8_t | readDir (dir_t &dir) __attribute__((error("use readDir(&dir)"))) |
Static Public Member Functions | |
static SdBaseFile * | cwd () |
static void | dateTimeCallback (void(*dateTime)(uint16_t *date, uint16_t *time)) |
static void | dateTimeCallbackCancel () |
static void | dirName (const dir_t &dir, char *name) |
static void | printFatDate (uint16_t fatDate) |
static void | printFatTime (uint16_t fatTime) |
static bool | remove (SdBaseFile *dirFile, const char *path) |
static bool | make83Name (const char *str, uint8_t *name, const char **ptr) |
static void | printDirName (const dir_t &dir, uint8_t width, bool printSlash) |
static void | dateTimeCallback (void(*dateTime)(uint16_t &date, uint16_t &time)) __attribute__((error("use void dateTimeCallback(""void (*dateTime)(uint16_t* date |
static bool | remove (SdBaseFile &dirFile, const char *path) __attribute__((error("use remove(&dirFile |
Data Fields | |
bool | writeError |
uint8_t | flags_ |
uint8_t | fstate_ |
uint8_t | type_ |
uint8_t | dirIndex_ |
SdVolume * | vol_ |
uint32_t | curCluster_ |
uint32_t | curPosition_ |
uint32_t | dirBlock_ |
uint32_t | fileSize_ |
uint32_t | firstCluster_ |
char * | pathend |
bool & | endBlock |
static void uint16_t * | time |
bool | path |
bool | oflag |
bool | O_RDWR |
bool | index |
static bool | path |
Static Public Attributes | |
static SdBaseFile * | cwd_ |
static void(* | dateTime_ )(uint16_t *date, uint16_t *time) |
static uint8_t const | F_OFLAG = (O_ACCMODE | O_APPEND | O_SYNC) |
static uint8_t const | F_FILE_DIR_DIRTY = 0X80 |
Friends | |
class | SdFat |
Base class for SdFile with Print and C++ streams.
SdBaseFile | ( | ) | [inline] |
Create an instance.
SdBaseFile | ( | const char * | path, |
uint8_t | oflag | ||
) |
bool addCluster | ( | ) |
cache_t* addDirCluster | ( | ) |
uint32_t available | ( | void | ) | [inline] |
dir_t* cacheDirEntry | ( | uint8_t | action | ) |
void clearWriteError | ( | ) | [inline] |
Set writeError to zero
Reimplemented in SdFile.
bool close | ( | ) |
bool contiguousRange | ( | uint32_t * | bgnBlock, |
uint32_t * | endBlock | ||
) |
bool contiguousRange | ( | uint32_t & | bgnBlock, |
uint32_t & | endBlock | ||
) |
bool createContiguous | ( | SdBaseFile * | dirFile, |
const char * | path, | ||
uint32_t | size | ||
) |
bool createContiguous | ( | SdBaseFile & | dirFile, |
const char * | path, | ||
uint32_t | size | ||
) |
uint32_t curCluster | ( | ) | const [inline] |
uint32_t curPosition | ( | ) | const [inline] |
static SdBaseFile* cwd | ( | ) | [inline, static] |
static void dateTimeCallback | ( | void(*)(uint16_t *date, uint16_t *time) | dateTime | ) | [inline, static] |
Set the date/time callback function
[in] | dateTime | The user's call back function. The callback function is of the form: |
void dateTime(uint16_t* date, uint16_t* time) { uint16_t year; uint8_t month, day, hour, minute, second; // User gets date and time from GPS or real-time clock here // return date using FAT_DATE macro to format fields *date = FAT_DATE(year, month, day); // return time using FAT_TIME macro to format fields *time = FAT_TIME(hour, minute, second); }
Sets the function that is called when a file is created or when a file's directory entry is modified by sync(). All timestamps, access, creation, and modify, are set when a file is created. sync() maintains the last access date and last modify date/time.
See the timestamp() function.
static void dateTimeCallback | ( | void(*)(uint16_t &date, uint16_t &time) | dateTime | ) | [static] |
static void dateTimeCallbackCancel | ( | ) | [inline, static] |
Cancel the date/time callback function.
bool exists | ( | const char * | name | ) |
int16_t fgets | ( | char * | str, |
int16_t | num, | ||
char * | delim = 0 |
||
) |
uint32_t fileSize | ( | ) | const [inline] |
uint32_t firstCluster | ( | ) | const [inline] |
bool getFilename | ( | char * | name | ) |
dir_t* getLongFilename | ( | dir_t * | dir, |
char * | longFilename, | ||
int8_t | cVFATNeeded, | ||
uint32_t * | pwIndexPos | ||
) |
get position for streams
[out] | pos | struct to receive position |
bool getWriteError | ( | ) | [inline] |
Reimplemented in SdFile.
bool isDir | ( | ) | const [inline] |
bool isFile | ( | ) | const [inline] |
bool isOpen | ( | ) | const [inline] |
bool isRoot | ( | ) | const [inline] |
bool isSubDir | ( | ) | const [inline] |
uint8_t lfn_checksum | ( | const unsigned char * | pFCBName | ) |
void ls | ( | uint8_t | flags = 0 , |
uint8_t | indent = 0 |
||
) |
void ls | ( | uint8_t | flags = 0 | ) |
int8_t lsPrintNext | ( | uint8_t | flags, |
uint8_t | indent | ||
) |
uint8_t lsRecursive | ( | SdBaseFile * | parent, |
uint8_t | level, | ||
char * | findFilename, | ||
SdBaseFile * | pParentFound | ||
) |
static bool make83Name | ( | const char * | str, |
uint8_t * | name, | ||
const char ** | ptr | ||
) | [static] |
bool makeDir | ( | SdBaseFile * | dir, |
const char * | path | ||
) | [inline] |
bool mkdir | ( | SdBaseFile * | dir, |
const char * | path, | ||
bool | pFlag = true |
||
) |
bool mkdir | ( | SdBaseFile * | parent, |
const uint8_t * | dname | ||
) |
bool mkdir | ( | SdBaseFile & | dir, |
const char * | path | ||
) |
bool open | ( | SdBaseFile * | dirFile, |
uint16_t | index, | ||
uint8_t | oflag | ||
) |
bool open | ( | SdBaseFile * | dirFile, |
const char * | path, | ||
uint8_t | oflag | ||
) |
bool open | ( | SdBaseFile * | dirFile, |
const uint8_t * | dname, | ||
uint8_t | oflag, | ||
bool | bDir | ||
) |
bool open | ( | SdBaseFile & | dirFile, |
const char * | path, | ||
uint8_t | oflag | ||
) |
bool open | ( | SdBaseFile & | dirFile, |
const char * | path | ||
) |
bool open | ( | SdBaseFile & | dirFile, |
uint16_t | index, | ||
uint8_t | oflag | ||
) |
bool openCachedEntry | ( | uint8_t | cacheIndex, |
uint8_t | oflags | ||
) |
bool openNext | ( | SdBaseFile * | dirFile, |
uint8_t | oflag | ||
) |
bool openParent | ( | SdBaseFile * | dir | ) |
experimental don't use
bool openParentReturnFile | ( | SdBaseFile * | dirFile, |
const char * | path, | ||
uint8_t * | dname, | ||
SdBaseFile * | newParent, | ||
boolean | bMakeDirs | ||
) |
int peek | ( | ) |
bool printCreateDateTime | ( | ) |
static void printDirName | ( | const dir_t & | dir, |
uint8_t | width, | ||
bool | printSlash | ||
) | [static] |
static void printFatDate | ( | uint16_t | fatDate | ) | [static] |
static void printFatTime | ( | uint16_t | fatTime | ) | [static] |
int printField | ( | int16_t | value, |
char | term | ||
) |
int printField | ( | uint16_t | value, |
char | term | ||
) |
int printField | ( | int32_t | value, |
char | term | ||
) |
int printField | ( | uint32_t | value, |
char | term | ||
) |
bool printModifyDateTime | ( | ) |
bool printName | ( | ) |
int16_t read | ( | ) |
int read | ( | void * | buf, |
size_t | nbyte | ||
) |
dir_t* readDirCache | ( | ) |
dir_t* readDirCacheSpecial | ( | ) |
static bool remove | ( | SdBaseFile * | dirFile, |
const char * | path | ||
) | [static] |
bool remove | ( | ) |
static bool remove | ( | SdBaseFile & | dirFile, |
const char * | path | ||
) | [static] |
bool rename | ( | SdBaseFile * | dirFile, |
const char * | newPath | ||
) |
void rewind | ( | ) | [inline] |
Set the file's current position to zero.
bool rmdir | ( | ) |
bool rmDir | ( | ) | [inline] |
bool rmRfStar | ( | ) |
bool seekCur | ( | int32_t | offset | ) | [inline] |
Set the files position to current position + pos. See seekSet().
[in] | offset | The new position in bytes from the current position. |
bool seekEnd | ( | int32_t | offset = 0 | ) | [inline] |
Set the files position to end-of-file + offset. See seekSet().
[in] | offset | The new position in bytes from end-of-file. |
bool seekSet | ( | uint32_t | pos | ) |
bool setDirSize | ( | ) |
set position for streams
[out] | pos | struct with value for new position |
bool sync | ( | ) |
bool timestamp | ( | SdBaseFile * | file | ) |
bool timestamp | ( | uint8_t | flag, |
uint16_t | year, | ||
uint8_t | month, | ||
uint8_t | day, | ||
uint8_t | hour, | ||
uint8_t | minute, | ||
uint8_t | second | ||
) |
bool truncate | ( | uint32_t | size | ) |
uint8_t type | ( | ) | const [inline] |
friend class SdFat [friend] |
uint32_t curCluster_ |
uint32_t curPosition_ |
SdBaseFile* cwd_ [static] |
uint32_t dirBlock_ |
uint8_t dirIndex_ |
bool & endBlock |
uint8_t const F_FILE_DIR_DIRTY = 0X80 [static] |
uint32_t fileSize_ |
uint32_t firstCluster_ |
uint8_t flags_ |
uint8_t fstate_ |
bool index |
bool O_RDWR |
bool oflag |
bool path |
bool path |
char* pathend |
void uint16_t* time |
uint8_t type_ |
bool writeError |