Evo C++ Library v0.5.1
Public Types | Public Member Functions | Public Attributes | List of all members
SysDir Struct Reference

#include <evo/impl/sysio_dir.h>

Detailed Description

System directory reader (used internally).

Public Types

typedef DIR * Handle
 System directory handle. More...
 

Public Member Functions

 SysDir ()
 Constructor. More...
 
 ~SysDir ()
 Destructor. More...
 
bool chdir ()
 Change current working directory to currently open directory. More...
 
void close ()
 Close currently open directory, if any. More...
 
Error open (const char *path)
 Open directory for reading. More...
 
template<class TStr >
bool read (TStr &entry)
 Read next directory entry. More...
 
void seek ()
 Seek to beginning of directory. More...
 

Public Attributes

Handle handle
 System directory handle. More...
 

Member Typedef Documentation

◆ Handle

typedef DIR* Handle

System directory handle.

Constructor & Destructor Documentation

◆ SysDir()

SysDir ( )
inline

Constructor.

◆ ~SysDir()

~SysDir ( )
inline

Destructor.

Member Function Documentation

◆ chdir()

bool chdir ( )
inline

Change current working directory to currently open directory.

Returns
Whether successful, false if directory not open or permission denied

◆ close()

void close ( )
inline

Close currently open directory, if any.

◆ open()

Error open ( const char *  path)
inline

Open directory for reading.

Parameters
pathDirectory path to open, must be terminated
Returns
ENone on success, error code on other error

◆ read()

bool read ( TStr &  entry)
inline

Read next directory entry.

  • Call seek() to move back to the first entry
  • Caution: Result string will reference internal memory that will be invalid on next read() or on close() (even with String type)
Template Parameters
TStrString type to store entry (SubString preferred), inferred from argument
Parameters
entrySubString to store the entry, set to null after last entry [out]
Returns
Whether entry read, false if no more entries

◆ seek()

void seek ( )
inline

Seek to beginning of directory.

  • After this read() will return entries from the beginning

Member Data Documentation

◆ handle

Handle handle

System directory handle.


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