Definition at line 110 of file osbfileutil.h.
typedef std::list<std::string> OSB_LIB::ScanDir::Result |
OSB_LIB::ScanDir::ScanDir | ( | const std::string & | dirPath | ) |
Constructor with directory to scan.
dirPath | Path of directory to scan, see also setPath(). |
OSB_LIB::ScanDir::~ScanDir | ( | ) |
Destructor: deletes curEntry_.
OSB_LIB::ScanDir::ScanDir | ( | const ScanDir & | ) | [private] |
Copy construction: not implemented.
void OSB_LIB::ScanDir::delEntry | ( | dirent *& | entry | ) | const [private] |
Delete a dirent structure.
entry | Pointer to dirent structure to delete. It is set to 0 should have been allocated with mkEntry(). |
const std::string& OSB_LIB::ScanDir::dirPath | ( | ) | const |
Path of currently scanned directory.
void OSB_LIB::ScanDir::mkCurEntry | ( | ) | [private] |
Adjust the size of curEntry_.
dirent* OSB_LIB::ScanDir::mkEntry | ( | size_t | s | ) | const [private] |
Allocate memory for a dirent structure.
s | Needed size, it should be pathconf(path, _PC_PATH_MAX)+1. |
The function signature deviates from the coding standard because struct dirent is of variable size and is allocated with new char[s]
. Thus returning a std::auto_ptr would result in wrong deletion of the pointer.
Assignment operator: not implemented.
size_t OSB_LIB::ScanDir::scan | ( | Select & | select | ) |
Scan the directory.
select | Function object that selects entries to include in result_. |
In order to avoid infinite recursion a return value containing 2 is ignored if curEntry_ denotes the current directory (".") or its parent ("..").
void OSB_LIB::ScanDir::setPath | ( | const std::string & | dirPath | ) |
Set the directory path.
dirPath | New directory path to use. The current working directory ("./") is used if it is empty. |
dirent* OSB_LIB::ScanDir::curEntry_ [private] |
Buffer for readdir_r().
Definition at line 182 of file osbfileutil.h.
std::string OSB_LIB::ScanDir::dirPath_ [private] |
size_t OSB_LIB::ScanDir::entrySize_ [private] |