ucommon::dir Class Reference
Convenience class for directories.
More...
#include <fsys.h>
Public Member Functions |
void | close (void) |
| Close and release directory object.
|
| dir () |
| Construct an unopened directory.
|
| dir (const char *path) |
| Construct and open a directory path.
|
int | err (void) const |
| Get last error.
|
void | open (const char *path) |
| Open a directory path for reading.
|
| operator bool () const |
| Test if file descriptor is open.
|
bool | operator! () const |
| Test if file descriptor is closed.
|
ssize_t | read (char *buffer, size_t count) |
| Read data from directory.
|
void | reset (void) |
| Reset error flag.
|
| ~dir () |
| Close and release directory.
|
Static Public Member Functions |
static int | create (const char *path, unsigned mode) |
| Simple direct method to create a directory.
|
static int | remove (const char *path) |
| Remove an empty directory.
|
Detailed Description
Convenience class for directories.
- Author:
- David Sugar <dyfet@gnutelephony.org>
Definition at line 716 of file fsys.h.
Constructor & Destructor Documentation
ucommon::dir::dir |
( |
const char * |
path |
) |
|
Construct and open a directory path.
- Parameters:
-
Member Function Documentation
static int ucommon::dir::create |
( |
const char * |
path, |
|
|
unsigned |
mode | |
|
) |
| | [static] |
Simple direct method to create a directory.
- Parameters:
-
| path | of directory to create. |
| mode | of directory. |
- Returns:
- error number or 0 on success.
int ucommon::dir::err |
( |
void |
|
) |
const [inline] |
Get last error.
- Returns:
- error number.
Reimplemented from ucommon::fsys.
Definition at line 777 of file fsys.h.
void ucommon::dir::open |
( |
const char * |
path |
) |
|
Open a directory path for reading.
- Parameters:
-
ucommon::dir::operator bool |
( |
|
) |
const [inline] |
bool ucommon::dir::operator! |
( |
|
) |
const [inline] |
Test if file descriptor is closed.
- Returns:
- true if closed.
Reimplemented from ucommon::fsys.
Definition at line 794 of file fsys.h.
ssize_t ucommon::dir::read |
( |
char * |
buffer, |
|
|
size_t |
count | |
|
) |
| | |
Read data from directory.
- Parameters:
-
| buffer | to read into. |
| count | of bytes to read. |
- Returns:
- bytes transferred, -1 if error.
static int ucommon::dir::remove |
( |
const char * |
path |
) |
[static] |
Remove an empty directory.
- Parameters:
-
- Returns:
- error number or 0 on success.
The documentation for this class was generated from the following file: