Mana
Loading...
Searching...
No Matches
Functions
utils Namespace Reference

Functions

std::string_view path (std::string_view fullFilePath)
 Returns the path without the file name.
 
std::string joinPaths (std::string_view path1, std::string_view path2)
 Join two path elements into one.
 
std::string cleanPath (const std::string &path)
 Removes relative elements from the path.
 

Function Documentation

◆ cleanPath()

std::string utils::cleanPath ( const std::string &  path)

Removes relative elements from the path.

Definition at line 86 of file path.cpp.

◆ joinPaths()

std::string utils::joinPaths ( std::string_view  path1,
std::string_view  path2 
)

Join two path elements into one.

This function helps handling relative paths.

Examples:

/foo + bar = /foo/bar
/foo/ + bar = /foo/bar
/foo + /bar = /bar

This will work for PhysFS paths. Windows style paths (prefixed with drive letters) won't work.

Returns
Joined paths or path2 if path2 was an absolute path.

Definition at line 55 of file path.cpp.

◆ path()

std::string_view utils::path ( std::string_view  fullFilePath)

Returns the path without the file name.

The path separator is kept.

Definition at line 29 of file path.cpp.