copasi API
0.1
|
#include <CDirEntry.h>
Static Public Member Functions | |
static bool | isFile (const std::string &path) |
static bool | isDir (const std::string &path) |
static bool | exist (const std::string &path) |
static bool | isReadable (const std::string &path) |
static bool | isWritable (const std::string &path) |
static std::string | baseName (const std::string &path) |
static std::string | fileName (const std::string &path) |
static std::string | dirName (const std::string &path) |
static std::string | suffix (const std::string &path) |
static bool | createDir (const std::string &dir, const std::string &parent="") |
static std::string | createTmpName (const std::string &dir, const std::string &suffix) |
static bool | move (const std::string &from, const std::string &to) |
static bool | remove (const std::string &path) |
static bool | removeFiles (const std::string &pattern, const std::string &dir) |
static std::vector< std::string > | compilePattern (const std::string &pattern) |
static bool | match (const std::string &name, const std::vector< std::string > &patternList) |
static bool | isRelativePath (const std::string &path) |
static bool | makePathRelative (std::string &absolutePath, const std::string &relativeTo) |
static bool | makePathAbsolute (std::string &relativePath, const std::string &absoluteTo) |
static std::string | normalize (const std::string &path) |
Static Public Attributes | |
static const std::string | Separator = "/" |
This class provides an OS independent interface to directory entries such as files and directories.
std::string CDirEntry::baseName | ( | const std::string & | path | ) | [static] |
Returns the base name, i.e., the directory path and the the suffix are removed from 'path'.
const | std::string & path |
std::vector< std::string > CDirEntry::compilePattern | ( | const std::string & | pattern | ) | [static] |
Compiles the pattern to a patternList. Valid wildcards in the pattern are: '*' matches any number of characters and '?' matches exactly one character.
const | std::string & pattern |
bool CDirEntry::createDir | ( | const std::string & | dir, |
const std::string & | parent = "" |
||
) | [static] |
Create the directory 'dir' in the parent directory 'parent'.
const | std::string & dir |
const | std::string & parent (Default: current working directory) |
std::string CDirEntry::createTmpName | ( | const std::string & | dir, |
const std::string & | suffix | ||
) | [static] |
Create a name for a temporary directory entry. The directory entry will be located in the directory given
const | std::string & dir |
const | std::string & suffix |
std::string CDirEntry::dirName | ( | const std::string & | path | ) | [static] |
Returns the directory path to the parent directoryu, i.e., the file name or directory name are removed from 'path'.
const | std::string & path |
bool CDirEntry::exist | ( | const std::string & | path | ) | [static] |
Check whether the directory entry specified by 'path' exists.
const | std::string & path |
std::string CDirEntry::fileName | ( | const std::string & | path | ) | [static] |
Returns the file name, i.e., the directory path is removed from 'path'.
const | std::string & path |
bool CDirEntry::isDir | ( | const std::string & | path | ) | [static] |
Check whether the directory entry specified by 'path' is is a directory.
const | std::string & path |
bool CDirEntry::isFile | ( | const std::string & | path | ) | [static] |
Check whether the directory entry specified by 'path' is a file.
const | std::string & path |
bool CDirEntry::isReadable | ( | const std::string & | path | ) | [static] |
Check whether the directory entry specified by 'path' is is readable.
const | std::string & path |
bool CDirEntry::isRelativePath | ( | const std::string & | path | ) | [static] |
Checks whether the given path is relative
bool CDirEntry::isWritable | ( | const std::string & | path | ) | [static] |
Check whether the directory entry specified by 'path' is writable.
const | std::string & path |
bool CDirEntry::makePathAbsolute | ( | std::string & | relativePath, |
const std::string & | absoluteTo | ||
) | [static] |
Makes the relative path absolute to the path given in absoluteTo
std::string | & relativePath |
const | std::string & absoluteTo |
bool CDirEntry::makePathRelative | ( | std::string & | absolutePath, |
const std::string & | relativeTo | ||
) | [static] |
Makes the absolute path relative to the path given in relativeTo
std::string | & absolutePath |
const | std::string & relativeTo |
bool CDirEntry::match | ( | const std::string & | name, |
const std::vector< std::string > & | patternList | ||
) | [static] |
Compare the name against the pattern list and returns whether the name matches. The patternList can be created from a pattern by the compilePattern method.
const | std::string & name |
const | std::vector< std::string > & patternList |
bool CDirEntry::move | ( | const std::string & | from, |
const std::string & | to | ||
) | [static] |
Move a file from. If to is the directory the filename of from is appended.
const | std::string & from |
const | std::string & to |
std::string CDirEntry::normalize | ( | const std::string & | path | ) | [static] |
This method normalizes the path, i.e., it converts all '\' to '/' (only on WIN32) and collapses '^./' to '^', '/./' to '/', and '[^/]+/../' to '/'
const | std::string & path |
bool CDirEntry::remove | ( | const std::string & | path | ) | [static] |
Removes a file or directory specified by path.
const | std::string & path |
bool CDirEntry::removeFiles | ( | const std::string & | pattern, |
const std::string & | dir | ||
) | [static] |
Remove files or directories matching the pattern in directory dir.
const | std::string & pattern |
const | std::string & dir |
std::string CDirEntry::suffix | ( | const std::string & | path | ) | [static] |
Returns the suffix, i.e., the directory path and the the base name are removed from 'path'.
const | std::string & path |
const std::string CDirEntry::Separator = "/" [static] |
The character used to separate directory entries.