Directory contents iteration class. More...
Public Member Functions | |
DirectorySearch () noexcept | |
Initialize a DirectorySearch class. | |
~DirectorySearch () | |
Closes any open directory. | |
eError | open (Filename *pDirName) noexcept |
Open a directory for scanning. | |
eError | open (const char *pDirName) noexcept |
Open a directory for scanning. | |
const char * | get_next_entry (void) noexcept |
Iterate on a directory and return the next found filename. | |
eError | get_next_entry (DirectoryEntry_t *pOutput) noexcept |
Iterate on a directory and return the next found filename. | |
eError | get_next_entry (DirectoryEntry_t *pOutput, const char *pExt) noexcept |
Iterate on a directory and return the next found filename that matches a specific file extension. | |
void | close (void) noexcept |
Release all memory and close the directory. | |
Static Public Attributes | |
static const uintptr_t | kDefaultReserve = 32U |
Initial array size for DirectoryEntry_t records in m_Entries. | |
Protected Member Functions | |
eError | direntry_copy (DirectoryEntry_t *pOutput, const DirectoryEntry_t *pInput) noexcept |
Internal function for copying DirectoryEntry_t. | |
Protected Attributes | |
SimpleArray< DirectoryEntry_t > | m_Entries |
Directory cache of stored entries. | |
uintptr_t | m_uIndex |
Index to the m_Entries array for get_next_entry() | |
Private Member Functions | |
DirectorySearch (const DirectorySearch &)=delete | |
DirectorySearch & | operator= (const DirectorySearch &)=delete |
DirectorySearch (DirectorySearch &&)=delete | |
DirectorySearch & | operator= (DirectorySearch &&)=delete |
Private Attributes | |
String | m_NativePath |
Linux/Android only, folder path for calling stat() | |
Directory contents iteration class.
To open and traverse a directory is this classes' main purpose. Given a BurgerLib formatted pathname, open the directory and iterate over it until all the names of the files contained are presented to the application for use.
Using it is very simple...
|
privatedelete |
|
privatedelete |
|
noexcept |
Burger::DirectorySearch::~DirectorySearch | ( | ) |
|
noexcept |
Release all memory and close the directory.
Release all resources allocated by the open(Filename*) call.
|
protectednoexcept |
Internal function for copying DirectoryEntry_t.
On some platforms, reading a directory only returns a filename list. For performance, only DirectoryEntry_t records are fully parsed on records when they are being used and records skipped will be ignored.
All other platforms, the entry is simply copied.
|
noexcept |
Iterate on a directory and return the next found filename.
Reads the current directory opened previously by a call to open( const char *) and stores the information into the supplied DirectoryEntry_t buffer.
|
noexcept |
Iterate on a directory and return the next found filename that matches a specific file extension.
Reads the current directory opened previously by a call to open(const char *) and initializes all of the internal public variables with information of the file that was found.
This differs from get_next_entry(void) in that only files that end with a specific file extension are returned. This is a case insensitive search.
pEntry | Pointer to an uninitialized DirectoryEntry_t |
pExt | Pointer to a "C" string of the file extension being scanned for. |
|
noexcept |
Iterate on a directory and return the next found filename.
If there is a directory entry in the queue, return the UTF8 encoded filename in the list.
|
noexcept |
Open a directory for scanning.
pDirName | Pointer to the "C" string filename in BurgerLib format. |
|
noexcept |
Open a directory for scanning.
pDirName | Pointer to the Filename object |
|
privatedelete |
|
privatedelete |
|
static |
Initial array size for DirectoryEntry_t records in m_Entries.
|
protected |
Directory cache of stored entries.
|
private |
Linux/Android only, folder path for calling stat()
|
protected |
Index to the m_Entries array for get_next_entry()