#include <directory_scanner.h>
Public Member Functions | |
Construction | |
| CL_DirectoryScanner () | |
| Constructs directory scanner for iterating over a directory. | |
| CL_DirectoryScanner (const CL_DirectoryScanner ©) | |
| Constructs a DirectoryScanner. | |
| ~CL_DirectoryScanner () | |
| Destructor. | |
Attributes | |
| CL_String | get_directory_path () |
| Gets the directory being scanned. | |
| CL_String | get_name () |
| Gets the name of the current file. | |
| int | get_size () |
| Gets the size of the current file. | |
| CL_String | get_pathname () |
| Gets the pathname of the current file. | |
| bool | is_directory () |
| Returns true if the current file is a directory. | |
| bool | is_hidden () |
| Returns true if the file is hidden. | |
| bool | is_readable () |
| Returns true if the file is readable by the current user. | |
| bool | is_writable () |
| Returns true if the file is writable by the current user. | |
Operations | |
| bool | scan (const CL_String &pathname) |
| Selects the directory to scan through. | |
| bool | scan (const CL_String &pathname, const CL_String &pattern) |
| Selects the directory to scan through. | |
| bool | next () |
| Find next file in directory scan. | |
CL_DirectoryScanner is used to parse through directory trees and return information about files.
Example that prints all files and directories found in the root directory:
CL_DirectoryScanner scanner;
if (scanner.scan("/", "*"))
{
while (scanner.next())
{
cl_console_write_line(scanner.get_name());
}
}
|
|
Constructs directory scanner for iterating over a directory.
|
|
|
Constructs a DirectoryScanner.
|
|
|
Destructor.
|
|
|
Gets the directory being scanned.
|
|
|
Gets the name of the current file.
|
|
|
Gets the pathname of the current file.
|
|
|
Gets the size of the current file.
|
|
|
Returns true if the current file is a directory.
|
|
|
Returns true if the file is hidden.
|
|
|
Returns true if the file is readable by the current user.
|
|
|
Returns true if the file is writable by the current user.
|
|
|
Find next file in directory scan.
|
|
||||||||||||
|
Selects the directory to scan through. Selects the directory to scan through and use a matching pattern on the files. WIN32: The pattern is normal DOS pattern matching ("*.*", ?) Unix: The pattern is normal pattern matching (*, ?)
|
|
|
Selects the directory to scan through. Selects the directory to scan through
|
1.4.6