MLIB
|
Definitions for Unix-like basename() and dirname() functions. More...
Go to the source code of this file.
Functions | |
const char * | mlib::dirname (const char *filename) |
Return a pointer to pathname of the file deleting any trailing '\' character. | |
const char * | mlib::basename (const char *filename) |
Return a pointer to the filename without any path component. | |
Definitions for Unix-like basename() and dirname() functions.
(c) Mircea Neacsu 2017
const char * mlib::basename | ( | const char * | filename | ) |
Return a pointer to the filename without any path component.
filename | pointer to filename with optional path |
Forward slashes ( / ), backslashes ( \ ), or both may be used.
If filename is a null pointer or points to an empty string, basename() returns a pointer to the string ".".
The function returns a pointer to a static storage that will be overwritten by a subsequent call to basename().
The function can be used with UTF-8 encoded filenames.
const char * mlib::dirname | ( | const char * | filename | ) |
Return a pointer to pathname of the file deleting any trailing '\' character.
filename | pointer to filename |
Forward slashes ( / ), backslashes ( \ ), or both may be used. If the filename does not contain a '\', then dirname() returns a pointer to the string ".". If filename is a null pointer or points to an empty string, dirname() returns a pointer to the string "."
The function returns a pointer to a static storage that will be overwritten by a subsequent call to dirname().
The function can be used with UTF-8 encoded filenames.