OOFILE  1.9
Public Member Functions | Protected Attributes | List of all members
oofDelDirTreeVisitor Class Reference

utility visitor used to delete directory tree. More...

#include <ooffiles.h>

Inheritance diagram for oofDelDirTreeVisitor:
Inheritance graph
[legend]
Collaboration diagram for oofDelDirTreeVisitor:
Collaboration graph
[legend]

Public Member Functions

virtual bool enterDir (const oofFileRef &, oofDirectory *caller=0)
 Called before iterating an oofDirectory's contents. More...
 
virtual bool enterRoot (oofDirectory *caller=0)
 enterDir for starting directory More...
 
virtual bool handleLinkUnresolved (const oofFileRef &)
 default implementation returns false More...
 
virtual void leaveDir (const oofFileRef &, oofDirectory *caller)
 
 oofDelDirTreeVisitor (bool delSubdirs)
 
virtual void visit (const oofFileRef &, oofDirectory *caller)
 

Protected Attributes

bool mDelSubdirs
 flag to indicate if leave empty dir structure behind More...
 
short mDirDepth
 
bool mIgnoreBadAliases
 

Detailed Description

utility visitor used to delete directory tree.

Definition at line 185 of file ooffiles.h.

Constructor & Destructor Documentation

oofDelDirTreeVisitor::oofDelDirTreeVisitor ( bool  delSubdirs)

Definition at line 1706 of file ooffiles.cpp.

Member Function Documentation

bool oofDirectoryVisitor::enterDir ( const oofFileRef ,
oofDirectory caller = 0 
)
virtualinherited

Called before iterating an oofDirectory's contents.

The convention for subclasses is increment mDirDepth BEFORE any other processing in enterDir the reason being that we enter a directory as a result of iterating items in the preceding directory thus the very first directory being iterated is level 0 and we must increment BEFORE enterDir does anything to ensure that this dir is processed as level 1 or deeper.

Reimplemented in oofDirectoryList.

Definition at line 1617 of file ooffiles.cpp.

References oofDirectoryVisitor::mDirDepth.

Referenced by oofDirectory::visitFiles().

bool oofDirectoryVisitor::enterRoot ( oofDirectory caller = 0)
virtualinherited

enterDir for starting directory

default just updates depth.

for consistency in depth, best if overriden versions also call this or update depth

if wanted to treat just like any other dir, override with:

Returns
enterDir(oofFileRef(*caller));

Definition at line 1602 of file ooffiles.cpp.

References oofDirectoryVisitor::mDirDepth.

Referenced by oofDirectory::visitFiles().

bool oofDirectoryVisitor::handleLinkUnresolved ( const oofFileRef )
virtualinherited

default implementation returns false

Reimplemented in oofDirectoryList.

Definition at line 1587 of file ooffiles.cpp.

References oofDirectoryVisitor::mIgnoreBadAliases.

void oofDelDirTreeVisitor::leaveDir ( const oofFileRef ,
oofDirectory caller 
)
virtual

Reimplemented from oofDirectoryVisitor.

Definition at line 1712 of file ooffiles.cpp.

References oofFileRef::deleteFile(), oofFileRef::eDir, and mDelSubdirs.

void oofDelDirTreeVisitor::visit ( const oofFileRef fileRef,
oofDirectory caller 
)
virtual

Implements oofDirectoryVisitor.

Definition at line 1722 of file ooffiles.cpp.

References oofFileRef::deleteFile().

Member Data Documentation

bool oofDelDirTreeVisitor::mDelSubdirs
protected

flag to indicate if leave empty dir structure behind

Definition at line 193 of file ooffiles.h.

Referenced by leaveDir().

short oofDirectoryVisitor::mDirDepth
protectedinherited
bool oofDirectoryVisitor::mIgnoreBadAliases
protectedinherited

Definition at line 154 of file ooffiles.h.

Referenced by oofDirectoryVisitor::handleLinkUnresolved().


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