iaux::iaDirectory Class Reference

#include <iaDirectory.h>

Public Member Functions

 iaDirectory (const iaString &directoryName)
 
 iaDirectory ()
 
iaDirectory operator= (const iaString &directoryName)
 
iaString getFullDirectoryName () const
 
iaString getDirectoryName () const
 
iaString getFullParentDirectoryName () const
 
std::vector< iaDirectorygetDirectories (bool recursive=false, bool orderAlphabetically=true) const
 
std::vector< iaFilegetFiles (const iaString &searchPattern=L"*", bool recursive=false, bool orderAlphabetically=true) const
 
bool exists () const
 
bool isRoot ()
 

Static Public Member Functions

static iaString getRelativePath (const iaString &from, const iaString &to)
 
static void setCurrentDirectory (const iaString &directoyName)
 
static iaString getCurrentDirectory ()
 
static bool directoryIsAbsolute (const iaString &directoryname)
 
static bool isDirectory (const iaString &directoryname)
 
static void makeDirectory (const iaString &path)
 
static bool exists (const iaString &path)
 
static bool isEmpty (const iaString &path)
 
static iaString fixPath (const iaString &directoryName, bool file)
 

Friends

class iaFile
 

Detailed Description

handles directories and containing files

Constructor & Destructor Documentation

◆ iaDirectory() [1/2]

iaux::iaDirectory::iaDirectory ( const iaString directoryName)

creates an object for some directory

Parameters
directoryNamepath of directory

◆ iaDirectory() [2/2]

iaux::iaDirectory::iaDirectory ( )

empty directory ctor

Member Function Documentation

◆ directoryIsAbsolute()

bool iaux::iaDirectory::directoryIsAbsolute ( const iaString directoryname)
static
Returns
true: if a directory is absolute; false: if diretory is relative

◆ exists() [1/2]

bool iaux::iaDirectory::exists ( ) const
Returns
true if given directory exists

◆ exists() [2/2]

bool iaux::iaDirectory::exists ( const iaString path)
static
Returns
true if given directory exists
Parameters
paththe given directory

◆ fixPath()

iaString iaux::iaDirectory::fixPath ( const iaString directoryName,
bool  file 
)
static

fixes the path from something like "../bla\blubber/temp.txt" to an absolute c:\bla\blubber\temp.txt

Parameters
directoryNamepath to fix
filetrue: it's a file; false: it's a directory
Returns
fixed path

◆ getCurrentDirectory()

iaString iaux::iaDirectory::getCurrentDirectory ( )
static
Returns
the current or working directory

◆ getDirectories()

std::vector< iaDirectory > iaux::iaDirectory::getDirectories ( bool  recursive = false,
bool  orderAlphabetically = true 
) const
Returns
all sub directories
Parameters
recursivetrue: search recursively; false: search only in current directory
orderAlphabeticallytrue: returns directories in alphabetical order

◆ getDirectoryName()

iaString iaux::iaDirectory::getDirectoryName ( ) const
Returns
the name of the directory

e.g. if the directory is c:\foo\bar than the directory name is bar

◆ getFiles()

std::vector< iaFile > iaux::iaDirectory::getFiles ( const iaString searchPattern = L"*",
bool  recursive = false,
bool  orderAlphabetically = true 
) const
Returns
all files
Parameters
searchPatternwhat to search for using regular expression
recursivetrue: search recursively; false: search only in current directory
orderAlphabeticallytrue: returns files in alphabetical order

◆ getFullDirectoryName()

iaString iaux::iaDirectory::getFullDirectoryName ( ) const
Returns
get the absolute path name

e.g. if the path is c:\foo\bar then this returns c:\foo\bar

◆ getFullParentDirectoryName()

iaString iaux::iaDirectory::getFullParentDirectoryName ( ) const
Returns
the absolute path name of parent directory

e.g. if the path is c:\foo\bar then this returns c:\foo

◆ getRelativePath()

iaString iaux::iaDirectory::getRelativePath ( const iaString from,
const iaString to 
)
static
Returns
relative path from path to path
Parameters
fromthe path from where the relative path comes from (can also be a full file path)
tothe path the relative path will point to

◆ isDirectory()

bool iaux::iaDirectory::isDirectory ( const iaString directoryname)
static
Returns
true: if a directory is realy a directory; false: if directory is a file don't use this to check if a path is a file try iaFile::exist

◆ isEmpty()

bool iaux::iaDirectory::isEmpty ( const iaString path)
static
Returns
true if given directory is empty
Parameters
paththe given directory

◆ isRoot()

bool iaux::iaDirectory::isRoot ( )
Returns
true: if root folder

eg c:, d: (windows) / (linux)

◆ makeDirectory()

void iaux::iaDirectory::makeDirectory ( const iaString path)
static

creates directory at given path

Parameters
pathgiven path

◆ operator=()

iaDirectory iaux::iaDirectory::operator= ( const iaString directoryName)

copy operator

Parameters
directoryNamepath of directory

◆ setCurrentDirectory()

void iaux::iaDirectory::setCurrentDirectory ( const iaString directoyName)
static

set's the current or working directory

Parameters
directoyNamethe directory path

Friends And Related Function Documentation

◆ iaFile

friend class iaFile
friend

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