ucommon::dir Class Reference

Convenience class for directories. More...

#include <fsys.h>

Inheritance diagram for ucommon::dir:

Inheritance graph
[legend]
Collaboration diagram for ucommon::dir:

Collaboration graph
[legend]

Public Member Functions

void close (void)
 Close and release directory object.
 dir ()
 Construct an unopened directory.
 dir (char *path)
 Construct and open a directory path.
int err (void)
 Get last error.
void open (char *path)
 Open a directory path for reading.
 operator bool ()
 Test if file descriptor is open.
bool operator! ()
 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 (char *path, unsigned mode)
 Simple direct method to create a directory.
static int remove (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 ( char *  path  ) 

Construct and open a directory path.

Parameters:
path of directory.


Member Function Documentation

static int ucommon::dir::create ( 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   )  [inline]

Get last error.

Returns:
error number.

Reimplemented from ucommon::fsys.

Definition at line 777 of file fsys.h.

void ucommon::dir::open ( char *  path  ) 

Open a directory path for reading.

Parameters:
path to open.

ucommon::dir::operator bool (  )  [inline]

Test if file descriptor is open.

Returns:
true if open.

Reimplemented from ucommon::fsys.

Definition at line 787 of file fsys.h.

bool ucommon::dir::operator! (  )  [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 ( char *  path  )  [static]

Remove an empty directory.

Parameters:
path of directory.
Returns:
error number or 0 on success.


The documentation for this class was generated from the following file:
Generated on 14 Aug 2013 for UCommon by  doxygen 1.4.7