Functions |
std::string | sbia::basis::clean_path (const std::string &path) |
| Clean path, i.e., remove occurences of "./", duplicate slashes,...
|
bool | sbia::basis::clear_directory (const std::string &path) |
| Remove files and directories from directory.
|
const string | sbia::basis::cPathSeparatorStr ("/") |
bool | sbia::basis::exists (const std::string path) |
| Test the existance of a file or directory.
|
std::string | sbia::basis::get_executable_directory () |
| Get canonical path of directory containing executable file.
|
std::string | sbia::basis::get_executable_name () |
| Get name of executable.
|
std::string | sbia::basis::get_executable_path () |
| Get canonical path of executable file.
|
std::string | sbia::basis::get_file_directory (const std::string &path) |
| Get file directory.
|
std::string | sbia::basis::get_file_name (const std::string &path) |
| Get file name with extension.
|
std::string | sbia::basis::get_file_name_extension (const std::string &path, const std::set< std::string > *exts=NULL) |
| Get file name extension.
|
std::string | sbia::basis::get_file_name_without_extension (const std::string &path, const std::set< std::string > *exts=NULL) |
| Get file name without extension.
|
std::string | sbia::basis::get_file_root (const std::string &path) |
| Get file root.
|
std::string | sbia::basis::get_real_path (const std::string &path) |
| Get canonical file path.
|
std::string | sbia::basis::get_working_directory () |
| Get absolute path of the (current) working directory.
|
bool | sbia::basis::has_extension (const std::string &path, const std::set< std::string > *exts=NULL) |
| Test whether a given path has an extension.
|
bool | sbia::basis::is_absolute (const std::string &path) |
| Test whether a given path is absolute.
|
bool | sbia::basis::is_dir (const std::string path) |
| Test whether a given path is the path of an existent directory.
|
bool | sbia::basis::is_file (const std::string path) |
| Test whether a given path is the path of an existent file.
|
bool | sbia::basis::is_relative (const std::string &path) |
| Test whether a given path is relative.
|
bool | sbia::basis::is_symlink (const std::string &path) |
| Whether a given path is a symbolic link.
|
bool | sbia::basis::is_valid_path (const std::string &path, bool strict=true) |
| Whether a given string is a valid path.
|
std::string | sbia::basis::join_paths (const std::string &base, const std::string &path) |
| Join two paths, e.g., base path and relative path.
|
bool | sbia::basis::make_directory (const std::string &path, bool parent=true) |
| Make directory optionally including parent directories.
|
bool | sbia::basis::read_symlink (const std::string &link, std::string &value) |
| Read value of symbolic link.
|
bool | sbia::basis::remove_directory (const std::string &path, bool recursive=false) |
| Remove directory.
|
void | sbia::basis::split_path (const std::string &path, std::string *root, std::string *dir, std::string *fname, std::string *ext, const std::set< std::string > *exts=NULL) |
| Split path into its components.
|
std::string | sbia::basis::to_absolute_path (const std::string &path) |
| Get absolute path given a relative path.
|
std::string | sbia::basis::to_absolute_path (const std::string &base, const std::string &path) |
| Get absolute path given a relative path and a base path.
|
std::string | sbia::basis::to_native_path (const std::string &path) |
| Convert path to native representation.
|
std::string | sbia::basis::to_relative_path (const std::string &path) |
| Get path relative to current working directory.
|
std::string | sbia::basis::to_relative_path (const std::string &base, const std::string &path) |
| Get path relative to given absolute path.
|
std::string | sbia::basis::to_unix_path (const std::string &path, bool drive=false) |
| Convert path to Unix representation.
|
std::string | sbia::basis::to_windows_path (const std::string &path) |
| Convert path to Windows representation.
|
Basic file path manipulation and related system functions.
Copyright (c) 2011 University of Pennsylvania. All rights reserved.
See https://www.cbica.upenn.edu/sbia/software/license.html or COPYING file.
Contact: SBIA Group <sbia-software at uphs.upenn.edu>
Definition in file path.cxx.