Implementation of the FileDirEntry_GetFileDirType(), FileDirEntry_GetLength(), FileDirEntry_GetChildren(), FileDirEntry_GetName(), and FileDirEntry_GetWhenModified() functions as used in support of the Composite Pattern example. More...
#include "Composite_FileDirEntry.h"
Go to the source code of this file.
Functions | |
FileDirTypes | FileDirEntry_GetFileDirType (FileDirEntry *entry) |
Get the type of this FileDirEntry object as a value from the FileDirTypes enumeration. | |
long | FileDirEntry_GetLength (FileDirEntry *entry) |
Get the length of the given FileDirEntry object. For Files, this is a static value. For Directories, this is computed once from all the children of the directory and stored internally. | |
FileDirEntry * | FileDirEntry_GetChildren (FileDirEntry *entry) |
Retrieve a pointer to the first child of the given FileDirEntry object. If the entry does not support children or the entry has no children, returns a NULL pointer. | |
const char * | FileDirEntry_GetName (FileDirEntry *entry) |
Retrieve the name of the given FileDirEntry object. | |
time_t | FileDirEntry_GetWhenModified (FileDirEntry *entry) |
Retrieve the last modified time of the given FileDirEntry object. | |
Implementation of the FileDirEntry_GetFileDirType(), FileDirEntry_GetLength(), FileDirEntry_GetChildren(), FileDirEntry_GetName(), and FileDirEntry_GetWhenModified() functions as used in support of the Composite Pattern example.
Definition in file Composite_FileDirEntry.c.
FileDirEntry * FileDirEntry_GetChildren | ( | FileDirEntry * | entry | ) |
Retrieve a pointer to the first child of the given FileDirEntry object. If the entry does not support children or the entry has no children, returns a NULL pointer.
entry | A FileDirEntry object to examine. |
Definition at line 62 of file Composite_FileDirEntry.c.
References DirEntry::_children, FileDirEntry::fileDirType, and FileDirType_Directory.
Referenced by _FindEntry(), and Composite_Exercise_FormatEntry().
FileDirTypes FileDirEntry_GetFileDirType | ( | FileDirEntry * | entry | ) |
Get the type of this FileDirEntry object as a value from the FileDirTypes enumeration.
entry | A FileDirEntry object to examine. |
Definition at line 13 of file Composite_FileDirEntry.c.
References FileDirEntry::fileDirType, and FileDirType_Unknown.
Referenced by Composite_Exercise_FormatEntry().
long FileDirEntry_GetLength | ( | FileDirEntry * | entry | ) |
Get the length of the given FileDirEntry object. For Files, this is a static value. For Directories, this is computed once from all the children of the directory and stored internally.
Definition at line 28 of file Composite_FileDirEntry.c.
References DirEntry::_children, DirEntry::_lengthSet, DirEntry::base, FileDirEntry_GetLength(), FileDirEntry::fileDirType, FileDirType_Directory, FileDirType_File, FileDirEntry::length, and FileDirEntry::next.
Referenced by Composite_Exercise_FormatEntry(), and FileDirEntry_GetLength().
const char * FileDirEntry_GetName | ( | FileDirEntry * | entry | ) |
Retrieve the name of the given FileDirEntry object.
entry | FileDirEntry object to examine. |
Definition at line 81 of file Composite_FileDirEntry.c.
References FileDirEntry::name.
Referenced by _FindEntry(), and Composite_Exercise_FormatEntry().
time_t FileDirEntry_GetWhenModified | ( | FileDirEntry * | entry | ) |
Retrieve the last modified time of the given FileDirEntry object.
entry | FileDirEntry object to examine. |
Definition at line 96 of file Composite_FileDirEntry.c.
References FileDirEntry::whenModified.
Referenced by Composite_Exercise_FormatEntry().