Ocular Engine
Ocular::Core::Directory Class Reference
Inheritance diagram for Ocular::Core::Directory:
Ocular::Core::File

Public Member Functions

 Directory (std::string const path="")
 
std::vector< DirectorygetChildDirectories (bool recursive=false) const
 
std::vector< FilegetChildFiles (bool recursive=false) const
 
void explore (bool const recursive=false)
 
virtual bool create (bool createDirectories=false)
 
- Public Member Functions inherited from Ocular::Core::File
 File (std::string const fullPath="")
 
void setPath (std::string const fullPath)
 
void refresh ()
 
bool exists () const
 
bool canRead () const
 
bool canWrite () const
 
bool isFile () const
 
bool isDirectory () const
 
bool isSymLink () const
 
bool isAbsolute () const
 
unsigned getSize () const
 
std::string getFullPath () const
 
std::string getName () const
 
std::string getExtension () const
 
std::string getDirectory () const
 
time_t getLastModifiedTime () const
 
void formatForSystem ()
 

Additional Inherited Members

- Protected Attributes inherited from Ocular::Core::File
bool m_IsReal
 
bool m_IsReadable
 
bool m_IsWritable
 
bool m_IsFile
 
bool m_IsDirectory
 
bool m_IsSymLink
 
bool m_IsAbsolute
 
unsigned m_FileSize
 
std::string m_FullPath
 
std::string m_Name
 
std::string m_Extension
 
std::string m_Directory
 

Constructor & Destructor Documentation

Ocular::Core::Directory::Directory ( std::string const  path = "")
Parameters
[in]pathDirectory path
Note
If an empty path is provided, the current working directory will be used.

Member Function Documentation

bool Ocular::Core::Directory::create ( bool  createDirectories = false)
virtual

Attempts to create the directory if it does not already exist.

Parameters
[in]createDirectoriesIf TRUE, creates all necessary parent directories that do not already exist.
Returns
bool TRUE if successful

Reimplemented from Ocular::Core::File.

void Ocular::Core::Directory::explore ( bool const  recursive = false)

Populates the list of child directories and files.

If recursive is true, then this Directory's child directories and files will be filled with ALL child directories and files, no matter how deeply nested.

Parameters
[in]recursiveIf TRUE, child directories are automatically explored.
std::vector< Directory > Ocular::Core::Directory::getChildDirectories ( bool  recursive = false) const
Note
explore must be called first or else the container will be empty.
Parameters
[in]recursiveIf true, returned list also contains all files belonging to child directories.
Returns
A collection of all immediate child directories.
std::vector< File > Ocular::Core::Directory::getChildFiles ( bool  recursive = false) const
Note
explore must be called first or else the container will be empty.
Parameters
[in]recursiveIf true, returned list also contains all files belonging to child directories.
Returns
A collection of all immediate child files.

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