Directory::Directory |
( |
int |
size | ) |
|
Directory::Directory Initialize a directory; initially, the directory is completely empty. If the disk is being formatted, an empty directory is all we need, but otherwise, we need to call FetchFrom in order to initialize it from disk.
- Parameters
-
size | is the number of entries in the directory |
bool Directory::Add |
( |
const char * |
name, |
|
|
int |
newSector |
|
) |
| |
Directory::Add Add a file into the directory. Return TRUE if successful;.
- Returns
- return FALSE if the file name is already in the directory, or if the directory is completely full, and has no more space for additional file names.
- Parameters
-
name | – the name of the file being added |
newSector | – the disk sector containing the added file's header |
void Directory::FetchFrom |
( |
OpenFile * |
file | ) |
|
Directory::FetchFrom Read the contents of the directory from disk.
- Parameters
-
file | – file containing the directory contents |
int Directory::Find |
( |
const char * |
name | ) |
|
Directory::Find Look up file name in directory, and return the disk sector number where the file's header is stored. Return -1 if the name isn't in the directory.
- Parameters
-
name | – the file name to look up |
bool Directory::Remove |
( |
const char * |
name | ) |
|
Directory::Remove Remove a file name from the directory. Return TRUE if successful;.
- Returns
- FALSE if the file isn't in the directory.
- Parameters
-
name | – the file name to be removed |
void Directory::WriteBack |
( |
OpenFile * |
file | ) |
|
Directory::WriteBack Write any modifications to the directory back to disk.
- Parameters
-
file | – file to contain the new directory contents |
The documentation for this class was generated from the following files: