DSL
Public Member Functions | List of all members
Directory Class Reference

Public Member Functions

 Directory (const char *dir)
 Constructor with directory path (ANSI/UTF-8). This constructor calls Open() with the dir you provide.
 
 Directory (const wchar_t *dir)
 Constructor with directory path (Unicode). This constructor calls Open() with the dir you provide.
 
bool Open (const char *dir)
 Open directory (ANSI/UTF-8)
 
bool Open (const wchar_t *dir)
 Open directory (Unicode)
 
bool Read (char *buf, unsigned long bufSize, bool *is_dir=NULL, int64 *size=NULL)
 
bool Read (wchar_t *buf, unsigned long bufSize, bool *is_dir=NULL, int64 *size=NULL)
 
void Close ()
 Close the directory. Will be called automatically during deconstruction.
 

Detailed Description

Definition at line 29 of file Directory.h.

Member Function Documentation

◆ Read() [1/2]

bool Directory::Read ( char *  buf,
unsigned long  bufSize,
bool *  is_dir = NULL,
int64 *  size = NULL 
)

Read a directory entry (ANSI/UTF-8)

Parameters
is_dir[optional] Will be set to true if entry is a directory.
size[optional] Size of the returned file. On Linux setting this to NULL will save a call to stat().
Returns
true true on success, false on error or end of the directory.

Definition at line 94 of file Directory.cpp.

References strlcpy().

◆ Read() [2/2]

bool Directory::Read ( wchar_t *  buf,
unsigned long  bufSize,
bool *  is_dir = NULL,
int64 *  size = NULL 
)

Read a directory entry (Unicode)

Parameters
is_dir[optional] Will be set to true if entry is a directory.
size[optional] Size of the returned file. On Linux setting this to NULL will save a call to stat().
Returns
true true on success, false on error or end of the directory.

Definition at line 173 of file Directory.cpp.


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