Chromium Code Reviews| Index: src/utils/SkOSFile.cpp |
| diff --git a/src/utils/SkOSFile.cpp b/src/utils/SkOSFile.cpp |
| index 478a0cc44868e4376e5839a052a151729e0d7ff6..0a403750b8b9f44165163ef61475b1465ec22144 100644 |
| --- a/src/utils/SkOSFile.cpp |
| +++ b/src/utils/SkOSFile.cpp |
| @@ -1,4 +1,3 @@ |
| - |
| /* |
| * Copyright 2011 Google Inc. |
| * |
| @@ -7,6 +6,28 @@ |
| */ |
| #include "SkOSFile.h" |
| +SkString SkOSPath::SkPathJoin(const char *rootPath, const char *relativePath) { |
|
scroggo
2013/05/28 16:44:40
This file is the only one that has changed from th
|
| + SkString result(rootPath); |
| + if (!result.endsWith(SkPATH_SEPARATOR)) { |
| + result.appendUnichar(SkPATH_SEPARATOR); |
| + } |
| + result.append(relativePath); |
| + return result; |
| +} |
| + |
| +SkString SkOSPath::SkBasename(const char* fullPath) { |
| + if (!fullPath) { |
| + return SkString(); |
| + } |
| + const char* filename = strrchr(fullPath, SkPATH_SEPARATOR); |
| + if (NULL == filename) { |
| + filename = fullPath; |
| + } else { |
| + ++filename; |
| + } |
| + return SkString(filename); |
| +} |
| + |
| #ifdef SK_BUILD_FOR_WIN |
| static uint16_t* concat_to_16(const char src[], const char suffix[]) |
| @@ -225,5 +246,4 @@ bool SkOSFile::Iter::next(SkString* name, bool getDir) |
| } |
| return false; |
| } |
| - |
| -#endif |
| +#endif // if one of:SK_BUILD_FOR_MAC, SK_BUILD_FOR_UNIX, SK_BUILD_FOR_ANDROID,SK_BUILD_FOR_IOS |