Introduce new helpers

This commit is contained in:
2023-11-16 16:04:09 +01:00
parent df21c45a13
commit 4c2af98602
3 changed files with 21 additions and 1 deletions

View File

@@ -127,6 +127,13 @@ namespace OpenVulkano
return str.size() >= suffix.size() && 0 == str.compare(str.size()-suffix.size(), suffix.size(), suffix);
}
static std::pair<std::string, std::string> SplitAtLastOccurrence(const std::string& str, char splitAt)
{
size_t pos = str.rfind(splitAt);
if (pos == std::string::npos) return {str, ""};
else return {str.substr(0, pos), str.substr(pos + 1)};
}
static Array<char> ReadFile(const std::string& filePath);
};
}