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

Base class representing a File or Directory entry. More...

#include <Composite_FileDirEntry.h>

Inheritance diagram for FileDirEntry:
Inheritance graph
Collaboration diagram for FileDirEntry:
Collaboration graph

Public Member Functions

 FileDirEntry ()
 Default constructor.
 
 FileDirEntry (FileDirTypes type, std::string entryName, long size, DateTime modDate)
 Constructor.
 
virtual FileDirTypes FileDirType ()
 The type of this entry as represented by a value from the FileDirTypes enumeration.
 
virtual std::string Name ()
 The name of this entry.
 
virtual long Length ()
 The length in bytes of this entry. Directory entries are the sum of the length of all children.
 
virtual DateTime WhenModified ()
 When this entry was last modified.
 
virtual FileDirEntryList Children ()
 The children of this entry. Is empty if the entry can never have any children (that is, it isn't a container of other entries).
 

Protected Attributes

FileDirTypes fileDirType
 
std::string name
 
long length
 
DateTime whenModified
 

Detailed Description

Base class representing a File or Directory entry.

Definition at line 47 of file cplusplus/Composite_FileDirEntry.h.

Constructor & Destructor Documentation

◆ FileDirEntry() [1/2]

FileDirEntry ( )
inline

Default constructor.

Definition at line 59 of file cplusplus/Composite_FileDirEntry.h.

◆ FileDirEntry() [2/2]

FileDirEntry ( FileDirTypes  type,
std::string  entryName,
long  size,
DateTime  modDate 
)
inline

Constructor.

Parameters
typeValue from the FileDirTypes enumeration specifying the type of entry.
entryNameName of the entry.
sizeSize of the entry. Can be 0 for directories.
modDateDateTime object indicating when this entry was last modified.

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

Member Function Documentation

◆ Children()

virtual FileDirEntryList Children ( )
inlinevirtual

The children of this entry. Is empty if the entry can never have any children (that is, it isn't a container of other entries).

Reimplemented in DirEntry.

Definition at line 107 of file cplusplus/Composite_FileDirEntry.h.

Referenced by Composite_FileAccess::_FindEntry().

◆ FileDirType()

virtual FileDirTypes FileDirType ( )
inlinevirtual

The type of this entry as represented by a value from the FileDirTypes enumeration.

Definition at line 85 of file cplusplus/Composite_FileDirEntry.h.

References FileDirEntry::fileDirType.

◆ Length()

virtual long Length ( )
inlinevirtual

The length in bytes of this entry. Directory entries are the sum of the length of all children.

Reimplemented in DirEntry.

Definition at line 96 of file cplusplus/Composite_FileDirEntry.h.

References FileDirEntry::length.

◆ Name()

virtual std::string Name ( )
inlinevirtual

◆ WhenModified()

virtual DateTime WhenModified ( )
inlinevirtual

When this entry was last modified.

Definition at line 101 of file cplusplus/Composite_FileDirEntry.h.

References FileDirEntry::whenModified.

Member Data Documentation

◆ fileDirType

FileDirTypes fileDirType
protected

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

Referenced by FileDirEntry::FileDirType().

◆ length

long length
protected

Definition at line 52 of file cplusplus/Composite_FileDirEntry.h.

Referenced by FileDirEntry::Length(), and DirEntry::Length().

◆ name

std::string name
protected

Definition at line 51 of file cplusplus/Composite_FileDirEntry.h.

Referenced by FileDirEntry::Name().

◆ whenModified

DateTime whenModified
protected

Definition at line 53 of file cplusplus/Composite_FileDirEntry.h.

Referenced by FileDirEntry::WhenModified().


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