#include <recursedir.hh>
Public Member Functions | |
| RecurseDir () | |
| ~RecurseDir () | |
| void | addFile (const char *name) |
| Provide single file/directory name to output or recurse into. | |
| void | addFile (const string &name) |
| Provide single file/directory name to output or recurse into. | |
| void | addFilesFrom (const char *name) |
| To read filenames from stdin, pass an empty string. | |
| void | addFilesFrom (const string &name) |
| bool | empty () const |
| Are there no filename sources present at all? | |
| bool | getName (string &result, struct stat *fileInfo=0, bool checkFiles=true) throw (RecurseError, bad_alloc) |
| Returns FAILURE if no more names. | |
Classes | |
| struct | DevIno |
| struct | Level |
It does follow symlinks, but will not output more than one name for an inode, and avoid symlink loops. If an inode can be reached both through its "normal" name and through symlinks during recursion into one directory, it is guaranteed that the normal name will be listed.
| RecurseDir::RecurseDir | ( | ) | [inline] |
| RecurseDir::~RecurseDir | ( | ) | [inline] |
| void RecurseDir::addFile | ( | const char * | name | ) | [inline] |
| void RecurseDir::addFile | ( | const string & | name | ) | [inline] |
Provide single file/directory name to output or recurse into.
| void RecurseDir::addFilesFrom | ( | const char * | name | ) | [inline] |
| void RecurseDir::addFilesFrom | ( | const string & | name | ) | [inline] |
| bool RecurseDir::empty | ( | ) | const [inline] |
Are there no filename sources present at all?
| bool RecurseDir::getName | ( | string & | result, | |
| struct stat * | fileInfo = 0, |
|||
| bool | checkFiles = true | |||
| ) | throw (RecurseError, bad_alloc) |
Returns FAILURE if no more names.
After a RecurseError has been thrown, it is no problem to continue using the object.
| result | Returned filename (output only) | |
| fileInfo | getName() must call stat() for any filename it returns, in order to determine whether it is a directory. If the information returned by stat() is useful for you, supply your own struct stat for getName() to use. | |
| checkFiles | if true, normal operation, check whether files exist before using cache entries. If false, only check whether cache entry present and return it if so. |
References isSymlink(), throw_RecurseError_forDir(), and throw_RecurseError_forObject().
Referenced by main(), and JigdoCache::readFilenames().
1.5.6