arduino-audio-tools
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SDIndex< SDT, FileT > Class Template Reference

We store all the relevant file names in an sequential index file. Form there we can access them via an index. More...

#include <SDIndex.h>

Public Member Functions

 SDIndex (SDT &sd)
 
void begin (const char *startDir, const char *extension, const char *file_name_pattern, bool setupIndex=true)
 
void ls (Print &p, const char *startDir, const char *extension, const char *file_name_pattern="*")
 
const char * operator[] (int idx)
 Access file name by index.
 
long size ()
 

Protected Member Functions

const char * fileName (FileT &file)
 Returns the filename w/o the path.
 
const char * fileNamePath (FileT &file)
 Returns the filename including the path.
 
String filePathString (const char *name, const char *suffix)
 
String getIndexDef ()
 
size_t indexFileTSize ()
 
bool isDirectory (FileT f)
 
bool isHidden (FileT f)
 
bool isValidAudioFile (FileT &file)
 checks if the file is a valid audio file
 
void listDir (Print &idxfile, const char *dirname)
 Writes the index file.
 
FileT open (const char *name)
 
FileT openNext (FileT &dir)
 
void popPath ()
 
void pushPath (const char *name)
 
void rewind (FileT f)
 
void saveIndexDef (String keyNew)
 

Protected Attributes

const char * ext = nullptr
 
const char * file_name_pattern = nullptr
 
List< String > file_path_stack
 
String file_path_str
 
String idx_defpath
 
String idx_path
 
long max_idx =-1
 
SDT * p_sd = nullptr
 
String result
 
const char * start_dir
 

Detailed Description

template<class SDT, class FileT>
class audio_tools::SDIndex< SDT, FileT >

We store all the relevant file names in an sequential index file. Form there we can access them via an index.


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