Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

Directory Class Reference

#include <Directory.h>

List of all members.


Detailed Description

The Directory class stores information about a directory, its sub-directories and all files in the directories.

It can be used to get all information at once, without having to handle the recursive calls. The files and directories are stored in a flat structure.

Author:
Thomas Jacob

Definition at line 66 of file Directory.h.

Public Member Functions

void AppendEntry (DirectoryEntry *Entry)
 Appends an entry to the directory object.

void DeleteAll ()
 Removes and frees all entries in the directory object.

bool DeleteEntry (DirectoryEntry *Entry)
 Removes and frees a directory entry.

bool DeleteEntry (long nr)
 Removes and frees a directory entry.

bool DeleteFirstEntry ()
 Removes and frees the first directory entry.

bool DeleteLastEntry ()
 Removes and frees the last directory entry.

 Directory ()
 Creates a new directory.

DirectoryEntryGetEntry (long nr)
 Returns the directory entry at a given position.

int GetEntryCount ()
 Returns the number of directory entries.

DirectoryEntryGetFirstEntry ()
 Returns the first directory entry.

DirectoryEntryGetLastEntry ()
 Returns the last directory entry.

void InsertEntry (DirectoryEntry *Entry, long nr)
 Inserts an directory entry before a given position.

bool IsEmpty ()
 Returns, if there are no entries in the directory.

void PrependEntry (DirectoryEntry *Entry)
 Prepends an entry to the directory object.

void ReadFrom (Path *Root, const char *filter, int requiredAttributes, int forbiddenAttributes, bool recurse)
 Adds all files and/or directories from a given root to the directory object.

void ReadFrom (Path *RootWithFilter, int requiredAttributes, int forbiddenAttributes, bool recurse)
 Adds all files and/or directories from a given root to the directory object.

void ReadFrom (const char *root, const char *filter, int requiredAttributes, int forbiddenAttributes, bool recurse)
 Adds all files and/or directories from a given root to the directory object.

void ReadFrom (const char *rootWithFilter, int requiredAttributes, int forbiddenAttributes, bool recurse)
 Adds all files and/or directories from a given root to the directory object.

DirectoryEntryUnlinkEntry (DirectoryEntry *Entry)
 Removes a given directory entry from the array.

DirectoryEntryUnlinkEntry (long nr)
 Removes a directory entry at a given position.

DirectoryEntryUnlinkFirstEntry ()
 Removes the first directory entry from the array.

DirectoryEntryUnlinkLastEntry ()
 Removes the last directory entry from the array.

 ~Directory ()
 Destroys the directory.


Private Member Functions

void ReadFromInternal (Path *RootWithFilter, int requiredAttributes, int forbiddenAttributes, bool recurse)
 The main directory read recursion.


Private Attributes

ContainingList< DirectoryEntry > * Entries
 The entries of the read directory.


Constructor & Destructor Documentation

Directory  ) 
 

Creates a new directory.

~Directory  ) 
 

Destroys the directory.


Member Function Documentation

void AppendEntry DirectoryEntry Entry  )  [inline]
 

Appends an entry to the directory object.

Parameters:
Entry The entry to be appended.

void DeleteAll  )  [inline]
 

Removes and frees all entries in the directory object.

bool DeleteEntry DirectoryEntry Entry  )  [inline]
 

Removes and frees a directory entry.

Parameters:
Entry The entry to be removed.
Returns:
If the removal was successful.

bool DeleteEntry long  nr  )  [inline]
 

Removes and frees a directory entry.

Parameters:
nr The position of the entry.
Returns:
If the removal was successful.

bool DeleteFirstEntry  )  [inline]
 

Removes and frees the first directory entry.

Returns:
If the removal was successful.

bool DeleteLastEntry  )  [inline]
 

Removes and frees the last directory entry.

Returns:
If the removal was successful.

DirectoryEntry* GetEntry long  nr  )  [inline]
 

Returns the directory entry at a given position.

Parameters:
nr The position of the entry.
Returns:
The entry at the position.

int GetEntryCount  )  [inline]
 

Returns the number of directory entries.

Returns:
The number of directory entries.

DirectoryEntry* GetFirstEntry  )  [inline]
 

Returns the first directory entry.

Returns:
The first directory entry.

DirectoryEntry* GetLastEntry  )  [inline]
 

Returns the last directory entry.

Returns:
The last directory entry.

void InsertEntry DirectoryEntry Entry,
long  nr
[inline]
 

Inserts an directory entry before a given position.

All elements at and after the position are moved by one.

Parameters:
Entry The entry to be inserted.
nr The position to insert before.

bool IsEmpty  )  [inline]
 

Returns, if there are no entries in the directory.

void PrependEntry DirectoryEntry Entry  )  [inline]
 

Prepends an entry to the directory object.

Parameters:
Entry The entry to be prepended.

void ReadFrom Path Root,
const char *  filter,
int  requiredAttributes,
int  forbiddenAttributes,
bool  recurse
 

Adds all files and/or directories from a given root to the directory object.

Parameters:
Root The directory root to read from.
filter The filter for all files in the directory or sub-directories. The sub-directories themselves are not filtered by the filter.
requiredAttributes The attributes the files and/or directories have to have, to be added to the directory object.
forbiddenAttributes The attributes the files and/or directories must not have, to be added to the directory object.
recurse If the method shall recurse into sub-directories.

void ReadFrom Path RootWithFilter,
int  requiredAttributes,
int  forbiddenAttributes,
bool  recurse
 

Adds all files and/or directories from a given root to the directory object.

Parameters:
RootWithFilter The root to start from, appended by the filter for all files in the directory or sub-directories. The sub-directories themselves are not filtered by the filter.
requiredAttributes The attributes the files and/or directories have to have, to be added to the directory object.
forbiddenAttributes The attributes the files and/or directories must not have, to be added to the directory object.
recurse If the method shall recurse into sub-directories.

void ReadFrom const char *  root,
const char *  filter,
int  requiredAttributes,
int  forbiddenAttributes,
bool  recurse
 

Adds all files and/or directories from a given root to the directory object.

Parameters:
root The directory root to read from.
filter The filter for all files in the directory or sub-directories. The sub-directories themselves are not filtered by the filter.
requiredAttributes The attributes the files and/or directories have to have, to be added to the directory object.
forbiddenAttributes The attributes the files and/or directories must not have, to be added to the directory object.
recurse If the method shall recurse into sub-directories.

void ReadFrom const char *  rootWithFilter,
int  requiredAttributes,
int  forbiddenAttributes,
bool  recurse
 

Adds all files and/or directories from a given root to the directory object.

Parameters:
rootWithFilter The root to start from, appended by the filter for all files in the directory or sub-directories. The sub-directories themselves are not filtered by the filter.
requiredAttributes The attributes the files and/or directories have to have, to be added to the directory object.
forbiddenAttributes The attributes the files and/or directories must not have, to be added to the directory object.
recurse If the method shall recurse into sub-directories.

void ReadFromInternal Path RootWithFilter,
int  requiredAttributes,
int  forbiddenAttributes,
bool  recurse
[private]
 

The main directory read recursion.

Gets all matching files and/or directories and recurses, if desired, and fills the directory object with the entries.

Parameters:
RootWithFilter The directory root to read from.
requiredAttributes The attributes the files and/or directories have to have, to be added to the directory object.
forbiddenAttributes The attributes the files and/or directories must not have, to be added to the directory object.
recurse If the method shall recurse into sub-directories.

DirectoryEntry* UnlinkEntry DirectoryEntry Entry  )  [inline]
 

Removes a given directory entry from the array.

The entry is not freed, but returned.

Parameters:
Entry The entry to be removed.
Returns:
The directory entry.

DirectoryEntry* UnlinkEntry long  nr  )  [inline]
 

Removes a directory entry at a given position.

The entry is not freed, but returned.

Parameters:
nr The position of the entry.
Returns:
The directory entry.

DirectoryEntry* UnlinkFirstEntry  )  [inline]
 

Removes the first directory entry from the array.

The entry is not freed, but returned.

Returns:
The directory entry.

DirectoryEntry* UnlinkLastEntry  )  [inline]
 

Removes the last directory entry from the array.

The entry is not freed, but returned.

Returns:
The directory entry.


Member Data Documentation

ContainingList<DirectoryEntry>* Entries [private]
 

The entries of the read directory.

Definition at line 73 of file Directory.h.


The documentation for this class was generated from the following file:
Generated on Tue Oct 3 00:23:39 2006 for ToolBox by doxygen 1.3.6