OOFILE  1.9
Public Member Functions | Protected Attributes | List of all members
oofDirectoryVisitor Class Referenceabstract

Abstract base class used to visit directory tree. More...

#include <ooffiles.h>

Inheritance diagram for oofDirectoryVisitor:
Inheritance 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=0)
 
 oofDirectoryVisitor (bool ignoreBadAliases=false)
 
virtual void visit (const oofFileRef &, oofDirectory *caller=0)=0
 
virtual ~oofDirectoryVisitor ()
 

Protected Attributes

short mDirDepth
 
bool mIgnoreBadAliases
 

Detailed Description

Abstract base class used to visit directory tree.

Descends tree depth first including traversing aliases on Mac.

Definition at line 141 of file ooffiles.h.

Constructor & Destructor Documentation

oofDirectoryVisitor::oofDirectoryVisitor ( bool  ignoreBadAliases = false)

Definition at line 1580 of file ooffiles.cpp.

virtual oofDirectoryVisitor::~oofDirectoryVisitor ( )
inlinevirtual

Definition at line 145 of file ooffiles.h.

Member Function Documentation

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

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 mDirDepth.

Referenced by oofDirectory::visitFiles().

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

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 mDirDepth.

Referenced by oofDirectory::visitFiles().

bool oofDirectoryVisitor::handleLinkUnresolved ( const oofFileRef )
virtual

default implementation returns false

Reimplemented in oofDirectoryList.

Definition at line 1587 of file ooffiles.cpp.

References mIgnoreBadAliases.

void oofDirectoryVisitor::leaveDir ( const oofFileRef ,
oofDirectory caller = 0 
)
virtual

Reimplemented in oofDelDirTreeVisitor, and oofDirectoryList.

Definition at line 1625 of file ooffiles.cpp.

References mDirDepth.

Referenced by oofDirectory::visitFiles().

virtual void oofDirectoryVisitor::visit ( const oofFileRef ,
oofDirectory caller = 0 
)
pure virtual

Member Data Documentation

short oofDirectoryVisitor::mDirDepth
protected
bool oofDirectoryVisitor::mIgnoreBadAliases
protected

Definition at line 154 of file ooffiles.h.

Referenced by handleLinkUnresolved().


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