![]() |
MySQL 9.3.0
Source Code Documentation
|
Namespaces | |
namespace | detail |
Functions | |
std::string | search_stdpath (const std::string &name) |
Returns path to the given executable name searched in PATH. More... | |
std::string | search_path_list (const std::string &name, const std::string &pathlist, const char separator=0) |
Returns path to the given executable name searched in the given path list string, separated by the given separator. More... | |
bool | is_path_separator (char c) |
Checks if character is a path separator. More... | |
std::string | join_path (const std::vector< std::string > &components) |
std::string | join_path (const std::string &a, const std::string &b) |
template<typename... Args> | |
std::string | join_path (const std::string &a, const std::string &b, Args... args) |
std::pair< std::string, std::string > | splitdrive (const std::string &path) |
std::string | dirname (const std::string &path) |
std::string | basename (const std::string &path) |
std::string | home () |
Get home directory path of the user executing the shell. More... | |
std::string | home (const std::string &loginname) |
Get home directory path of user associated with the specified login name. More... | |
std::string | expand_user (const std::string &path) |
expand_user expand paths beginning with ~ or ~user (also known as "tilde expansion"). More... | |
std::string | normalize (const std::string &path) |
Unix: Normalize a path collapsing redundant separators and relative references. More... | |
std::tuple< std::string, std::string > | split_extension (const std::string &path) |
Split path to (root, extension) tuple such that [root + extenstion == path]. More... | |
bool | exists (const std::string &path) |
Returns true if the path exists. More... | |
bool | is_absolute (const std::string &path) |
Checks if path is absolute. More... | |
std::string | getcwd () |
Provides path to the current working directory. More... | |
std::string | tmpdir () |
std::string | errno_to_string (int err) |
Variables | |
const char | path_separator = '/' |
const char | pathlist_separator = ':' |
const char | pathlist_separator_s [] = {pathlist_separator, '\0'} |
const char * | k_valid_path_separators = "/" |
std::string shcore::path::basename | ( | const std::string & | path | ) |
std::string shcore::path::dirname | ( | const std::string & | path | ) |
std::string shcore::path::errno_to_string | ( | int | err | ) |
bool shcore::path::exists | ( | const std::string & | path | ) |
Returns true if the path exists.
std::string shcore::path::expand_user | ( | const std::string & | path | ) |
expand_user
expand paths beginning with ~
or ~user
(also known as "tilde expansion").
Home directory for ~
prefix is obtained by home()
function. Home directory for ~user
prefix is obtained by home(user)
function.
path | Path string. |
path
with prefix ~
or ~user
replaced by that user's home directory. ~
, the path is returned unchanged. std::string shcore::path::getcwd | ( | ) |
Provides path to the current working directory.
std::string shcore::path::home | ( | ) |
Get home directory path of the user executing the shell.
On Unix: HOME
environment variable is returned if is set, otherwise current user home directory is looked up in password directory.
On Windows: HOME%
or USERPROFILE%
or HOMEDRIVE%
+ HOMEPATH%
environment variable is returned if is set, otherwise user home directory is obtained from system KnownFolder ID FOLDERID_Profile
. If all of above fail, empty string is returned.
std::string shcore::path::home | ( | const std::string & | loginname | ) |
Get home directory path of user associated with the specified login name.
On Unix: User home directory path associated with loginname
is looked up directly in the password directory.
On Windows: Retrieving home directory of another user on Windows platform is NOT SUPPORTED.
loginname | Login name of existing user in system. |
loginname
or empty string if such user does not exist. bool shcore::path::is_absolute | ( | const std::string & | path | ) |
Checks if path is absolute.
path | - path to be checked. |
bool shcore::path::is_path_separator | ( | char | c | ) |
Checks if character is a path separator.
c | - character to be checked. |
|
inline |
std::string shcore::path::join_path | ( | const std::string & | a, |
const std::string & | b, | ||
Args... | args | ||
) |
std::string shcore::path::join_path | ( | const std::vector< std::string > & | components | ) |
std::string shcore::path::normalize | ( | const std::string & | path | ) |
Unix: Normalize a path collapsing redundant separators and relative references.
This string path manipulation, might affect paths containing symbolic links.
Windows: Retrieves the full path and file name of the specified file. If error occur path isn't altered.
path | Input path string to normalize. |
std::string shcore::path::search_path_list | ( | const std::string & | name, |
const std::string & | pathlist, | ||
const char | separator = 0 |
||
) |
Returns path to the given executable name searched in the given path list string, separated by the given separator.
name | name of the executable. .exe is automatically appended in Win32 |
pathlist | string with list of paths to search |
separator | separator character used in pathlist. If 0, the default PATH separator for the platform is used. |
std::string shcore::path::search_stdpath | ( | const std::string & | name | ) |
Returns path to the given executable name searched in PATH.
std::tuple< std::string, std::string > shcore::path::split_extension | ( | const std::string & | path | ) |
Split path to (root, extension) tuple such that [root + extenstion == path].
path | Original file name |
std::pair< std::string, std::string > shcore::path::splitdrive | ( | const std::string & | path | ) |
std::string shcore::path::tmpdir | ( | ) |
const char * shcore::path::k_valid_path_separators = "/" |
const char shcore::path::path_separator = '/' |
const char shcore::path::pathlist_separator = ':' |
const char shcore::path::pathlist_separator_s[] = {pathlist_separator, '\0'} |