arduino-audio-tools
Loading...
Searching...
No Matches
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)
 
int indexOf (const char *filename)
 Find the index of a filename.
 
void ls (Print &p, const char *startDir, const char *extension, const char *file_name_pattern="*")
 
const charoperator[] (int idx)
 Access file name by index.
 
long size ()
 

Protected Member Functions

const charfileName (FileT &file)
 Returns the filename w/o the path.
 
const charfileNamePath (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 charext = nullptr
 
const charfile_name_pattern = nullptr
 
List< Stringfile_path_stack
 
String file_path_str
 
String idx_defpath
 
String idx_path
 
long max_idx = -1
 
SDTp_sd = nullptr
 
String result
 
const charstart_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.

Constructor & Destructor Documentation

◆ SDIndex()

template<class SDT , class FileT >
SDIndex ( SDT sd)
inline

Member Function Documentation

◆ begin()

template<class SDT , class FileT >
void begin ( const char startDir,
const char extension,
const char file_name_pattern,
bool  setupIndex = true 
)
inline

◆ fileName()

template<class SDT , class FileT >
const char * fileName ( FileT file)
inlineprotected

Returns the filename w/o the path.

◆ fileNamePath()

template<class SDT , class FileT >
const char * fileNamePath ( FileT file)
inlineprotected

Returns the filename including the path.

◆ filePathString()

template<class SDT , class FileT >
String filePathString ( const char name,
const char suffix 
)
inlineprotected

◆ getIndexDef()

template<class SDT , class FileT >
String getIndexDef ( )
inlineprotected

◆ indexFileTSize()

template<class SDT , class FileT >
size_t indexFileTSize ( )
inlineprotected

◆ indexOf()

template<class SDT , class FileT >
int indexOf ( const char filename)
inline

Find the index of a filename.

◆ isDirectory()

template<class SDT , class FileT >
bool isDirectory ( FileT f)
inlineprotected

◆ isHidden()

template<class SDT , class FileT >
bool isHidden ( FileT f)
inlineprotected

◆ isValidAudioFile()

template<class SDT , class FileT >
bool isValidAudioFile ( FileT file)
inlineprotected

checks if the file is a valid audio file

◆ listDir()

template<class SDT , class FileT >
void listDir ( Print idxfile,
const char dirname 
)
inlineprotected

Writes the index file.

◆ ls()

template<class SDT , class FileT >
void ls ( Print p,
const char startDir,
const char extension,
const char file_name_pattern = "*" 
)
inline

◆ open()

template<class SDT , class FileT >
FileT open ( const char name)
inlineprotected

◆ openNext()

template<class SDT , class FileT >
FileT openNext ( FileT dir)
inlineprotected

◆ operator[]()

template<class SDT , class FileT >
const char * operator[] ( int  idx)
inline

Access file name by index.

◆ popPath()

template<class SDT , class FileT >
void popPath ( )
inlineprotected

◆ pushPath()

template<class SDT , class FileT >
void pushPath ( const char name)
inlineprotected

◆ rewind()

template<class SDT , class FileT >
void rewind ( FileT f)
inlineprotected

◆ saveIndexDef()

template<class SDT , class FileT >
void saveIndexDef ( String  keyNew)
inlineprotected

◆ size()

template<class SDT , class FileT >
long size ( )
inline

Member Data Documentation

◆ ext

template<class SDT , class FileT >
const char* ext = nullptr
protected

◆ file_name_pattern

template<class SDT , class FileT >
const char* file_name_pattern = nullptr
protected

◆ file_path_stack

template<class SDT , class FileT >
List<String> file_path_stack
protected

◆ file_path_str

template<class SDT , class FileT >
String file_path_str
protected

◆ idx_defpath

template<class SDT , class FileT >
String idx_defpath
protected

◆ idx_path

template<class SDT , class FileT >
String idx_path
protected

◆ max_idx

template<class SDT , class FileT >
long max_idx = -1
protected

◆ p_sd

template<class SDT , class FileT >
SDT* p_sd = nullptr
protected

◆ result

template<class SDT , class FileT >
String result
protected

◆ start_dir

template<class SDT , class FileT >
const char* start_dir
protected

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