18 static std::string appendForwardSlash(
const std::string& path);
21 return appendForwardSlash(std::filesystem::current_path());
29 std::string returnValue = path2;
31 returnValue = appendForwardSlash(path1) + path2;
37 size_t pos = path.find_last_of(
'/');
38 bool isPathJustFileName = (pos == std::string::npos);
40 if(isPathJustFileName) {
44 return path.substr(0, pos + 1);
50 std::string extractedName = path;
52 size_t pos = path.find_last_of(
'/');
53 bool isPathJustFileName = (pos == std::string::npos);
55 if(!isPathJustFileName) {
56 extractedName = path.substr(pos + 1, std::string::npos);
62 std::string appendForwardSlash(
const std::string& path) {
66 if(path.back() ==
'/') {
std::string extractFileName(std::string const &path)
Extract the string after the last '/' in a path. Returned substring does not include the '/' characte...
std::string getCurrentWorkingDirectory()
Returns absolute path to current working directory. The returned path ends with a forward slash.
std::string extractDirectory(std::string const &path)
Returns the path to the directory containing the file provided as the input parameter.
std::string concatenatePaths(const std::string &path1, const std::string &path2)
Concatenates two given paths using custom rules.
std::string convertToAbsolutePath(std::string const &relativePath)
Converts a relative path to its absolute path.