PathFunctions Class Reference

Various path functions. More...

#include <path_functions.h>

List of all members.

Static Public Member Functions

static std::string getExecutablePath ()
 Returns absolute path of the current executable.
static std::string getExecutableDirectory ()
 Returns absolute path of a directory where the current executable is located (ended by '/').
static bool fileExists (const std::string &filePath)
 Returns true if the selected file exists, false otherwise.
static std::string createProperFilePath (const std::string &filePath)
 Converts selected file path to a "proper" one (see description for more info).

Private Member Functions

 PathFunctions ()
 ~PathFunctions ()
 PathFunctions (const PathFunctions &)
PathFunctionsoperator= (const PathFunctions &)


Detailed Description

Various path functions.

Uses "library class" (aka "static helper") design pattern.


Constructor & Destructor Documentation

PathFunctions::PathFunctions (  )  [private]

PathFunctions::~PathFunctions (  )  [private]

PathFunctions::PathFunctions ( const PathFunctions  )  [private]


Member Function Documentation

PathFunctions& PathFunctions::operator= ( const PathFunctions  )  [private]

static std::string PathFunctions::getExecutablePath (  )  [static]

Returns absolute path of the current executable.

If it fails to find the path, it returns an empty string.

static std::string PathFunctions::getExecutableDirectory (  )  [static]

Returns absolute path of a directory where the current executable is located (ended by '/').

If it fails to find the directory, it returns an empty string.

static bool PathFunctions::fileExists ( const std::string &  filePath  )  [static]

Returns true if the selected file exists, false otherwise.

Parameters:
filePath File to be tested.

static std::string PathFunctions::createProperFilePath ( const std::string &  filePath  )  [static]

Converts selected file path to a "proper" one (see description for more info).

Parameters:
filePath File path to be tested.
This function should be called before opening a file from the application, because of possibility that the user will run the application from another path (insted of running it directly from the application directory). If the selected file pah exists, it returns it without change, but if it doesn't exist it will try to get existence of the file according to the application directory. If it fails now, it will return original file path, so you have to test the existence of the file anyway (it's more suitable for error messages and exceptions handling).


The documentation for this class was generated from the following file:

Generated on Sat Dec 20 19:21:24 2008 for PGR2008 by  doxygen 1.5.6