| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 #include "SkOSFile.h" | 7 #include "SkOSFile.h" |
| 8 | 8 |
| 9 SkString SkOSPath::SkPathJoin(const char *rootPath, const char *relativePath) { | 9 SkString SkOSPath::Join(const char *rootPath, const char *relativePath) { |
| 10 SkString result(rootPath); | 10 SkString result(rootPath); |
| 11 if (!result.endsWith(SkPATH_SEPARATOR)) { | 11 if (!result.endsWith(SkPATH_SEPARATOR)) { |
| 12 result.appendUnichar(SkPATH_SEPARATOR); | 12 result.appendUnichar(SkPATH_SEPARATOR); |
| 13 } | 13 } |
| 14 result.append(relativePath); | 14 result.append(relativePath); |
| 15 return result; | 15 return result; |
| 16 } | 16 } |
| 17 | 17 |
| 18 SkString SkOSPath::SkBasename(const char* fullPath) { | 18 SkString SkOSPath::Basename(const char* fullPath) { |
| 19 if (!fullPath) { | 19 if (!fullPath) { |
| 20 return SkString(); | 20 return SkString(); |
| 21 } | 21 } |
| 22 const char* filename = strrchr(fullPath, SkPATH_SEPARATOR); | 22 const char* filename = strrchr(fullPath, SkPATH_SEPARATOR); |
| 23 if (NULL == filename) { | 23 if (NULL == filename) { |
| 24 filename = fullPath; | 24 filename = fullPath; |
| 25 } else { | 25 } else { |
| 26 ++filename; | 26 ++filename; |
| 27 } | 27 } |
| 28 return SkString(filename); | 28 return SkString(filename); |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 if (entry) // we broke out with a file | 229 if (entry) // we broke out with a file |
| 230 { | 230 { |
| 231 if (name) | 231 if (name) |
| 232 name->set(entry->d_name); | 232 name->set(entry->d_name); |
| 233 return true; | 233 return true; |
| 234 } | 234 } |
| 235 } | 235 } |
| 236 return false; | 236 return false; |
| 237 } | 237 } |
| 238 #endif // if one of:SK_BUILD_FOR_MAC, SK_BUILD_FOR_UNIX, SK_BUILD_FOR_ANDROID,SK
_BUILD_FOR_IOS | 238 #endif // if one of:SK_BUILD_FOR_MAC, SK_BUILD_FOR_UNIX, SK_BUILD_FOR_ANDROID,SK
_BUILD_FOR_IOS |
| OLD | NEW |