Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Examples

Util Namespace Reference

Contains utility classes and functions. Most of these are wrappers for common C functions that do not require pointers and memory considerations. More...


Classes

class  Getopt
 Parse the command line options of a program. More...

Functions

bool fileExists (const std::string &path, bool ct)
 Test if a file exists.
std::string strError ()
 Get a system error message and the error code. See strerror(2).
std::string dirname (const std::string &path)
 Get the directory component from the path string. See dirname(3).
std::string basename (const std::string &path, bool delsuffix)
 Get the filename component from the path string. See basename(3). If the delsuffix parameter is true, the suffix will be removed.
std::string suffix (const std::string &path)
 Get the suffix from the path string. Normally, the suffix is the substring of the basename of path from the last '.' to the end of the string.
bool strtol (const char *nptr, long &n)
 Convert a C string to a long value, which is returned in n. Returns true if the conversion is successful, else false. n is not modified if the conversion is unsuccessful. See strtol(2).


Detailed Description

Contains utility classes and functions. Most of these are wrappers for common C functions that do not require pointers and memory considerations.

Function Documentation

bool Util::fileExists const std::string &  path,
bool  ct = false
 

Test if a file exists.

Parameters:
path Name of file to verify.
ct Flag to check if path is a regular file.
Returns:
true if path exists and, if ct is set, is a regular file, else false.
Note:
The function calls stat() test for path and its type, see stat(2). errno is left unchanged in case of an error.


Generated on Sat Mar 5 19:54:33 2005 for Exiv2 by  doxygen 1.4.1