mirror of
https://github.com/glest/glest-source.git
synced 2025-08-12 19:33:59 +02:00
Trying to fix bug again
This commit is contained in:
@@ -240,7 +240,8 @@ namespace Shared {
|
||||
bool StartsWith(const std::string &str, const std::string &key);
|
||||
bool EndsWith(const string &str, const string& key);
|
||||
|
||||
string endPathWithSlash(string &path, bool requireOSSlash = false);
|
||||
string endPathWithSlash(string& path, bool requireOSSlash = false);
|
||||
string endPathWithSlash(string&& path, bool requireOSSlash = false);
|
||||
string trimPathWithStartingSlash(string &path);
|
||||
string updatePathClimbingParts(string &path, bool processPreviousDirTokenCheck = true);
|
||||
string formatPath(string path);
|
||||
|
@@ -552,6 +552,19 @@ namespace Shared {
|
||||
return result;
|
||||
}
|
||||
|
||||
string endPathWithSlash(string&& path, bool requireOSSlash) {
|
||||
if (EndsWith(path, "/") == false && EndsWith(path, "\\") == false) {
|
||||
string seperator = "/";
|
||||
if (requireOSSlash == true) {
|
||||
#if defined(WIN32)
|
||||
seperator = "\\";
|
||||
#endif
|
||||
}
|
||||
path += seperator;
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
string endPathWithSlash(string &path, bool requireOSSlash) {
|
||||
if (EndsWith(path, "/") == false && EndsWith(path, "\\") == false) {
|
||||
string seperator = "/";
|
||||
|
Reference in New Issue
Block a user