LittleFileSystem
Loading...
Searching...
No Matches
ntdv::IFile Class Referenceabstract

Interface for a file. More...

#include <IFile.h>

Inheritance diagram for ntdv::IFile:
ntdv::VirtualFile

Public Member Functions

virtual ~IFile ()=default
 Virtual destructor.
 
virtual size_t Write (const uint8_t *buf, size_t size)=0
 
virtual size_t Read (uint8_t *buf, size_t size)=0
 
virtual void Flush ()=0
 Flush the file buffer.
 
virtual bool Seek (uint32_t pos, SeekMode mode)=0
 
virtual size_t Position () const =0
 
virtual size_t Size () const =0
 
virtual bool SetBufferSize (size_t size)=0
 
virtual void Close ()=0
 Close the file.
 
virtual time_t GetLastWrite ()=0
 
virtual const char * Path () const =0
 
virtual const char * Name () const =0
 
virtual boolean IsDirectory ()=0
 
virtual FilePtr OpenNextFile (const char *mode)=0
 
virtual boolean SeekDir (long position)=0
 
virtual String GetNextFileName ()=0
 
virtual String GetNextFileName (bool *isDir)=0
 
virtual void RewindDirectory ()=0
 Go to the begining of the directory.
 
virtual operator bool ()=0
 

Detailed Description

Interface for a file.

Constructor & Destructor Documentation

◆ ~IFile()

virtual ntdv::IFile::~IFile ( )
virtualdefault

Virtual destructor.

Member Function Documentation

◆ Close()

virtual void ntdv::IFile::Close ( )
pure virtual

Close the file.

Implemented in ntdv::VirtualFile.

◆ Flush()

virtual void ntdv::IFile::Flush ( )
pure virtual

Flush the file buffer.

Implemented in ntdv::VirtualFile.

◆ GetLastWrite()

virtual time_t ntdv::IFile::GetLastWrite ( )
pure virtual

Get the last write time of the file

Returns
the last write time

Implemented in ntdv::VirtualFile.

◆ GetNextFileName() [1/2]

virtual String ntdv::IFile::GetNextFileName ( )
pure virtual

Get the name of the next file in the directory

Returns
the name of the next file

Implemented in ntdv::VirtualFile.

◆ GetNextFileName() [2/2]

virtual String ntdv::IFile::GetNextFileName ( bool * isDir)
pure virtual

Get the name of the next file in the directory and whether it is a directory

Parameters
isDir- pointer to a boolean to store whether the file is a directory
Returns
the name of the next file

Implemented in ntdv::VirtualFile.

◆ IsDirectory()

virtual boolean ntdv::IFile::IsDirectory ( )
pure virtual

Check if the file is a directory

Returns
true if the file is a directory, false otherwise

Implemented in ntdv::VirtualFile.

◆ Name()

virtual const char * ntdv::IFile::Name ( ) const
pure virtual

Get the name of the file

Returns
the file name

Implemented in ntdv::VirtualFile.

◆ OpenNextFile()

virtual FilePtr ntdv::IFile::OpenNextFile ( const char * mode)
pure virtual

Open the next file in the directory

Parameters
mode- mode to open the file in
Returns
a shared pointer to the opened file

Implemented in ntdv::VirtualFile.

◆ operator bool()

virtual ntdv::IFile::operator bool ( )
pure virtual

Check if the file is valid

Returns
true if the file is valid, false otherwise

Implemented in ntdv::VirtualFile.

◆ Path()

virtual const char * ntdv::IFile::Path ( ) const
pure virtual

Get the path of the file

Returns
the file path

Implemented in ntdv::VirtualFile.

◆ Position()

virtual size_t ntdv::IFile::Position ( ) const
pure virtual

Get the current position in the file

Returns
the current position

Implemented in ntdv::VirtualFile.

◆ Read()

virtual size_t ntdv::IFile::Read ( uint8_t * buf,
size_t size )
pure virtual

Read data from the file

Parameters
buf- buffer to store the data
size- size of the data to read
Returns
the number of bytes read

Implemented in ntdv::VirtualFile.

◆ RewindDirectory()

virtual void ntdv::IFile::RewindDirectory ( )
pure virtual

Go to the begining of the directory.

Implemented in ntdv::VirtualFile.

◆ Seek()

virtual bool ntdv::IFile::Seek ( uint32_t pos,
SeekMode mode )
pure virtual

Set a position in the file

Parameters
pos- position to seek to
mode- mode of seeking
Returns
true if successful, false otherwise

Implemented in ntdv::VirtualFile.

◆ SeekDir()

virtual boolean ntdv::IFile::SeekDir ( long position)
pure virtual

Seek to a position in the directory

Parameters
position- position to seek to
Returns
true if successful, false otherwise

Implemented in ntdv::VirtualFile.

◆ SetBufferSize()

virtual bool ntdv::IFile::SetBufferSize ( size_t size)
pure virtual

Set the buffer size for the file

Parameters
size- size of the buffer
Returns
true if successful, false otherwise

Implemented in ntdv::VirtualFile.

◆ Size()

virtual size_t ntdv::IFile::Size ( ) const
pure virtual

Get the size of the file

Returns
the size of the file

Implemented in ntdv::VirtualFile.

◆ Write()

virtual size_t ntdv::IFile::Write ( const uint8_t * buf,
size_t size )
pure virtual

Write data to the file

Parameters
buf- buffer containing the data
size- size of the data
Returns
the number of bytes written

Implemented in ntdv::VirtualFile.


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