10from datetime
import datetime
83 def __init__(self, type = FileDirTypes.File, entryName = "", size = 0, modDate = datetime.now()):
120 def __init__(self, entryName : str, size : int, modDate : datetime):
121 super().
__init__(type=FileDirTypes.File, entryName=entryName, size=size, modDate=modDate)
172 def __init__(self, entryName: str, modDate: datetime, children : FileDirEntryList):
173 super().
__init__(type=FileDirTypes.Directory, entryName=entryName, modDate=modDate)
Represents a Directory entry.
_children
Children of this directory.
def Length(self)
Property getter for the size of all children of this directory: value = o.Length.
FileDirEntryList Children(self)
Property getter for the children of this node: value = o.Children.
def __init__(self, str entryName, datetime modDate, FileDirEntryList children)
Construct a DirEntry instance.
_lengthSet
True if the length has already been computed for this directory; otherwise, False.
Base class representing a File or Directory entry.
datetime WhenModified(self)
Property getter for when this entry was last modified: value = o.WhenModified
def __init__(self, type=FileDirTypes.File, entryName="", size=0, modDate=datetime.now())
Constructor.
_fileDirType
Value from the FileDirTypes enumeration indicating what type this entry is.
_whenModified
A datetime object indicating when this entry was last modified.
str Name(self)
Property getter for the name of this entry: value = o.Name
FileDirTypes FileDirType(self)
Property getter for the type of this entry as represented by a value from the FileDirTypes enumeratio...
_length
Size of this entry.
FileDirEntryList Children(self)
Property getter for the children of this entry: value = o.Children.
int Length(self)
Property getter for the length in bytes of this entry: value = o.Length.
Makes it easier to refer to a list of child nodes.
Represents the type of entries allowed in the hierarchy for the Composite design pattern example.
def __init__(self, str entryName, int size, datetime modDate)
Constructor.
Structure representing a File (FileEntry) or Directory (DirEntry) entry. This is included as the firs...