const char * FileDirEntry_GetName(FileDirEntry *entry)
Retrieve the name of the given FileDirEntry object.
long FileDirEntry_GetLength(FileDirEntry *entry)
Get the length of the given FileDirEntry object. For Files, this is a static value....
FileDirTypes FileDirEntry_GetFileDirType(FileDirEntry *entry)
Get the type of this FileDirEntry object as a value from the FileDirTypes enumeration.
FileDirEntry * FileDirEntry_GetChildren(FileDirEntry *entry)
Retrieve a pointer to the first child of the given FileDirEntry object. If the entry does not support...
time_t FileDirEntry_GetWhenModified(FileDirEntry *entry)
Retrieve the last modified time of the given FileDirEntry object.
FileDirTypes
Represents the type of entries allowed in the hierarchy for the Composite design pattern example.
@ FileDirType_Directory
Represents a directory entry that can contain other FileDirEntry components.
@ FileDirType_Unknown
Represents an unknown type and is considered an error condition.
Implementation of the FileDirEntry, FileEntry, and DirEntry classes used in the Composite Pattern.
Represents a Directory entry.
FileDirEntry * _children
Linked list of possible children. NULL if empty.
FileDirEntry base
Base FileDirEntry identifying this entry.
Structure representing a File (FileEntry) or Directory (DirEntry) entry. This is included as the firs...
FileDirTypes fileDirType
Value from the FileDirTypes enumeration indicating what type of entry this is a part of....
const char * name
Name of this entry. Use the FileDirEntry_GetName() function to get this value.
struct FileDirEntry * next
Points to the next entry in a linked list of FileDirEntry objects. NULL means no more in list.
long length
Length of this entry. For DirEntry objects, this is computed when getting the length by calling the F...
time_t whenModified
Timestamp of when this entry was last "modified". Use the FileDirEntry_GetWhenModified() function to ...