mirror of
https://github.com/glest/glest-source.git
synced 2025-08-09 18:06:30 +02:00
Small code cleanup
This commit is contained in:
@@ -241,8 +241,8 @@ namespace Shared {
|
|||||||
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);
|
||||||
void trimPathWithStartingSlash(string &path);
|
string trimPathWithStartingSlash(string &path);
|
||||||
void updatePathClimbingParts(string &path, bool processPreviousDirTokenCheck = true);
|
string updatePathClimbingParts(string &path, bool processPreviousDirTokenCheck = true);
|
||||||
string formatPath(string path);
|
string formatPath(string path);
|
||||||
|
|
||||||
string replaceAllHTMLEntities(string& context);
|
string replaceAllHTMLEntities(string& context);
|
||||||
@@ -265,7 +265,6 @@ namespace Shared {
|
|||||||
void showCursor(bool b);
|
void showCursor(bool b);
|
||||||
bool isKeyDown(int virtualKey);
|
bool isKeyDown(int virtualKey);
|
||||||
//bool isKeyDown(SDLKey key);
|
//bool isKeyDown(SDLKey key);
|
||||||
string getCommandLine();
|
|
||||||
|
|
||||||
string getUserHome();
|
string getUserHome();
|
||||||
|
|
||||||
|
@@ -71,8 +71,6 @@ namespace Shared {
|
|||||||
void message(const string &message,bool isNonGraphicalModeEnabled, const string &writepath);
|
void message(const string &message,bool isNonGraphicalModeEnabled, const string &writepath);
|
||||||
void exceptionMessage(const exception &excp);
|
void exceptionMessage(const exception &excp);
|
||||||
|
|
||||||
string getCommandLine();
|
|
||||||
|
|
||||||
// WINDOWS
|
// WINDOWS
|
||||||
#else
|
#else
|
||||||
|
|
||||||
@@ -98,11 +96,8 @@ namespace Shared {
|
|||||||
#if !defined(__GNUC__)
|
#if !defined(__GNUC__)
|
||||||
virtual void handle(LPEXCEPTION_POINTERS pointers)=0;
|
virtual void handle(LPEXCEPTION_POINTERS pointers)=0;
|
||||||
#endif
|
#endif
|
||||||
static string codeToStr(DWORD code);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
LONG WINAPI UnhandledExceptionFilter2(struct _EXCEPTION_POINTERS *ExceptionInfo);
|
|
||||||
|
|
||||||
// =====================================================
|
// =====================================================
|
||||||
// Misc
|
// Misc
|
||||||
// =====================================================
|
// =====================================================
|
||||||
@@ -113,7 +108,6 @@ namespace Shared {
|
|||||||
|
|
||||||
void message(string message, bool isNonGraphicalModeEnabled,const string &writepath);
|
void message(string message, bool isNonGraphicalModeEnabled,const string &writepath);
|
||||||
void exceptionMessage(const exception &excp);
|
void exceptionMessage(const exception &excp);
|
||||||
string getCommandLine();
|
|
||||||
void init_win32();
|
void init_win32();
|
||||||
void done_win32();
|
void done_win32();
|
||||||
void ontop_win32(int width, int height);
|
void ontop_win32(int width, int height);
|
||||||
|
@@ -572,14 +572,15 @@ namespace Shared {
|
|||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
void trimPathWithStartingSlash(string &path) {
|
string trimPathWithStartingSlash(string &path) {
|
||||||
if (StartsWith(path, "/") == true || StartsWith(path, "\\") == true) {
|
if (StartsWith(path, "/") == true || StartsWith(path, "\\") == true) {
|
||||||
path.erase(path.begin(), path.begin() + 1);
|
path.erase(path.begin(), path.begin() + 1);
|
||||||
//printf("************* trimPathWithStartingSlash changed path [%s]\n",path.c_str());
|
//printf("************* trimPathWithStartingSlash changed path [%s]\n",path.c_str());
|
||||||
}
|
}
|
||||||
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
void updatePathClimbingParts(string &path, bool processPreviousDirTokenCheck) {
|
string updatePathClimbingParts(string &path, bool processPreviousDirTokenCheck) {
|
||||||
// Update paths with /./
|
// Update paths with /./
|
||||||
string::size_type pos = path.find("/./");
|
string::size_type pos = path.find("/./");
|
||||||
if (pos != string::npos && pos != 0) {
|
if (pos != string::npos && pos != 0) {
|
||||||
@@ -683,6 +684,7 @@ namespace Shared {
|
|||||||
printf("CHANGED relative path from [%s] to [%s]\n",orig.c_str(),path.c_str());
|
printf("CHANGED relative path from [%s] to [%s]\n",orig.c_str(),path.c_str());
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
string getCRCCacheFilePath() {
|
string getCRCCacheFilePath() {
|
||||||
|
Reference in New Issue
Block a user