API Guides > ConceptRT 3.x
DirectoryIterator Class Reference

Gets a directory items content. More...

Detailed Description

Gets a directory items content.

Public Member Methods

 DirectoryIterator ()
 Default constructor. More...
 
 DirectoryIterator (PCChar8 directoryPath)
 Constructor. More...
 
void OpenDirectory (PCChar8 directoryPath)
 Open a directory. More...
 
bool TryOpenDirectory (PCChar8 directoryPath)
 Try to Open a directory. More...
 
bool FindNextSubDirectory (BaseStaticString &subDirectoryName)
 Find a next item in the current directory. More...
 
bool FindNextFile (BaseStaticString &fileName, UInt64 *fileSize=NULL)
 Find a next item in the current directory. More...
 
const BaseStaticStringGetDirectoryPath () const
 Gets the current directory path. More...
 
String GetDirectoryPath (PCChar8 fileName) const
 Gets a sub directory path. More...
 
 ~DirectoryIterator ()
 Default destructor. More...
 

Constructor & Destructor Documentation

Default constructor.

DirectoryIterator ( PCChar8  directoryPath)

Constructor.

Parameters
directoryPathDirectory path where to iterate.

Default destructor.

Methods Documentation

bool FindNextFile ( BaseStaticString fileName,
UInt64 fileSize = NULL 
)

Find a next item in the current directory.

Parameters
fileName[in, out] if found, the fileName.
fileSize[in, out] (Optional) if found return the file size of the file. Default = NULL.
Returns
true if found, false if no next fild found.
bool FindNextSubDirectory ( BaseStaticString subDirectoryName)

Find a next item in the current directory.

Parameters
subDirectoryNameif found, the next item.
Returns
true if found, false if no next subdirectory found.
const BaseStaticString& GetDirectoryPath ( ) const

Gets the current directory path.

Returns
The current directory path.
String GetDirectoryPath ( PCChar8  fileName) const

Gets a sub directory path.

Parameters
fileNamefile name to build a path with.
Returns
The directory path of the current directory and the given file
void OpenDirectory ( PCChar8  directoryPath)

Open a directory.

Parameters
directoryPathDirectory path where to iterate.

Can be called whenever it's necessary to change directory. Will close the current context and open a new one.

bool TryOpenDirectory ( PCChar8  directoryPath)

Try to Open a directory.

Parameters
directoryPathDirectory path where to iterate.

Can be called whenever it's necessary to change directory. Will close the current context and open a new one.

Returns
true succeed false if not.