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

utility visitor used to output directory. More...

#include <ooffiles.h>

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

Public Member Functions

virtual bool enterDir (const oofFileRef &, oofDirectory *caller)
 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)
 
 oofDirectoryList (std::ostream &os, bool listFiles=true, const char *indentString=" ")
 
virtual void visit (const oofFileRef &, oofDirectory *caller)
 

Protected Member Functions

virtual void WriteIndent () const
 
virtual void WriteIndentedName (const oofFileRef &) const
 

Protected Attributes

short mDirDepth
 
long mFilesVisited
 
bool mIgnoreBadAliases
 
oofString mIndentString
 
bool mListFiles
 
std::ostream & mOS
 

Detailed Description

utility visitor used to output directory.

Definition at line 162 of file ooffiles.h.

Constructor & Destructor Documentation

oofDirectoryList::oofDirectoryList ( std::ostream &  os,
bool  listFiles = true,
const char *  indentString = "  " 
)

Definition at line 1634 of file ooffiles.cpp.

Member Function Documentation

bool oofDirectoryList::enterDir ( const oofFileRef ,
oofDirectory caller 
)
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 from oofDirectoryVisitor.

Definition at line 1660 of file ooffiles.cpp.

References oofDirectoryVisitor::mDirDepth, mFilesVisited, mListFiles, mOS, and WriteIndentedName().

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 oofDirectoryList::handleLinkUnresolved ( const oofFileRef )
virtual

default implementation returns false

Reimplemented from oofDirectoryVisitor.

Definition at line 1695 of file ooffiles.cpp.

References mOS, oofRuntimeEnv::termForLink(), and WriteIndentedName().

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

Reimplemented from oofDirectoryVisitor.

Definition at line 1672 of file ooffiles.cpp.

References oofDirectoryVisitor::mDirDepth, mFilesVisited, mListFiles, and mOS.

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

Implements oofDirectoryVisitor.

Definition at line 1684 of file ooffiles.cpp.

References mFilesVisited, mListFiles, mOS, and WriteIndentedName().

void oofDirectoryList::WriteIndent ( ) const
protectedvirtual

Definition at line 1643 of file ooffiles.cpp.

References oofDirectoryVisitor::mDirDepth, mIndentString, and mOS.

Referenced by WriteIndentedName().

void oofDirectoryList::WriteIndentedName ( const oofFileRef fileRef) const
protectedvirtual

Definition at line 1652 of file ooffiles.cpp.

References oofFileRef::filename(), mOS, and WriteIndent().

Referenced by enterDir(), handleLinkUnresolved(), and visit().

Member Data Documentation

short oofDirectoryVisitor::mDirDepth
protectedinherited
long oofDirectoryList::mFilesVisited
protected

Definition at line 175 of file ooffiles.h.

Referenced by enterDir(), leaveDir(), and visit().

bool oofDirectoryVisitor::mIgnoreBadAliases
protectedinherited

Definition at line 154 of file ooffiles.h.

Referenced by oofDirectoryVisitor::handleLinkUnresolved().

oofString oofDirectoryList::mIndentString
protected

Definition at line 176 of file ooffiles.h.

Referenced by WriteIndent().

bool oofDirectoryList::mListFiles
protected

Definition at line 177 of file ooffiles.h.

Referenced by enterDir(), leaveDir(), and visit().

std::ostream& oofDirectoryList::mOS
protected

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