Soldered SD Card Arduino Library 1.0.0
Easily read and write files to and form the SD card breakout! A fork of the original SDFat library by Bill Greiman.
Loading...
Searching...
No Matches
StreamBaseClass Class Reference

base type for FAT and exFAT streams More...

#include <fstream.h>

Inherits FatFile, and ios.

Inherited by fstream [private], ifstream [private], and ofstream [private].

Protected Member Functions

void clearWriteError ()
 
int16_t getch ()
 
bool getWriteError ()
 
void open (const char *path, ios::openmode mode)
 
ios::openmode getmode ()
 
void putch (char c)
 
void putstr (const char *str)
 
bool seekoff (off_type off, seekdir way)
 
bool seekpos (pos_type pos)
 
void setmode (ios::openmode mode)
 
int write (const void *buf, size_t n)
 
void write (char c)
 
- Protected Member Functions inherited from FatFile
 FatFile ()
 
 FatFile (const char *path, oflag_t oflag)
 
 ~FatFile ()
 
 operator bool () const
 
int available () const
 
uint32_t available32 () const
 
void clearError ()
 
void clearWriteError ()
 
bool close ()
 
bool contiguousRange (uint32_t *bgnSector, uint32_t *endSector)
 
bool createContiguous (FatFile *dirFile, const char *path, uint32_t size)
 
bool createContiguous (const char *path, uint32_t size)
 
uint32_t curCluster () const
 
uint32_t curPosition () const
 
bool dirEntry (DirFat_t *dir)
 
uint16_t dirIndex () const
 
uint32_t dirSize ()
 
void dmpFile (print_t *pr, uint32_t pos, size_t n)
 
bool exists (const char *path)
 
void fgetpos (fspos_t *pos) const
 
int fgets (char *str, int num, char *delim=nullptr)
 
uint32_t fileSize () const
 
uint32_t firstBlock () const
 
uint32_t firstSector () const
 
void flush ()
 
void fsetpos (const fspos_t *pos)
 
bool getAccessDate (uint16_t *pdate)
 
bool getAccessDateTime (uint16_t *pdate, uint16_t *ptime)
 
bool getCreateDateTime (uint16_t *pdate, uint16_t *ptime)
 
uint8_t getError () const
 
bool getModifyDateTime (uint16_t *pdate, uint16_t *ptime)
 
size_t getName (char *name, size_t size)
 
size_t getSFN (char *name)
 
bool getWriteError () const
 
bool isBusy ()
 
bool isContiguous () const
 
bool isDir () const
 
bool isFile () const
 
bool isHidden () const
 
bool isLFN () const
 
bool isOpen () const
 
bool isReadable () const
 
bool isReadOnly () const
 
bool isRoot () const
 
bool isRoot32 () const
 
bool isRootFixed () const
 
bool isSubDir () const
 
bool isSystem () const
 
bool isWritable () const
 
bool ls (print_t *pr, uint8_t flags=0, uint8_t indent=0)
 
bool mkdir (FatFile *dir, const char *path, bool pFlag=true)
 
const char * name () const
 
bool open (FatVolume *vol, const char *path, oflag_t oflag)
 
bool open (FatFile *dirFile, uint16_t index, oflag_t oflag)
 
bool open (FatFile *dirFile, const char *path, oflag_t oflag)
 
bool open (const char *path, oflag_t oflag=O_RDONLY)
 
bool openNext (FatFile *dirFile, oflag_t oflag=O_RDONLY)
 
bool openRoot (FatVolume *vol)
 
int peek ()
 
bool preAllocate (uint32_t length)
 
size_t printAccessDate (print_t *pr)
 
size_t printAccessDateTime (print_t *pr)
 
size_t printCreateDateTime (print_t *pr)
 
size_t printField (double value, char term, uint8_t prec=2)
 
size_t printField (float value, char term, uint8_t prec=2)
 
template<typename Type >
size_t printField (Type value, char term)
 
size_t printFileSize (print_t *pr)
 
size_t printModifyDateTime (print_t *pr)
 
size_t printName (print_t *pr)
 
size_t printSFN (print_t *pr)
 
int read ()
 
int read (void *buf, size_t count)
 
int8_t readDir (DirFat_t *dir)
 
bool remove ()
 
bool remove (const char *path)
 
bool rename (const char *newPath)
 
bool rename (FatFile *dirFile, const char *newPath)
 
void rewind ()
 
bool rmdir ()
 
bool rmRfStar ()
 
bool seekCur (int32_t offset)
 
bool seekEnd (int32_t offset=0)
 
bool seekSet (uint32_t pos)
 
bool sync ()
 
bool timestamp (uint8_t flags, uint16_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second)
 
bool truncate ()
 
bool truncate (uint32_t length)
 
size_t write (const char *str)
 
size_t write (uint8_t b)
 
size_t write (const void *buf, size_t count)
 
bool ls (uint8_t flags=0)
 
size_t printName ()
 
- Protected Member Functions inherited from ios
 ios ()
 
 operator const void * () const
 
bool operator! () const
 
 operator bool () const
 
iostate rdstate () const
 
bool good () const
 
bool eof () const
 
bool fail () const
 
bool bad () const
 
void clear (iostate state=goodbit)
 
void setstate (iostate state)
 
- Protected Member Functions inherited from ios_base
uint8_t flagsToBase ()
 
 ios_base ()
 
char fill ()
 
char fill (char c)
 
fmtflags flags () const
 
fmtflags flags (fmtflags fl)
 
int precision () const
 
int precision (unsigned int n)
 
fmtflags setf (fmtflags fl)
 
fmtflags setf (fmtflags fl, fmtflags mask)
 
void unsetf (fmtflags fl)
 
unsigned width ()
 
unsigned width (unsigned n)
 

Private Attributes

ios::openmode m_mode
 

Additional Inherited Members

- Public Types inherited from ios_base
enum  seekdir { beg , cur , end }
 
typedef unsigned char iostate
 
typedef uint32_t streamsize
 
typedef uint32_t pos_type
 
typedef int32_t off_type
 
typedef uint64_t streamsize
 
typedef uint64_t pos_type
 
typedef int64_t off_type
 
typedef unsigned int fmtflags
 
typedef uint8_t openmode
 
- Public Member Functions inherited from ios
 ios ()
 
 operator const void * () const
 
bool operator! () const
 
 operator bool () const
 
iostate rdstate () const
 
bool good () const
 
bool eof () const
 
bool fail () const
 
bool bad () const
 
void clear (iostate state=goodbit)
 
void setstate (iostate state)
 
- Public Member Functions inherited from ios_base
 ios_base ()
 
char fill ()
 
char fill (char c)
 
fmtflags flags () const
 
fmtflags flags (fmtflags fl)
 
int precision () const
 
int precision (unsigned int n)
 
fmtflags setf (fmtflags fl)
 
fmtflags setf (fmtflags fl, fmtflags mask)
 
void unsetf (fmtflags fl)
 
unsigned width ()
 
unsigned width (unsigned n)
 
- Static Public Attributes inherited from ios_base
static const iostate goodbit = 0x00
 
static const iostate badbit = 0X01
 
static const iostate eofbit = 0x02
 
static const iostate failbit = 0X04
 
static const fmtflags left = 0x0001
 
static const fmtflags right = 0x0002
 
static const fmtflags internal = 0x0004
 
static const fmtflags dec = 0x0008
 
static const fmtflags hex = 0x0010
 
static const fmtflags oct = 0x0020
 
static const fmtflags boolalpha = 0x0100
 
static const fmtflags showbase = 0x0200
 
static const fmtflags showpoint = 0x0400
 
static const fmtflags showpos = 0x0800
 
static const fmtflags skipws = 0x1000
 
static const fmtflags uppercase = 0x4000
 
static const fmtflags adjustfield = left | right | internal
 
static const fmtflags basefield = dec | hex | oct
 
static const openmode app = 0X4
 
static const openmode ate = 0X8
 
static const openmode binary = 0X10
 
static const openmode in = 0X20
 
static const openmode out = 0X40
 
static const openmode trunc = 0X80
 
- Protected Types inherited from ios_base
enum  seekdir { beg , cur , end }
 
typedef unsigned char iostate
 
typedef uint32_t streamsize
 
typedef uint32_t pos_type
 
typedef int32_t off_type
 
typedef uint64_t streamsize
 
typedef uint64_t pos_type
 
typedef int64_t off_type
 
typedef unsigned int fmtflags
 
typedef uint8_t openmode
 
- Static Protected Member Functions inherited from FatFile
static bool legal83Char (uint8_t c)
 
static void printFatDate (print_t *pr, uint16_t fatDate)
 
static void printFatTime (print_t *pr, uint16_t fatTime)
 
- Static Protected Attributes inherited from ios_base
static const iostate goodbit = 0x00
 
static const iostate badbit = 0X01
 
static const iostate eofbit = 0x02
 
static const iostate failbit = 0X04
 
static const fmtflags left = 0x0001
 
static const fmtflags right = 0x0002
 
static const fmtflags internal = 0x0004
 
static const fmtflags dec = 0x0008
 
static const fmtflags hex = 0x0010
 
static const fmtflags oct = 0x0020
 
static const fmtflags boolalpha = 0x0100
 
static const fmtflags showbase = 0x0200
 
static const fmtflags showpoint = 0x0400
 
static const fmtflags showpos = 0x0800
 
static const fmtflags skipws = 0x1000
 
static const fmtflags uppercase = 0x4000
 
static const fmtflags adjustfield = left | right | internal
 
static const fmtflags basefield = dec | hex | oct
 
static const openmode app = 0X4
 
static const openmode ate = 0X8
 
static const openmode binary = 0X10
 
static const openmode in = 0X20
 
static const openmode out = 0X40
 
static const openmode trunc = 0X80
 

Detailed Description

base type for FAT and exFAT streams

Member Function Documentation

◆ clearWriteError()

void StreamBaseClass::clearWriteError ( )
inlineprotected

◆ getch()

int16_t StreamBaseClass::getch ( )
protected

Copyright (c) 2011-2020 Bill Greiman This file is part of the SdFat library for SD memory cards.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

◆ getmode()

ios::openmode StreamBaseClass::getmode ( )
inlineprotected

Internal do not use

Returns
mode

◆ getWriteError()

bool StreamBaseClass::getWriteError ( )
inlineprotected

◆ open()

void StreamBaseClass::open ( const char *  path,
ios::openmode  mode 
)
protected

◆ putch()

void StreamBaseClass::putch ( char  c)
protected

◆ putstr()

void StreamBaseClass::putstr ( const char *  str)
protected

◆ seekoff()

bool StreamBaseClass::seekoff ( off_type  off,
seekdir  way 
)
protected

◆ seekpos()

bool StreamBaseClass::seekpos ( pos_type  pos)
inlineprotected

Internal do not use

Parameters
[in]pos

◆ setmode()

void StreamBaseClass::setmode ( ios::openmode  mode)
inlineprotected

Internal do not use

Parameters
[in]mode

◆ write() [1/2]

void StreamBaseClass::write ( char  c)
protected

◆ write() [2/2]

int StreamBaseClass::write ( const void *  buf,
size_t  n 
)
protected

Member Data Documentation

◆ m_mode

ios::openmode StreamBaseClass::m_mode
private

The documentation for this class was generated from the following files: