Design Pattern Examples
Overview of object-oriented design patterns
FileDirEntry Struct Reference

Structure representing a File (FileEntry) or Directory (DirEntry) entry. This is included as the first element of FileEntry and DirEntry structures. It allows those structures to be cast as a FileDirEntry*. More...

#include <Composite_FileDirEntry.h>

Collaboration diagram for FileDirEntry:
Collaboration graph

Public Attributes

FileDirTypes fileDirType
 Value from the FileDirTypes enumeration indicating what type of entry this is a part of. Call the FileDirEntry_GetFileDirType() function to get this value.
 
const char * name
 Name of this entry. Use the FileDirEntry_GetName() function to get this value.
 
long length
 Length of this entry. For DirEntry objects, this is computed when getting the length by calling the FileDirEntry_GetLength() function.
 
time_t whenModified
 Timestamp of when this entry was last "modified". Use the FileDirEntry_GetWhenModified() function to get this value.
 
struct FileDirEntrynext
 Points to the next entry in a linked list of FileDirEntry objects. NULL means no more in list.
 

Detailed Description

Structure representing a File (FileEntry) or Directory (DirEntry) entry. This is included as the first element of FileEntry and DirEntry structures. It allows those structures to be cast as a FileDirEntry*.

Definition at line 43 of file c/Composite_FileDirEntry.h.

Member Data Documentation

◆ fileDirType

FileDirTypes fileDirType

Value from the FileDirTypes enumeration indicating what type of entry this is a part of. Call the FileDirEntry_GetFileDirType() function to get this value.

Definition at line 50 of file c/Composite_FileDirEntry.h.

Referenced by _DestroyTree(), _NewDirEntry(), _NewFileEntry(), FileDirEntry_GetChildren(), FileDirEntry_GetFileDirType(), and FileDirEntry_GetLength().

◆ length

long length

Length of this entry. For DirEntry objects, this is computed when getting the length by calling the FileDirEntry_GetLength() function.

Definition at line 62 of file c/Composite_FileDirEntry.h.

Referenced by _NewFileEntry(), and FileDirEntry_GetLength().

◆ name

const char* name

Name of this entry. Use the FileDirEntry_GetName() function to get this value.

Definition at line 56 of file c/Composite_FileDirEntry.h.

Referenced by _NewDirEntry(), _NewFileEntry(), and FileDirEntry_GetName().

◆ next

struct FileDirEntry* next

Points to the next entry in a linked list of FileDirEntry objects. NULL means no more in list.

Definition at line 74 of file c/Composite_FileDirEntry.h.

Referenced by _AddChild(), _FindEntry(), Composite_Exercise_FormatEntry(), and FileDirEntry_GetLength().

◆ whenModified

time_t whenModified

Timestamp of when this entry was last "modified". Use the FileDirEntry_GetWhenModified() function to get this value.

Definition at line 68 of file c/Composite_FileDirEntry.h.

Referenced by _NewDirEntry(), _NewFileEntry(), and FileDirEntry_GetWhenModified().


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