File.h
Go to the documentation of this file.
Definition: Delegate.h:20
Delegate< int(const char *buffer, size_t size)> ReadContentCallback
Callback for readContent method.
Definition: Components/IFS/src/include/IFS/FileSystem.h:305
file_offset_t readContent(ReadContentCallback callback)
Read from current file position to end of file and invoke callback for each block read.
Definition: File.h:349
int getUserAttribute(uint8_t tagValue, ParamTypes... params)
Definition: File.h:276
bool truncate()
Truncate an open file at the current cursor position.
Definition: File.h:208
bool setUserAttribute(uint8_t tagValue, ParamTypes... params)
Definition: File.h:270
file_offset_t readContent(size_t size, ReadContentCallback callback)
Read from current file position and invoke callback for each block read.
Definition: File.h:336
FileHandle release()
Return current file handle and release ownership.
Definition: File.h:382
file_offset_t seek(file_offset_t offset, SeekOrigin origin)
change file read/write position
Definition: File.h:157
int getAttribute(AttributeTag tag, ParamTypes... params)
Definition: File.h:264
bool setAttribute(AttributeTag tag, ParamTypes... params)
Definition: File.h:258
static constexpr OpenFlags Create
Create file if it doesn't exist.
Definition: File.h:41
static constexpr OpenFlags Truncate
Truncate existing file to zero length.
Definition: File.h:43
int write(const void *data, size_t size)
write content to a file at current position and advance cursor
Definition: File.h:137
bool setcompression(const Compression &compression)
Set file compression information.
Definition: File.h:252
int getExtents(Storage::Partition *part, Extent *list, uint16_t extcount)
Definition: File.h:389
int enumAttributes(AttributeEnumCallback callback, void *buffer, size_t bufsize)
Definition: File.h:294
int read(void *data, size_t size)
read content from a file and advance cursor
Definition: File.h:123
String getContent()
Read content of the file, from current position.
Definition: File.h:364
bool open(const T &path, OpenFlags flags=OpenFlag::Read)
open a file by name/path
Definition: File.h:94
int control(ControlCode code, void *buffer, size_t bufSize)
Low-level and non-standard file control operations.
Definition: File.h:80
bool setacl(const ACL &acl)
Set access control information for file.
Definition: File.h:230
bool truncate(file_size_t new_size)
Truncate (reduce) the size of an open file.
Definition: File.h:197
static constexpr OpenFlags CreateNewAlways
Create new file or overwrite file if it exists.
Definition: File.h:44
Definition: FsBase.h:34
bool check(int64_t res)
Check file operation result and note error code.
Definition: FsBase.h:83
const char * c_str() const
Get a constant (un-modifiable) pointer to String content.
Definition: WString.h:616
bool setLength(size_t length)
set the string length accordingly, expanding if necessary
size_t length(void) const
Obtain the String length in characters, excluding NUL terminator.
Definition: WString.h:243
Definition: DirectoryTemplate.h:37
ControlCode
See IFS::IFileSystem::fcontrol
Definition: Components/IFS/src/include/IFS/Control.h:31
Definition: Access.h:34