Exiv2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Functions
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

std::string dirname (const std::string &path)
 Get the directory component from the path string. See dirname(3). More...
 
std::string basename (const std::string &path, bool delsuffix=false)
 Get the filename component from the path string. See basename(3). If the delsuffix parameter is true, the suffix will be removed. More...
 
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).
 
void replace (std::string &text, const std::string &searchText, const std::string &replaceText)
 Replaces all occurences of searchText in the text string by replaceText.
 

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

std::string Util::basename ( const std::string &  path,
bool  delsuffix = false 
)

Get the filename component from the path string. See basename(3). If the delsuffix parameter is true, the suffix will be removed.

This function can handle Windows paths to some extent: c:\bar should be fine, \\bigsrv\foo also, but \\bigsrv alone doesn't work.

References Exiv2::string, and suffix().

Referenced by Util::Getopt::getopt(), and suffix().

std::string Util::dirname ( const std::string &  path)

Get the directory component from the path string. See dirname(3).

This function can handle Windows paths to some extent: c:\bar should be fine, \\bigsrv\foo also, but \\bigsrv alone doesn't work.

References Exiv2::string.