Path helper functions. More...
#include <path_help.h>
Operations | |
enum | PathType { path_type_file, path_type_virtual } |
Path types. More... | |
static std::string | make_absolute (const std::string &base_path, const std::string &relative_path, PathType path_type=path_type_file) |
Convert a relative path to an absolute path. More... | |
static std::string | make_relative (const std::string &base_path, const std::string &absolute_path, PathType path_type=path_type_file) |
Converts an absolute path into a path relative to a base path. More... | |
static bool | is_absolute (const std::string &path, PathType path_type=path_type_file) |
Check if a path is absolute. More... | |
static bool | is_relative (const std::string &path, PathType path_type=path_type_file) |
Check if a path is relative. More... | |
static std::string | normalize (const std::string &path, PathType path_type=path_type_file) |
Normalize a path. More... | |
static std::string | add_trailing_slash (const std::string &path, PathType path_type=path_type_file) |
Add trailing slash or backslash to path. More... | |
static std::string | remove_trailing_slash (const std::string &path) |
Remove trailing slash or backslash from path. More... | |
static std::string | get_location (const std::string &fullname, PathType path_type=path_type_file) |
Returns the drive (C:) or share name ( \ \ computer \ share) More... | |
static std::string | get_basepath (const std::string &fullname, PathType path_type=path_type_file) |
Returns the path excluding the location and filename. More... | |
static std::vector< std::string > | split_basepath (const std::string &fullname, PathType path_type=path_type_file) |
Splits the path, excluding the location, into parts. More... | |
static std::string | get_fullpath (const std::string &fullname, PathType path_type=path_type_file) |
Returns the path including the location. More... | |
static std::string | get_filename (const std::string &fullname, PathType path_type=path_type_file) |
Returns the filename part of a fullname. More... | |
static std::string | get_basename (const std::string &fullname, PathType path_type=path_type_file) |
Returns the basename part of a fullname. More... | |
static std::string | get_extension (const std::string &fullname, PathType path_type=path_type_file) |
Returns the extension part of a fullname. More... | |
static std::string | get_fullname (const std::string &fullpath, const std::string &filename, PathType path_type=path_type_file) |
Create a fullname from parts. More... | |
static std::string | get_fullname (const std::string &fullpath, const std::string &filename, const std::string &extension, PathType path_type=path_type_file) |
Create a fullname from parts. More... | |
static std::string | get_fullname (const std::string &location, const std::string &basepath, const std::string &filename, const std::string &extension, PathType path_type=path_type_file) |
Create a fullname from parts. More... | |
static std::string | combine (const std::string &part1, const std::string &part2, PathType path_type=path_type_file) |
Concatenates two strings into one adding a trailing slash to first string if missing. More... | |
Path helper functions.