8 #ifndef SRC_DIRECTORY_H_ 9 #define SRC_DIRECTORY_H_ 85 std::string
resolvePath (
const std::string &relpath)
const;
94 int mkSubdir (
const std::string &dirName)
const;
104 bool dirExists (
const std::string &dirName)
const;
114 bool fileExists (
const std::string &filename)
const;
124 static int mkdir (
const char *pathname);
133 static bool isDir (
const char *pathname);
142 static bool isFile (
const char *pathname);
151 static std::string
toIash (
const std::string &pathname);
160 static std::string
toPlatform (
const std::string &pathname);
187 void ensureTrailingSlash ();
189 std::string m_dirpath;
bool fileExists(const std::string &filename) const
Checks if the given filename represents an existing file inside of the current Directory.
Definition: Directory.cpp:84
static Directory getHomeDir()
Gets the user's home directory as a Directory instance.
Definition: Directory.cpp:217
Represents a directory on the filesystem.
Definition: Directory.h:26
static std::string toPlatform(const std::string &pathname)
Converts pathname from iash path representation to the platform's path representation.
Definition: Directory.cpp:106
const std::string & getAbsPath() const
Gets the absolute path to this Directory from the root of the filesystem.
Definition: Directory.cpp:51
static Directory getConfigDir()
Gets the user's root application configuration directory ad a Directory instance. ...
Definition: Directory.cpp:226
int mkSubdir(const std::string &dirName) const
Creates a directory inside of the current Directory instance.
Definition: Directory.cpp:74
bool changeDirAbs(const std::string &absPath)
Changes this Directory instance to point at the directory with the absolute path absPath.
Definition: Directory.cpp:63
static Directory getWorkingDir()
Gets the working directory for this process.
Definition: Directory.cpp:245
static std::string toIash(const std::string &pathname)
Converts pathname from system path representation to iash path representation.
Definition: Directory.cpp:89
static bool isFile(const char *pathname)
Checks if pathname refers to an existing file.
Definition: Directory.cpp:202
bool changeDirRel(const std::string &relPath)
Changes this Directory instance to point at the directory with path relPath relative to the directory...
Definition: Directory.cpp:56
bool isValid() const
Checks if the Directory object points to an existing directory.
Definition: Directory.cpp:46
static bool isDir(const char *pathname)
Checks if pathname refers to an existing directory.
Definition: Directory.cpp:187
static int mkdir(const char *pathname)
Creates a directory with the absolute path pathname.
Definition: Directory.cpp:178
bool dirExists(const std::string &dirName) const
Checks if the given dirname represents an existing directory inside of the current Directory...
Definition: Directory.cpp:79
std::string resolvePath(const std::string &relpath) const
Converts a path relative to the current Directory to an absolute path.
Definition: Directory.cpp:123
Thrown when an iash component cannot find the requested file.
Definition: Directory.h:197
Directory()
Creates a Directory instance pointed at the application's current working directory.
Definition: Directory.cpp:25