aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/utils/path_util.cpp
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2012-07-26 15:59:26 +0200
committerEinar Johan Trøan Sømåen2012-07-26 15:59:26 +0200
commitef11f9d0c53cbdd9d88a99143de6f43f34d7e24d (patch)
tree8dfaee0ba16e18a8e3772dd5afc9123d5c4e78d2 /engines/wintermute/utils/path_util.cpp
parent38507fa9895620639d8733dbb4e085dfb2282a33 (diff)
downloadscummvm-rg350-ef11f9d0c53cbdd9d88a99143de6f43f34d7e24d.tar.gz
scummvm-rg350-ef11f9d0c53cbdd9d88a99143de6f43f34d7e24d.tar.bz2
scummvm-rg350-ef11f9d0c53cbdd9d88a99143de6f43f34d7e24d.zip
WINTERMUTE: Run Astyle with add-braces to break one-line statements into easier-to-read-code.
Diffstat (limited to 'engines/wintermute/utils/path_util.cpp')
-rw-r--r--engines/wintermute/utils/path_util.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/engines/wintermute/utils/path_util.cpp b/engines/wintermute/utils/path_util.cpp
index 27b2b0b727..51f0f5817e 100644
--- a/engines/wintermute/utils/path_util.cpp
+++ b/engines/wintermute/utils/path_util.cpp
@@ -37,8 +37,9 @@ AnsiString PathUtil::unifySeparators(const AnsiString &path) {
AnsiString newPath = path;
for (uint32 i = 0; i < newPath.size(); i++) {
- if (newPath[i] == '\\')
+ if (newPath[i] == '\\') {
newPath.setChar('/', i);
+ }
}
return newPath;
@@ -56,8 +57,9 @@ AnsiString PathUtil::combine(const AnsiString &path1, const AnsiString &path2) {
AnsiString newPath1 = unifySeparators(path1);
AnsiString newPath2 = unifySeparators(path2);
- if (!StringUtil::endsWith(newPath1, "/", true) && !StringUtil::startsWith(newPath2, "/", true))
+ if (!StringUtil::endsWith(newPath1, "/", true) && !StringUtil::startsWith(newPath2, "/", true)) {
newPath1 += "/";
+ }
return newPath1 + newPath2;
}
@@ -79,10 +81,11 @@ AnsiString PathUtil::getFileName(const AnsiString &path) {
//size_t pos = newPath.find_last_of(L'/'); TODO REMOVE.
Common::String lastPart = Common::lastPathComponent(newPath, '/');
- if (lastPart[lastPart.size() - 1 ] != '/')
+ if (lastPart[lastPart.size() - 1 ] != '/') {
return lastPart;
- else
+ } else {
return path;
+ }
//if (pos == AnsiString::npos) return path;
//else return newPath.substr(pos + 1);
}
@@ -183,8 +186,9 @@ AnsiString PathUtil::getUserDirectory() {
if (error == noErr) {
char buffer[MAX_PATH_LENGTH];
error = FSRefMakePath(&fileRef, (UInt8 *)buffer, sizeof(buffer));
- if (error == noErr)
+ if (error == noErr) {
userDir = buffer;
+ }
}
#elif __IPHONEOS__