#include <path_help.h>
Operations | |
| enum | PathType { path_type_file, path_type_virtual } |
| Path types. More... | |
| static CL_String | make_absolute (const CL_String &base_path, const CL_String &relative_path, PathType path_type=path_type_file) |
| Convert a relative path to an absolute path. | |
| static CL_String | make_relative (const CL_String &base_path, const CL_String &absolute_path, PathType path_type=path_type_file) |
| Converts an absolute path into a path relative to a base path. | |
| static bool | is_absolute (const CL_String &path, PathType path_type=path_type_file) |
| Check if a path is absolute. | |
| static bool | is_relative (const CL_String &path, PathType path_type=path_type_file) |
| Check if a path is relative. | |
| static CL_String | normalize (const CL_String &path, PathType path_type=path_type_file) |
| Normalize a path. | |
| static CL_String | add_trailing_slash (const CL_String &path, PathType path_type=path_type_file) |
| Add trailing slash or backslash to path. | |
| static CL_String | remove_trailing_slash (const CL_String &path, PathType path_type=path_type_file) |
| Remove trailing slash or backslash from path. | |
| *static CL_String | get_location (const CL_String &fullname, PathType path_type=path_type_file) |
| Returns the drive (C:) or share name (\computer). | |
| static CL_String | get_basepath (const CL_String &fullname, PathType path_type=path_type_file) |
| Returns the path excluding the location and filename. | |
| static std::vector< CL_String > | split_basepath (const CL_String &fullname, PathType path_type=path_type_file) |
| Splits the path, excluding the location, into parts. | |
| static CL_String | get_fullpath (const CL_String &fullname, PathType path_type=path_type_file) |
| Returns the path including the location. | |
| static CL_String | get_filename (const CL_String &fullname, PathType path_type=path_type_file) |
| Returns the filename part of a fullname. | |
| static CL_String | get_basename (const CL_String &fullname, PathType path_type=path_type_file) |
| Returns the basename part of a fullname. | |
| static CL_String | get_extension (const CL_String &fullname, PathType path_type=path_type_file) |
| Returns the extension part of a fullname. | |
| static CL_String | get_fullname (const CL_String &fullpath, const CL_String &filename, PathType path_type=path_type_file) |
| Create a fullname from parts. | |
| static CL_String | get_fullname (const CL_String &fullpath, const CL_String &filename, const CL_String &extension, PathType path_type=path_type_file) |
| Create a fullname from parts. | |
| static CL_String | get_fullname (const CL_String &location, const CL_String &basepath, const CL_String &filename, const CL_String &extension, PathType path_type=path_type_file) |
| Create a fullname from parts. | |
|
|
Path types.
|
|
||||||||||||
|
Add trailing slash or backslash to path. This function checks if a path already has a trailing slash/backslash and adds it if its missing.
|
|
||||||||||||
|
Returns the basename part of a fullname. param: fullname = The full path to use param: path_type = The path type
|
|
||||||||||||
|
Returns the path excluding the location and filename.
|
|
||||||||||||
|
Returns the extension part of a fullname. If no extension was found, an empty string is returned. param: fullname = The full path to use param: path_type = The path type
|
|
||||||||||||
|
Returns the filename part of a fullname. param: fullname = The full path to use param: path_type = The path type
|
|
||||||||||||||||||||||||
|
Create a fullname from parts. param: location = The location to use param: fullpath = The full path to use param: filename = The filename to use param: extension = The filename extension to use param: path_type = The path type
|
|
||||||||||||||||||||
|
Create a fullname from parts. param: fullpath = The full path to use param: filename = The filename to use param: extension = The filename extension to use param: path_type = The path type
|
|
||||||||||||||||
|
Create a fullname from parts. param: fullpath = The full path to use param: filename = The filename to use param: path_type = The path type
|
|
||||||||||||
|
Returns the path including the location. param: fullname = The full path to use (including filename) param: path_type = The path type
|
|
||||||||||||
|
Returns the drive (C:) or share name (\computer). If (path_type == path_type_virtual) or not using windows, then this function always returns an empty string.
|
|
||||||||||||
|
Check if a path is absolute.
|
|
||||||||||||
|
Check if a path is relative.
|
|
||||||||||||||||
|
Convert a relative path to an absolute path.
If the OS is unix based, there is no location (drive or share name) and the function also converts all backslashes to slashes. If the type is path_type_virtual, the base path is required to be absolute. If it does not start in a slash, the function prefixes a slash to the path. The current drive or directory is never taken into account and all backslashes are converted to slashes. This function calls normalise() on base_path and relative_path. Example #1:
///
Example #2:
///
Example #3:
///
|
|
||||||||||||||||
|
Converts an absolute path into a path relative to a base path.
This function calls normalise() on the base_path and absolute_path- Example #1 (Windows):
///
|
|
||||||||||||
|
Normalize a path.
|
|
||||||||||||
|
Remove trailing slash or backslash from path. This function checks if a path has a trailing slash/backslash and removes it if needed.
|
|
||||||||||||
|
Splits the path, excluding the location, into parts. param: fullname = The full path name to use param: path_type = The path type
|
1.4.6