InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IDirectoryUtility Class Referenceabstract

#include <IDirectoryUtility.h>

Classes

class  OnSysFileFunction
 

Public Types

typedef ::boost::function1
< bool16, IDirectoryUtility * > 
FileMatch
 

Public Member Functions

 IDirectoryUtility (FileMatch matchFunc)
 
virtual ~IDirectoryUtility ()
 
virtual void AddPath (const IDFile &fileSpec)=0
 
bool16 IsMatch ()
 
virtual bool16 First (IDFile *resultFile)=0
 
virtual bool16 Next (IDFile *resultFile)=0
 
virtual bool16 CurrentMatchFile (IDFile *resultFile) const =0
 
virtual void ForEachFileInFolder (OnSysFileFunction &onSysFile)=0
 

Static Public Member Functions

static bool16 DefaultFileMatchFun (IDirectoryUtility *)
 

Protected Attributes

FileMatch fMatchFunction
 

Detailed Description

Utility interface that iterates over a set of paths and returns the files contained by the paths. The returned files may be filtered by a given filtering/match function.

Note: aliases are resolved on the Mac, but shortcuts are NOT resolved on Windows.

See Also
IDFile
SysFileInfo

Member Typedef Documentation

typedef ::boost::function1<bool16, IDirectoryUtility*> IDirectoryUtility::FileMatch

The caller may supply a filter function that filters files before they are returned from Next. Only files that match will be returned.

Constructor & Destructor Documentation

IDirectoryUtility::IDirectoryUtility (FileMatch matchFunc)
inline

Constructor. Constructs an IDirectoryUtility object.

Parameters
matchFuncIN Function used to filters file.
virtual IDirectoryUtility::~IDirectoryUtility ()
inlinevirtual

Destructor. Destroys the IDirectoryUtility object.

Member Function Documentation

virtual void IDirectoryUtility::AddPath (const IDFilefileSpec)
pure virtual

Add a new path to the list of items that will be iterated.

Parameters
fileSpecIN Path to add; may be a path to a directory or file.
virtual bool16 IDirectoryUtility::CurrentMatchFile (IDFileresultFile) const
pure virtual

Gets the current matching file.

Parameters
resultFileOUT Pointer to an existing IDFile object that is set to the current matching file.
Returns
kTrue if a file was found, else kFalse.
virtual bool16 IDirectoryUtility::First (IDFileresultFile)
pure virtual

Gets the first matching file.

Parameters
resultFileOUT Pointer to an existing IDFile object that is set to the first matching file.
Returns
kTrue if a file was found, else kFalse.
virtual void IDirectoryUtility::ForEachFileInFolder (OnSysFileFunctiononSysFile)
pure virtual

Iterates all the files in the files and folders added to this object and calls onSysFile on them.

Parameters
onSysFileIN Class containing OnSysFile function to call.
bool16 IDirectoryUtility::IsMatch ()
inline

Test if the current file is a match.

Returns
kTrue the current file is a match, else kFalse.
virtual bool16 IDirectoryUtility::Next (IDFileresultFile)
pure virtual

Gets next file matching file.

Parameters
resultFileOUT Pointer to an existing IDFile object that is set to the next matching file.
Returns
kTrue if a file was found, else kFalse.

Member Data Documentation

FileMatch IDirectoryUtility::fMatchFunction
protected

Function used to test for matching files.