![]() |
Max OS 0.3
|
Handles the file operations on the FAT32 filesystem. More...
#include <fat32.h>
Public Member Functions | |
| Fat32File (Fat32Volume *volume, Fat32Directory *parent, dir_entry_t *info, const string &name) | |
| Construct a new Fat32 File object. | |
| void | write (common::buffer_t *data, size_t amount) final |
| write data to the file (at the current seek position, updated to be += amount) | |
| void | read (common::buffer_t *data, size_t amount) final |
| read data from the file (at the current seek position, updated to be += amount) | |
| void | flush () final |
| Flush the file to the disk. | |
| uint32_t | first_cluster () const |
| Get the first cluster of the directory. | |
Public Member Functions inherited from MaxOS::filesystem::File | |
| void | seek (SeekType seek_type, size_t offset) |
| Seek to a position in the file. | |
| uint32_t | position () const |
| Get where the file is currently at (amount read/write/seeked) | |
| size_t | size () const |
| Get the size of the file. | |
| string | name () |
| Get the name of the file. | |
Additional Inherited Members | |
Protected Attributes inherited from MaxOS::filesystem::File | |
| uint32_t | m_offset = 0 |
| The current offset in the file. | |
| string | m_name |
| The name of the file. | |
| size_t | m_size = 0 |
| The size of the file. | |
| Fat32File::Fat32File | ( | Fat32Volume * | volume, |
| Fat32Directory * | parent, | ||
| dir_entry_t * | info, | ||
| const string & | name | ||
| ) |
Construct a new Fat32 File object.
| volume | The helper volume object |
| parent | The directory that contains this file |
| info | The directory entry information that describes this file |
| name | The name of the file |
Definition at line 239 of file fat32.cpp.
References MaxOS::filesystem::File::m_name, MaxOS::filesystem::File::m_offset, MaxOS::filesystem::File::m_size, and MaxOS::filesystem::File::name().
|
inline |
|
finalvirtual |
Flush the file to the disk.
Reimplemented from MaxOS::filesystem::File.
Definition at line 413 of file fat32.cpp.
References MaxOS::filesystem::File::flush().
|
finalvirtual |
read data from the file (at the current seek position, updated to be += amount)
| data | The byte buffer to read into |
| amount | The amount of data to read |
Reimplemented from MaxOS::filesystem::File.
Definition at line 361 of file fat32.cpp.
References MaxOS::filesystem::format::Fat32Volume::bpb, MaxOS::common::Buffer::clear(), MaxOS::common::Buffer::copy_from(), MaxOS::filesystem::format::Fat32Volume::data_lba, MaxOS::filesystem::format::Fat32Volume::disk, MaxOS::filesystem::File::m_offset, MaxOS::filesystem::format::Fat32Volume::next_cluster(), MaxOS::drivers::disk::Disk::read(), and MaxOS::common::Buffer::set_offset().
|
finalvirtual |
write data to the file (at the current seek position, updated to be += amount)
| data | The byte buffer to write |
| amount | The amount of data to write |
Reimplemented from MaxOS::filesystem::File.
Definition at line 260 of file fat32.cpp.
References MaxOS::filesystem::format::Fat32Volume::allocate_cluster(), MaxOS::filesystem::format::Fat32Volume::bpb, MaxOS::common::Buffer::clear(), MaxOS::common::Buffer::copy_from(), MaxOS::filesystem::format::Fat32Volume::data_lba, MaxOS::filesystem::format::Fat32Volume::disk, MaxOS::filesystem::File::m_offset, MaxOS::filesystem::File::m_size, MaxOS::filesystem::format::Fat32Volume::next_cluster(), MaxOS::drivers::disk::Disk::read(), MaxOS::filesystem::format::Fat32Directory::save_entry_to_disk(), MaxOS::common::Buffer::set_offset(), and MaxOS::drivers::disk::Disk::write().