Represents a Directory entry. More...
#include <Composite_FileDirEntry.h>
Public Member Functions | |
DirEntry (std::string entryName, DateTime modDate, FileDirEntryList children) | |
Construct a DirEntry instance. | |
long | Length () |
Retrieve the size of all children of this directory. The length is calculated on the first call and cached for subsequent calls. | |
FileDirEntryList | Children () |
Retrieve the children of this node. | |
Public Member Functions inherited from FileDirEntry | |
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). | |
Public Attributes | |
FileDirEntryList | _children |
bool | _lengthSet |
Additional Inherited Members | |
Protected Attributes inherited from FileDirEntry | |
FileDirTypes | fileDirType |
std::string | name |
long | length |
DateTime | whenModified |
Represents a Directory entry.
A directory entry contains 0 or more children, which can be a mix of file and directory entries.
A Directory's size is the sum of all children sizes.
Definition at line 149 of file cplusplus/Composite_FileDirEntry.h.
|
inline |
Construct a DirEntry instance.
entryName | Name of the directory |
modDate | modification date time of the entry |
children | Array of children. Can be empty. |
Definition at line 161 of file cplusplus/Composite_FileDirEntry.h.
|
inlinevirtual |
Retrieve the children of this node.
This is an override of the base class and uses a collection of children entries stored in the DirEntry class so the base class doesn't need to store it.
Reimplemented from FileDirEntry.
Definition at line 199 of file cplusplus/Composite_FileDirEntry.h.
References DirEntry::_children.
|
inlinevirtual |
Retrieve the size of all children of this directory. The length is calculated on the first call and cached for subsequent calls.
This is an override of the base class to provide different behavior.
Reimplemented from FileDirEntry.
Definition at line 175 of file cplusplus/Composite_FileDirEntry.h.
References DirEntry::_children, DirEntry::_lengthSet, and FileDirEntry::length.
FileDirEntryList _children |
Definition at line 152 of file cplusplus/Composite_FileDirEntry.h.
Referenced by DirEntry::Children(), and DirEntry::Length().
bool _lengthSet |
Definition at line 153 of file cplusplus/Composite_FileDirEntry.h.
Referenced by DirEntry::Length().