#include <FileSystem.h>

Inheritance diagram for File:
[legend]
Collaboration diagram for File:
[legend]

Public Member Functions

 File ()
 
- Public Member Functions inherited from IFS::File
 ~File ()
 
 operator bool () const
 
bool stat (Stat &stat)
 get file information More...
 
int control (ControlCode code, void *buffer, size_t bufSize)
 Low-level and non-standard file control operations. More...
 
template<typename T >
bool open (const T &path, OpenFlags flags=OpenFlag::Read)
 open a file by name/path More...
 
bool close ()
 close an open file More...
 
int read (void *data, size_t size)
 read content from a file and advance cursor More...
 
int write (const void *data, size_t size)
 write content to a file at current position and advance cursor More...
 
bool write (const String &s)
 
int seek (int offset, SeekOrigin origin)
 change file read/write position More...
 
bool eof ()
 determine if current file position is at end of file More...
 
int32_t tell ()
 get current file position More...
 
bool truncate (size_t new_size)
 Truncate (reduce) the size of an open file. More...
 
bool truncate ()
 Truncate an open file at the current cursor position. More...
 
bool flush ()
 flush any buffered data to physical media More...
 
bool setacl (const ACL &acl)
 Set access control information for file. More...
 
bool settime (time_t mtime)
 Set modification time for file. More...
 
bool setcompression (const Compression &compression)
 Set file compression information. More...
 
template<typename... ParamTypes>
bool setAttribute (AttributeTag tag, ParamTypes... params)
 
template<typename... ParamTypes>
int getAttribute (AttributeTag tag, ParamTypes... params)
 
template<typename... ParamTypes>
bool setUserAttribute (uint8_t tagValue, ParamTypes... params)
 
template<typename... ParamTypes>
int getUserAttribute (uint8_t tagValue, ParamTypes... params)
 
String getUserAttribute (uint8_t tagValue)
 
bool removeUserAttribute (uint8_t tagValue)
 
int enumAttributes (AttributeEnumCallback callback, void *buffer, size_t bufsize)
 
bool remove ()
 remove (delete) an open file (and close it) More...
 
uint32_t getSize ()
 Get size of file. More...
 
int readContent (size_t size, ReadContentCallback callback)
 Read from current file position and invoke callback for each block read. More...
 
int readContent (ReadContentCallback callback)
 Read from current file position to end of file and invoke callback for each block read. More...
 
String getContent ()
 Read content of a file. More...
 
- Public Member Functions inherited from IFS::FsBase
 FsBase (IFileSystem *filesys)
 
bool isValid () const
 
int getLastError ()
 determine if an error occurred during operation More...
 
String getErrorString (int err) const
 
String getLastErrorString () const
 
FileSystemgetFileSystem () const
 

Additional Inherited Members

- Public Types inherited from IFS::File
using ReadContentCallback = FileSystem::ReadContentCallback
 
- Static Public Attributes inherited from IFS::File
static constexpr OpenFlags ReadOnly {OpenFlag::Read}
 
static constexpr OpenFlags WriteOnly {OpenFlag::Write}
 
static constexpr OpenFlags ReadWrite {OpenFlag::Read | OpenFlag::Write}
 
static constexpr OpenFlags Create {OpenFlag::Create}
 
static constexpr OpenFlags Append {OpenFlag::Append}
 
static constexpr OpenFlags Truncate {OpenFlag::Truncate}
 
static constexpr OpenFlags CreateNewAlways {OpenFlag::Create | OpenFlag::Truncate}
 
- Protected Member Functions inherited from IFS::FsBase
bool check (int res)
 Check file operation result and note error code. More...
 
- Protected Attributes inherited from IFS::FsBase
int lastError {FS_OK}
 

Constructor & Destructor Documentation

◆ File()

File::File ( )
inline

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