mirror of
https://github.com/glest/glest-source.git
synced 2025-08-12 03:14:00 +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 StartsWith(const std::string &str, const std::string &key);
|
||||||
bool EndsWith(const string &str, const 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 trimPathWithStartingSlash(string &path);
|
||||||
string updatePathClimbingParts(string &path, bool processPreviousDirTokenCheck = true);
|
string updatePathClimbingParts(string &path, bool processPreviousDirTokenCheck = true);
|
||||||
string formatPath(string path);
|
string formatPath(string path);
|
||||||
|
@@ -552,6 +552,19 @@ namespace Shared {
|
|||||||
return result;
|
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) {
|
string endPathWithSlash(string &path, bool requireOSSlash) {
|
||||||
if (EndsWith(path, "/") == false && EndsWith(path, "\\") == false) {
|
if (EndsWith(path, "/") == false && EndsWith(path, "\\") == false) {
|
||||||
string seperator = "/";
|
string seperator = "/";
|
||||||
|
Reference in New Issue
Block a user