Class daisy::FileTable¶
template <size_t max_slots>
#include <FileTable.h>
Public Static Attributes¶
| Type | Name |
|---|---|
| constexpr const size_t | kMaxCustomFileNameLen = [**\_MAX\_LFN**](ffconf_8h.md#define-_max_lfn) |
| constexpr const size_t | kMaxFileSlots = [**max\_slots**](classdaisy_1_1Apds9960.md) |
Public Functions¶
| Type | Name |
|---|---|
| void | Clear () |
| void | ClearLoadPending () |
| void | ClearSavePending () |
| bool | Fill (const char * path, const char * endswith=nullptr) |
| const char * | GetFileName (size_t idx) const |
| size_t | GetFileSize (size_t idx) const |
| size_t | GetNumFiles () const |
| int | GetSlotForSaveLoad () const |
| bool | IsFileInSlot (size_t idx) const |
| bool | IsLoadPending () const |
| bool | IsSavePending () const |
| void | SetLoadPending (int slot) |
| void | SetSavePending (int slot) |
| bool | WriteLog (const char * log_file_name) |
Detailed Description¶
Utility class for creating an index of file names and lengths from a given directory.
Useful for grouping .wav files for playback, etc.
Public Static Attributes Documentation¶
variable kMaxCustomFileNameLen¶
variable kMaxFileSlots¶
Public Functions Documentation¶
function Clear¶
Reset the table to its initial, empty state.
function ClearLoadPending¶
function ClearSavePending¶
function Fill¶
Search the path provided, and fill the table with files that match the pattern provided. The loaded files are sorted alphabetically by filename
Parameters:
pathpath to the directory to search.endswithstring suffix to compare to, often a file extension (i.e. ".wav") if this is null, then all files will be loaded.
Returns:
true if files are loaded, otherwise false
function GetFileName¶
Returns the name of the file in the specified slot.
function GetFileSize¶
Returns the size of the file in the specified slot.
function GetNumFiles¶
Returns the number of files found in the table.
function GetSlotForSaveLoad¶
function IsFileInSlot¶
Returns whether there is a file present at the index
function IsLoadPending¶
Flag-y bits for Loading and Saving This class can act like an interface for the actual I/O.
This has to be manually managed, but can be used to coordinate loading/storing data.
function IsSavePending¶
function SetLoadPending¶
function SetSavePending¶
function WriteLog¶
Generates a simple log file, and writes it to the destination
The file will contain a list of all of the files loaded, with their slot position, and file size.
The documentation for this class was generated from the following file external-docs/libDaisy/src/util/FileTable.h