Filesys Class Reference

#include <Filesys.h>

Description

Cross-Platform filesystem access.

Unfortunately, to make this work properly, so called "preprocessor magic" is necessary for Filesys to operate on multiple platforms.

Data Structures

class  Directory
 

Functions

bool ChangeDir (const std::string &)
 
bool GoToChild (const std::string &)
 
bool GoToParent ()
 
std::string GetCWD ()
 
bool CreateDir (const std::string &)
 
Directory QueryDirectory ()
 
std::string FindFile (const std::string &name)
 
std::string FindDirectory (const std::string &name)
 
std::vector< std::string > FindAllFiles (const std::string &name)
 
Init

Filesys needs an entry point. If none is specified, then it is set to the current working directory.

 Filesys ()
 
 Filesys (const std::string &initDir)
 

Member Function Documentation

bool ChangeDir ( const std::string &  )

Change to the specified directory. Returns true on success.

bool GoToChild ( const std::string &  )

Change to the specified child directory. NOTICE: you only need to specify the name of the directory Ex) if you query the directory and it returns true, then this function will succeed as well.

bool GoToParent ( )

Change directory to the parent directory.

std::string GetCWD ( )

return the current working directory.

bool CreateDir ( const std::string &  )

Creates a directory with the given name. The directory is relative to the current working directory.

Directory QueryDirectory ( )

return all the object names in the current working directory as a directory instance. See the Directory object for more details. Special directories are not included

std::string FindFile ( const std::string &  name)

Searches for the file of the specified name. The search is done in the current directory and all sub directories. If successful, return the full path of the file, else returns an empty string.

std::string FindDirectory ( const std::string &  name)

Searches for the directory of the specified name. THe search is done in the current and all sub directories. If sucessful, the directory's full path is returned. Else, an empty string is returned.

std::vector<std::string> FindAllFiles ( const std::string &  name)

Similar to findFile, but returns a vector of paths. The paths coresponding to all instances of name that exist in the current and sub-directories of the current.


The documentation for this class was generated from the following file:
  • /home/jc/git/Dynacoe/DynacoeSrc/includes/Dynacoe/Util/Filesys.h