Bayonne2 / Common C++ 2 Framework
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Private Attributes
Dir Class Reference

A low level portable directory class. More...

#include <file.h>

Inheritance diagram for Dir:
Inheritance graph
[legend]
Collaboration diagram for Dir:
Collaboration graph
[legend]

Public Types

enum  Error {
  errSuccess = 0, errNotOpened, errMapFailed, errInitFailed,
  errOpenDenied, errOpenFailed, errOpenInUse, errReadInterrupted,
  errReadIncomplete, errReadFailure, errWriteInterrupted, errWriteIncomplete,
  errWriteFailure, errLockFailure, errExtended
}
 
typedef enum Error Error
 
enum  Access { accessReadOnly = O_RDONLY, accessWriteOnly = O_WRONLY, accessReadWrite = O_RDWR }
 
typedef enum Access Access
 
enum  Open {
  openReadOnly = O_RDONLY, openWriteOnly = O_WRONLY, openReadWrite = O_RDWR, openAppend = O_WRONLY | O_APPEND,
  openSync = O_RDWR, openTruncate = O_RDWR | O_TRUNC
}
 
typedef enum Open Open
 
enum  Attr { attrInvalid = 0, attrPrivate = 0400 | 0200, attrGroup = attrPrivate | 0040 | 0020, attrPublic = attrGroup | 0004 | 0002 }
 
typedef enum Attr Attr
 
enum  Mapping { mappedRead = accessReadOnly, mappedWrite = accessWriteOnly, mappedReadWrite = accessReadWrite }
 
typedef enum Mapping Mapping
 
enum  Complete { completionImmediate, completionDelayed, completionDeferred }
 
typedef enum Complete Complete
 

Public Member Functions

 Dir (const char *name=NULL)
 
void open (const char *name)
 
void close (void)
 
virtual ~Dir ()
 
const char * getName (void)
 
const char * operator++ ()
 
const char * operator++ (int)
 
const char * operator* ()
 
bool rewind (void)
 
bool operator! ()
 
bool isValid (void)
 

Static Public Member Functions

static bool create (const char *path, Attr attr=attrGroup)
 
static bool remove (const char *path)
 
static bool setPrefix (const char *path)
 
static bool getPrefix (char *path, size_t size=256)
 
static const char * getExtension (const char *path)
 
static const char * getFilename (const char *path)
 
static char * getFilename (const char *path, char *buffer, size_t size=64)
 
static char * getDirname (const char *path, char *buffer, size_t size=256)
 
static char * getRealpath (const char *path, char *buffer, size_t size=256)
 

Protected Types

typedef struct File::_fcb fcb_t
 

Private Attributes

DIR * dir
 
struct dirent * entry
 

Detailed Description

A low level portable directory class.

Used to support ccstd Directory container. This provides a basic mechanism for allocating and accessing file entries.

Author
David Sugar dyfet.nosp@m.@ost.nosp@m.el.co.nosp@m.m low level directory access class.

Definition at line 258 of file file.h.

Member Typedef Documentation

typedef enum Access File::Access
inherited

Definition at line 150 of file file.h.

typedef enum Attr File::Attr
inherited

Definition at line 213 of file file.h.

typedef enum Complete File::Complete
inherited

Definition at line 239 of file file.h.

typedef enum Error File::Error
inherited

Definition at line 137 of file file.h.

typedef struct File::_fcb File::fcb_t
protectedinherited
typedef enum Mapping File::Mapping
inherited

Definition at line 240 of file file.h.

typedef enum Open File::Open
inherited

Definition at line 183 of file file.h.

Member Enumeration Documentation

enum File::Access
inherited
Enumerator
accessReadOnly 
accessWriteOnly 
accessReadWrite 

Definition at line 139 of file file.h.

enum File::Attr
inherited
Enumerator
attrInvalid 
attrPrivate 
attrGroup 
attrPublic 

Definition at line 199 of file file.h.

enum File::Complete
inherited
Enumerator
completionImmediate 
completionDelayed 
completionDeferred 

Definition at line 233 of file file.h.

enum File::Error
inherited
Enumerator
errSuccess 
errNotOpened 
errMapFailed 
errInitFailed 
errOpenDenied 
errOpenFailed 
errOpenInUse 
errReadInterrupted 
errReadIncomplete 
errReadFailure 
errWriteInterrupted 
errWriteIncomplete 
errWriteFailure 
errLockFailure 
errExtended 

Definition at line 120 of file file.h.

enum File::Mapping
inherited
Enumerator
mappedRead 
mappedWrite 
mappedReadWrite 

Definition at line 228 of file file.h.

enum File::Open
inherited
Enumerator
openReadOnly 
openWriteOnly 
openReadWrite 
openAppend 
openSync 
openTruncate 

Definition at line 171 of file file.h.

Constructor & Destructor Documentation

Dir::Dir ( const char *  name = NULL)
virtual Dir::~Dir ( )
virtual

Member Function Documentation

void Dir::close ( void  )
static bool Dir::create ( const char *  path,
Attr  attr = attrGroup 
)
static
static char* File::getDirname ( const char *  path,
char *  buffer,
size_t  size = 256 
)
staticinherited
static const char* File::getExtension ( const char *  path)
staticinherited
static const char* File::getFilename ( const char *  path)
staticinherited
static char* File::getFilename ( const char *  path,
char *  buffer,
size_t  size = 64 
)
staticinherited
const char* Dir::getName ( void  )
static bool Dir::getPrefix ( char *  path,
size_t  size = 256 
)
static
static char* File::getRealpath ( const char *  path,
char *  buffer,
size_t  size = 256 
)
staticinherited
bool Dir::isValid ( void  )
void Dir::open ( const char *  name)
bool Dir::operator! ( )
inline

Definition at line 299 of file file.h.

const char* Dir::operator* ( )
const char* Dir::operator++ ( )
inline

Definition at line 289 of file file.h.

const char* Dir::operator++ ( int  )
inline

Definition at line 292 of file file.h.

static bool Dir::remove ( const char *  path)
static
bool Dir::rewind ( void  )
static bool Dir::setPrefix ( const char *  path)
static

Field Documentation

DIR* Dir::dir
private

Definition at line 262 of file file.h.

struct dirent* Dir::entry
private

Definition at line 267 of file file.h.


The documentation for this class was generated from the following file: