OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright 2013 Google Inc. |
| 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. |
| 6 */ |
| 7 |
| 8 #include "SkOSFile.h" |
| 9 #include "SkOSPathUtils.h" |
| 10 #include "SkString.h" |
| 11 |
| 12 SkString SkPathJoin(const char *rootPath, const char *relativePath) { |
| 13 SkString result(rootPath); |
| 14 if (!result.endsWith(SkPATH_SEPARATOR)) { |
| 15 result.appendUnichar(SkPATH_SEPARATOR); |
| 16 } |
| 17 result.append(relativePath); |
| 18 return result; |
| 19 } |
| 20 |
| 21 const char* SkBasename(const char* fullPath) { |
| 22 const char* filename = strrchr(fullPath, SkPATH_SEPARATOR); |
| 23 if (NULL == filename || *++filename == '\0') { |
| 24 filename = fullPath; |
| 25 } |
| 26 return filename; |
| 27 } |
OLD | NEW |