2004 by Marc J. Rochkind. All rights reserved. Portions marked "Open Source" may be copied under license.

 

Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

Ux::DirStream Class Reference
[C++ Wrapper for Standard UNIX Functions]

Inheritance diagram for Ux::DirStream:

Ux::Base List of all members.

Detailed Description

Definition at line 28 of file uxdirstream.hpp.

Public Member Functions

 DirStream (void)
dirent * get_entry (void)
const char * get_name (void)
void alloc (const char *path="/")
void free (void)
size_t get_max_name (const char *path="/")
void open (const char *path)
void open_alloc (const char *path)
void close (void)
bool read (void)
void rewind (void)
void seek (long loc)
long tell (void)

Protected Attributes

DIR * dirstream
dirent * entry


Constructor & Destructor Documentation

Ux::DirStream::DirStream void   )  [inline]
 

Definition at line 34 of file uxdirstream.hpp.


Member Function Documentation

void DirStream::alloc const char *  path = "/"  ) 
 

Calls malloc to allocate space for dirent.

Definition at line 25 of file uxdirstream.cpp.

References entry, errno, and get_max_name().

Referenced by open_alloc().

void DirStream::close void   ) 
 

Calls closedir.

Definition at line 73 of file uxdirstream.cpp.

References dirstream, and errno.

void DirStream::free void   ) 
 

Calls free to free directory entry.

Definition at line 36 of file uxdirstream.cpp.

References free().

Referenced by free().

struct dirent* Ux::DirStream::get_entry void   )  [inline]
 

Definition at line 37 of file uxdirstream.hpp.

size_t DirStream::get_max_name const char *  path = "/"  ) 
 

Calls pathconf to get _PC_NAME_MAX.

Definition at line 45 of file uxdirstream.cpp.

Referenced by alloc().

const char* Ux::DirStream::get_name void   )  [inline]
 

Definition at line 39 of file uxdirstream.hpp.

References dirent::d_name.

void DirStream::open const char *  path  ) 
 

Calls opendir.

Definition at line 55 of file uxdirstream.cpp.

References dirstream, and errno.

Referenced by open_alloc().

void DirStream::open_alloc const char *  path  ) 
 

Calls open and allocates space for directory entry.

Definition at line 64 of file uxdirstream.cpp.

References alloc(), and open().

bool DirStream::read void   ) 
 

Calls readdir_r.

Definition at line 82 of file uxdirstream.cpp.

References dirstream, and entry.

void DirStream::rewind void   ) 
 

Calls rewinddir.

Definition at line 95 of file uxdirstream.cpp.

References dirstream.

void DirStream::seek long  loc  ) 
 

Calls seekdir.

Definition at line 103 of file uxdirstream.cpp.

References dirstream.

long DirStream::tell void   ) 
 

Calls telldir.

Definition at line 111 of file uxdirstream.cpp.

References dirstream, and telldir().


Member Data Documentation

DIR* Ux::DirStream::dirstream [protected]
 

Definition at line 30 of file uxdirstream.hpp.

Referenced by close(), open(), read(), rewind(), seek(), and tell().

struct dirent* Ux::DirStream::entry [protected]
 

Definition at line 31 of file uxdirstream.hpp.

Referenced by alloc(), and read().


The documentation for this class was generated from the following files:
Generated on Fri Apr 23 10:57:16 2004 for AUP2 Example Source by doxygen 1.3.1