File/directory path related functions. More...
#include <set>
#include <vector>
#include <string>
Go to the source code of this file.
Namespaces | |
basis | |
basis::os | |
basis::os::path | |
Macros | |
#define | _BASIS_OS_PATH_H |
Functions | |
std::string | basis::os::path::abspath (const std::string &path) |
Make path absolute. More... | |
std::string | basis::os::path::basename (const std::string &path) |
Get file name. More... | |
std::string | basis::os::path::dirname (const std::string &path) |
Get file directory. More... | |
bool | basis::os::path::exists (const std::string path) |
Test the existance of a file or directory. More... | |
bool | basis::os::path::hasext (const std::string &path, const std::set< std::string > *exts=NULL) |
Test whether a given path has an extension. More... | |
bool | basis::os::path::isabs (const std::string &path) |
Test whether a given path is absolute. More... | |
bool | basis::os::path::isdir (const std::string path) |
Test whether a given path is the path of an existent directory. More... | |
bool | basis::os::path::isfile (const std::string path) |
Test whether a given path is the path of an existent file. More... | |
bool | basis::os::path::islink (const std::string &path) |
Whether a given path is a symbolic link. More... | |
bool | basis::os::path::issep (char c) |
Determine if a given character is a path separator. More... | |
std::string | basis::os::path::join (const std::string &base, const std::string &path) |
Join two paths, e.g., base path and relative path. More... | |
std::string | basis::os::path::normpath (const std::string &path) |
Normalize path, i.e., remove occurences of "./", duplicate slashes,... More... | |
std::string | basis::os::path::ntpath (const std::string &path) |
Convert path to Windows representation. More... | |
std::string | basis::os::path::posixpath (const std::string &path) |
Convert path to Posix (e.g., Unix, Mac OS) representation. More... | |
std::string | basis::os::path::realpath (const std::string &path) |
Get canonical file path. More... | |
std::string | basis::os::path::relpath (const std::string &path, const std::string &base=std::string()) |
Make path relative. More... | |
void | basis::os::path::split (const std::string &path, std::string &head, std::string &tail) |
Split path into two parts. More... | |
std::vector< std::string > | basis::os::path::split (const std::string &path) |
Split path into two parts. More... | |
void | basis::os::path::splitdrive (const std::string &path, std::string &drive, std::string &tail) |
Get drive specification of Windows path. More... | |
std::vector< std::string > | basis::os::path::splitdrive (const std::string &path) |
Get drive specification of Windows path. More... | |
void | basis::os::path::splitext (const std::string &path, std::string &head, std::string &ext, const std::set< std::string > *exts=NULL, bool icase=false) |
Get file name extension. More... | |
std::vector< std::string > | basis::os::path::splitext (const std::string &path, const std::set< std::string > *exts=NULL) |
Get file name extension. More... | |
File/directory path related functions.
The implementations provided by this module are in particular related to the manipulation of and interaction with file (and directory) paths. These implementations are meant to be simple and therefore focus on non-multibyte path strings only. They were motivated by the os.path module of Python, though, they are no exact replicates of these functions. The path module which is part of the BASIS utilities for Python, on the other side, provides the same extended functionality.
Definition in file path.h.