

Public Types | |
| enum | { DirGood = 0, DirBad = 1 } |
Public Member Functions | |
| virtual bool | nextFile (std::string &) |
| UnixDirectory (const std::string &) | |
| virtual | ~UnixDirectory () |
Private Attributes | |
| DIR * | dir |
| string | dirname |
| int | status |
|
|
Definition at line 28 of file unixdirectory.cpp.
|
|
|
Definition at line 40 of file unixdirectory.cpp.
|
|
|
Definition at line 48 of file unixdirectory.cpp. References dir. 00049 {
00050 if (dir != NULL)
00051 {
00052 closedir(dir);
00053 dir = NULL;
00054 }
00055 }
|
|
|
Implements Directory. Definition at line 58 of file unixdirectory.cpp. References dir, DirBad, DirGood, dirname, and status. 00059 {
00060 if (status != DirGood)
00061 return false;
00062
00063 if (dir == NULL)
00064 {
00065 dir = opendir(dirname.c_str());
00066 if (dir == NULL)
00067 {
00068 status = DirBad;
00069 return false;
00070 }
00071 }
00072
00073 struct dirent* ent = readdir(dir);
00074 if (ent == NULL)
00075 {
00076 status = DirBad;
00077 return false;
00078 }
00079 else
00080 {
00081 filename = ent->d_name;
00082 return true;
00083 }
00084 }
|
|
|
Definition at line 36 of file unixdirectory.cpp. Referenced by nextFile(), and ~UnixDirectory(). |
|
|
Definition at line 34 of file unixdirectory.cpp. Referenced by nextFile(). |
|
|
Definition at line 35 of file unixdirectory.cpp. Referenced by nextFile(). |
1.4.1