Zen
A cross-platform functional programming language

fileinfo Class Reference

Intrinsic fileinfo type. More...

#include <zbl.hpp>

List of all members.

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.

Detailed Description

Intrinsic fileinfo type.


Constructor & Destructor Documentation

fileinfo ( const string filename) [inline, explicit]

Constructor.

Parameters:
filenameThe file name
fileinfo ( const string dir,
const string filename 
) [inline, explicit]

Constructor.

Parameters:
dirThe directory
filenameThe file name

Member Function Documentation

static bool copy ( const string src,
const string dst 
) [inline, static]

Copy one file to another.

Parameters:
srcThe source path
dstThe destination path
Returns:
True if success, else false
bool exists ( ) const [inline]

Checks if the file exists.

Returns:
True if file exists, else false
static bool exists ( const string file) [inline, static]

Checks if the file exists.

Parameters:
fileThe path
Returns:
True if file exists, else false
static bool existsDir ( const string file) [inline, static]

Checks if the directory exists.

Parameters:
fileThe path
Returns:
True if directory exists, else false
string getAbsoluteFilePath ( ) const [inline]

Returns yes abs-path, yes filename, yes ext.

Returns:
The value
static string getAbsoluteFilePath ( const string file) [inline, static]

Converts file path to absolute.

Parameters:
fileThe path
Returns:
Absolute file path
string getAbsolutePath ( ) const [inline]

Returns yes abs-path, no filename, no ext.

Returns:
The value
static string getAbsolutePath ( const string file) [inline, static]

Converts directory path to absolute.

Parameters:
fileThe path
Returns:
Absolute directory path
string getBaseName ( ) const [inline]

Returns no path, yes filename, no ext.

Returns:
The value
static string getCanonicalDirPath ( const string file) [inline, static]

Return canonical path for directory.

Parameters:
fileThe path
Returns:
Canonical path for directory
static string getCanonicalFilePath ( const string file) [inline, static]

Return canonical path for file.

Parameters:
fileThe path
Returns:
Canonical path for file
static string getCwd ( ) [inline, static]

Returns path to current working directory.

Returns:
Current working directory path
string getFileName ( ) const [inline]

Returns no path, yes filename, yes ext.

Returns:
The value
string getFilePath ( ) const [inline]

Returns yes path, yes filename, yes ext.

Returns:
The value
static string getNativeSeparator ( const string file) [inline, static]

Converts separators in filename to native separators.

Parameters:
fileThe path
Returns:
COnverted filename
string getPath ( ) const [inline]

Returns yes path, no filename, no ext.

Returns:
The value
static string getRelativeFilePath ( const string dir,
const string file 
) [inline, static]

Return file path relative to a directory.

Parameters:
dirThe directory relative to which path must be obtained
fileThe path to convert
Returns:
Relative file path
string getSuffix ( ) const [inline]

Returns no path, no filename, yes ext.

Returns:
The value
static string getTempPath ( ) [inline, static]

Returns path to system temp directory.

Returns:
Temporary directory path
bool isAbsolute ( ) const [inline]

Checks if the path is absolute.

Returns:
True if path is absolute, else false
static bool isAbsolute ( const string file) [inline, static]

Checks if the path is absolute.

Parameters:
fileThe path
Returns:
True if path is absolute, else false
static bool mkdir ( const string file) [inline, static]

Create directory.

Parameters:
fileThe path
Returns:
True if success, else false
static bool remove ( const string file) [inline, static]

Delete file.

Parameters:
fileThe path
Returns:
True if success, else false
bool rmdir ( const string file,
const bool &  recursive 
) [static]

Delete directory.

Parameters:
fileThe path
recursiveWhether to delete sub-directories recursively.
Returns:
True if success, else false

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines