#include <zorba/util/path.h>
Public Types | |
enum | flags_t { CONVERT_SLASHES = 1, RESOLVE = 2 } |
Public Member Functions | |
filesystem_path | branch_path () const |
const char * | c_str () const |
filesystem_path () | |
filesystem_path (const std::string &path_, int flags=0) | |
filesystem_path (const filesystem_path &base, const filesystem_path &rel) | |
const std::string & | get_path () const |
bool | is_complete () const |
bool | is_root () const |
operator const std::string & () const | |
filesystem_path & | operator= (const std::string &p_) |
void | resolve_relative () |
Static Public Member Functions | |
static const char * | get_directory_separator () |
static const char * | get_path_separator () |
static std::string | normalize_path (std::string const &in, std::string const &base="") |
Utility function to normalize a path as a system conforming path and optionally resolve it. | |
Protected Member Functions | |
std::string | getPathString () const |
zorba::filesystem_path::filesystem_path | ( | const std::string & | path_, |
int | flags = 0 |
||
) |
zorba::filesystem_path::filesystem_path | ( | const filesystem_path & | base, |
const filesystem_path & | rel | ||
) | [inline] |
Definition at line 67 of file path.h.
References get_path(), and is_complete().
const char* zorba::filesystem_path::c_str | ( | ) | const [inline] |
static const char* zorba::filesystem_path::get_directory_separator | ( | ) | [static] |
const std::string& zorba::filesystem_path::get_path | ( | ) | const [inline] |
Definition at line 79 of file path.h.
Referenced by filesystem_path(), and zorba::operator<<().
static const char* zorba::filesystem_path::get_path_separator | ( | ) | [static] |
std::string zorba::filesystem_path::getPathString | ( | ) | const [protected] |
bool zorba::filesystem_path::is_complete | ( | ) | const |
Referenced by filesystem_path().
bool zorba::filesystem_path::is_root | ( | ) | const |
static std::string zorba::filesystem_path::normalize_path | ( | std::string const & | in, |
std::string const & | base = "" |
||
) | [static] |
Utility function to normalize a path as a system conforming path and optionally resolve it.
This function takes a path (as system path, file uri) and normalizes it. It converts file URIs to system paths and replaces '/' and '\' to the platform specific directory separator ('\' on Windows, '/' on UNIX like operating systems like Linux and Mac OS X). If the parameter base is set, it also resolves the path.
in | The path to normalize. |
base | The base name to resolve a path (default = ""), if this is the empty string, it does not resolve anything, but only normalizes the path. |
zorba::filesystem_path::operator const std::string & | ( | ) | const [inline] |
filesystem_path& zorba::filesystem_path::operator= | ( | const std::string & | p_ | ) | [inline] |