Zen
A cross-platform functional programming language
|
Intrinsic fileinfo type. More...
#include <zbl.hpp>
Public Member Functions | |
fileinfo (const string &filename) | |
Constructor. | |
fileinfo (const string &dir, const string &filename) | |
Constructor. | |
string | getAbsoluteFilePath () const |
Returns yes abs-path, yes filename, yes ext. | |
string | getBaseName () const |
Returns no path, yes filename, no ext. | |
string | getAbsolutePath () const |
Returns yes abs-path, no filename, no ext. | |
string | getFilePath () const |
Returns yes path, yes filename, yes ext. | |
string | getFileName () const |
Returns no path, yes filename, yes ext. | |
string | getSuffix () const |
Returns no path, no filename, yes ext. | |
string | getPath () const |
Returns yes path, no filename, no ext. | |
bool | exists () const |
Checks if the file exists. | |
bool | isAbsolute () const |
Checks if the path is absolute. | |
Static Public Member Functions | |
static string | getCanonicalDirPath (const string &file) |
Return canonical path for directory. | |
static string | getCanonicalFilePath (const string &file) |
Return canonical path for file. | |
static bool | isAbsolute (const string &file) |
Checks if the path is absolute. | |
static string | getNativeSeparator (const string &file) |
Converts separators in filename to native separators. | |
static string | getAbsolutePath (const string &file) |
Converts directory path to absolute. | |
static string | getAbsoluteFilePath (const string &file) |
Converts file path to absolute. | |
static string | getRelativeFilePath (const string &dir, const string &file) |
Return file path relative to a directory. | |
static string | getTempPath () |
Returns path to system temp directory. | |
static string | getCwd () |
Returns path to current working directory. | |
static bool | copy (const string &src, const string &dst) |
Copy one file to another. | |
static bool | exists (const string &file) |
Checks if the file exists. | |
static bool | existsDir (const string &file) |
Checks if the directory exists. | |
static bool | mkdir (const string &file) |
Create directory. | |
static bool | remove (const string &file) |
Delete file. | |
static bool | rmdir (const string &file, const bool &recursive) |
Delete directory. | |
Private Attributes | |
QFileInfo | _val |
The value. |
Intrinsic fileinfo type.
Constructor.
filename | The file name |
Constructor.
dir | The directory |
filename | The file name |
Copy one file to another.
src | The source path |
dst | The destination path |
bool exists | ( | ) | const [inline] |
Checks if the file exists.
static bool exists | ( | const string & | file | ) | [inline, static] |
Checks if the file exists.
file | The path |
static bool existsDir | ( | const string & | file | ) | [inline, static] |
Checks if the directory exists.
file | The path |
string getAbsoluteFilePath | ( | ) | const [inline] |
Returns yes abs-path, yes filename, yes ext.
Converts file path to absolute.
file | The path |
string getAbsolutePath | ( | ) | const [inline] |
Returns yes abs-path, no filename, no ext.
Converts directory path to absolute.
file | The path |
string getBaseName | ( | ) | const [inline] |
Returns no path, yes filename, no ext.
Return canonical path for directory.
file | The path |
Return canonical path for file.
file | The path |
static string getCwd | ( | ) | [inline, static] |
Returns path to current working directory.
string getFileName | ( | ) | const [inline] |
Returns no path, yes filename, yes ext.
string getFilePath | ( | ) | const [inline] |
Returns yes path, yes filename, yes ext.
Converts separators in filename to native separators.
file | The path |
string getPath | ( | ) | const [inline] |
Returns yes path, no filename, no ext.
Return file path relative to a directory.
dir | The directory relative to which path must be obtained |
file | The path to convert |
string getSuffix | ( | ) | const [inline] |
Returns no path, no filename, yes ext.
static string getTempPath | ( | ) | [inline, static] |
Returns path to system temp directory.
bool isAbsolute | ( | ) | const [inline] |
Checks if the path is absolute.
static bool isAbsolute | ( | const string & | file | ) | [inline, static] |
Checks if the path is absolute.
file | The path |
static bool mkdir | ( | const string & | file | ) | [inline, static] |
Create directory.
file | The path |
static bool remove | ( | const string & | file | ) | [inline, static] |
Delete file.
file | The path |
bool rmdir | ( | const string & | file, |
const bool & | recursive | ||
) | [static] |
Delete directory.
file | The path |
recursive | Whether to delete sub-directories recursively. |