| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 #include "SkOSFile.h" | 8 #include "SkOSFile.h" |
| 9 | 9 |
| 10 #ifdef SK_BUILD_FOR_WIN | 10 #ifdef SK_BUILD_FOR_WIN |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 if (entry) // we broke out with a file | 219 if (entry) // we broke out with a file |
| 220 { | 220 { |
| 221 if (name) | 221 if (name) |
| 222 name->set(entry->d_name); | 222 name->set(entry->d_name); |
| 223 return true; | 223 return true; |
| 224 } | 224 } |
| 225 } | 225 } |
| 226 return false; | 226 return false; |
| 227 } | 227 } |
| 228 | 228 |
| 229 SkString SkOSPath::SkPathJoin(const char *rootPath, const char *relativePath) { | |
| 230 SkString result(rootPath); | |
| 231 if (!result.endsWith(SkPATH_SEPARATOR)) { | |
| 232 result.appendUnichar(SkPATH_SEPARATOR); | |
| 233 } | |
| 234 result.append(relativePath); | |
| 235 return result; | |
| 236 } | |
| 237 | |
| 238 SkString SkOSPath::SkBasename(const char* fullPath) { | |
| 239 if (!fullPath) { | |
| 240 return SkString(); | |
| 241 } | |
| 242 const char* filename = strrchr(fullPath, SkPATH_SEPARATOR); | |
| 243 if (NULL == filename) { | |
| 244 filename = fullPath; | |
| 245 } else { | |
| 246 ++filename; | |
| 247 } | |
| 248 return SkString(filename); | |
| 249 } | |
| 250 #endif | 229 #endif |
| OLD | NEW |