#include <ooffiles.h>
Collaboration diagram for oofDirectory:

reflective functions | |
| bool | validDir () const |
| bool | containsFile (const char *justFileName) const |
| const oofString & | path () const |
| oofString | filename () const |
| bool | isEmpty () const |
| bool | createdDiskDir () const |
file lists and visiting | |
| oofFileList * | makeFileList () const |
| virtual void | visitFiles (oofDirectoryVisitor &, unsigned long remainingVisitDepth=1024, bool firstVisit=true) |
| Iterate through the directory tree applying Visitor. | |
| void | extract (std::ostream &) |
Public Member Functions | |
| oofDirectory () | |
| oofDirectory (short vRefNum, long dirID, bool searchForDirAllVols=false) | |
| oofDirectory (short vRefNum, long dirID, const char *fallBackPath, bool searchForDirAllVols=false) | |
| oofDirectory (const FSSpec &) | |
| oofDirectory (const char *path, char *outFileName=0, bool createSubdirsIfMissing=false, bool makeAbsolute=true) | |
| virtual | ~oofDirectory () |
| void | setDirFromPath (const char *path, char *outFileName=0, bool createSubdirsIfMissing=false, bool makeAbsolute=true) |
| setDirFromPath core conversion routine for external call or constructing oofDirectory from incoming path | |
| void | gotoDirectory () const |
| Change current dir to this oofDirectory. | |
| bool | openFile (const char *justFileName) const |
| launch files as if double-click on desktop | |
| void | delDirectory (bool delDirAsWellAsContents=true, bool delTree=true, bool delSubdirs=true) |
| void | fillInFSSpec (const char *nameCanBeNull, FSSpec &) const |
| Fill in an FSSpec from our current member variables. | |
| void | closeWDDirectory () |
Static Public Member Functions | |
| oofDirectory | createDirectory (const char *path) |
| bool | fileExists (const char *fullPath) |
| Confirm a file exists. | |
| void | gotoDirectory (const oofString &) |
| Make the directory identified by inPath the current default. | |
| oofString | FSSpecToPath (const FSSpec &) |
| void | gotoDirectory (short vRefNum, long dirID) |
| Make the directory identified by vRefNum & dirID the current default. | |
| const char * | parentDirPath () |
| const char * | relativeRootPath () |
| char | directoryTerminator () |
Protected Member Functions | |
| void | GetCurrentLocation () |
| Set this oofDirectory to point to current default location. | |
| void | PathToDirID (const unsigned char *pascalPath) |
| Sets the oofDirectory to point to the directory identified by the path alters the members: mDirID possibly the mVRefNum if path is absolute Uses working directories, updating mWorkingDirID. | |
| void | createDirID (const unsigned char *pascalPartialPath=0, bool searchForDirAllVols=false) |
| A simple wrapper to call the approriate directory method depending on target enviroment. | |
| void | CreateHardDirID (const unsigned char *pascalPartialPath, bool searchForDirAllVols) |
| void | CreateWorkingDirID (const unsigned char *pascalPartialPath=0, bool searchForDirAllVols=false) |
| Search for the directory from current location for the directory identified by the partial path and set: mWorkingDirID mValidDir mVRefNum if the dir is found. | |
| void | CreateSubDirs (const unsigned char *pascalPartialPath) |
| a simple wrapper to allow us to call CreateSubdirsAndWorkingDirID Will modify members: mWorkingDirID mVRefNum | |
| void | CreateSubdirsAndWorkingDirID (const unsigned char *pascalPartialPath) |
| Find the directory identified by pascalPartialPath and make the oofDirectory point to the directory. | |
Protected Attributes | |
| short | mVRefNum |
| volume number of a mounted volume, not meaningful over reboots | |
| short | mWorkingDirID |
| old Mac Classic Working Directory number, combines mVRefNum & mDirID | |
| long | mDirID |
| directory ID on specified volume, preserved unless dir recreated. | |
| oofString | mPath |
| bool | mValidDir |
| bool | mCreatedDiskDir |
|
|
|
|
||||||||||||||||
|
|
|
||||||||||||||||||||
|
|
|
|
|
|
||||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||
|
A simple wrapper to call the approriate directory method depending on target enviroment.
|
|
||||||||||||
|
|
|
|
a simple wrapper to allow us to call CreateSubdirsAndWorkingDirID Will modify members: mWorkingDirID mVRefNum Will set mValidDir = true if sucseeful else false mWorkingDirID, &mVRefNum, &mDirID |
|
|
Find the directory identified by pascalPartialPath and make the oofDirectory point to the directory. If the directory does not exist create it and any other missing directories. Will modify members: mWorkingDirID mVRefNum Will set mValidDir = true if sucseeful else false mWorkingDirID, &mVRefNum, &mDirID Algorithm is as follows. IF we have a partial path IF path is relative THEN GET default working directory ID ELSE IF path is absolute AND vol name in path exists THEN SET mVRefNum = volnum of vol with name at beginning of pascalPartialPath ELSE SET mValidDir = false END_IF END_IF IF volume exists THEN GET catinfo on named object IF named object exists THEN GET catinfo on named object IF named object is dir create a working directory and SET mWorkingDirID ELSE SET mValidDir false it's a file or something return END_IF ELSE // must make a directory loop back through path name until an existing folder name is found or in current dir loop through path name from valid point creating missing nested directories PBOpenWD SET mWorkingDirID to wpb.ioVRefNum (jus open wdirectory) ELSE SET mValidDir = false END_IF IF mValidDir THEN convert current dir to path END_IF ELSE CALL GETCurrentLocation ENDIF |
|
||||||||||||
|
Search for the directory from current location for the directory identified by the partial path and set: mWorkingDirID mValidDir mVRefNum if the dir is found.
|
|
||||||||||||||||
|
|
|
|
|
|
|
|
|
|
Confirm a file exists.
|
|
|
|
|
||||||||||||
|
Fill in an FSSpec from our current member variables.
|
|
|
|
|
|
Set this oofDirectory to point to current default location. By getting Current default volume and directory, then setting members: mVRefNum mDirID mWorkingDirID mPath |
|
|
Make the directory identified by inPath the current default.
|
|
|
Change current dir to this oofDirectory. directory identified by mWorkingDirID (classic) or mVRefNum & mDirID (classic or carbon) |
|
|
|
|
|
|
|
|
launch files as if double-click on desktop
|
|
|
|
|
|
|
|
|
Sets the oofDirectory to point to the directory identified by the path alters the members: mDirID possibly the mVRefNum if path is absolute Uses working directories, updating mWorkingDirID.
|
|
|
|
|
||||||||||||||||||||
|
setDirFromPath core conversion routine for external call or constructing oofDirectory from incoming path a non-null outFileName indicates the caller expects the path to terminate in a filename incoming paths converted if possible |
|
|
|
|
||||||||||||||||
|
Iterate through the directory tree applying Visitor.
|
|
|
|
|
|
directory ID on specified volume, preserved unless dir recreated.
|
|
|
|
|
|
|
|
|
volume number of a mounted volume, not meaningful over reboots
|
|
|
old Mac Classic Working Directory number, combines mVRefNum & mDirID
|
1.3.5