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 namespace SkOSPathUtils { | |
epoger
2013/05/24 16:42:55
I agree that SkOSFile is declared/defined in a str
| |
230 SkString SkPathJoin(const char *rootPath, const char *relativePath) { | |
231 SkString result(rootPath); | |
232 if (!result.endsWith(SkPATH_SEPARATOR)) { | |
233 result.appendUnichar(SkPATH_SEPARATOR); | |
234 } | |
235 result.append(relativePath); | |
236 return result; | |
237 } | |
238 | |
239 SkString SkBasename(const char* fullPath) { | |
240 if (!fullPath) { | |
241 return SkString(); | |
242 } | |
243 const char* filename = strrchr(fullPath, SkPATH_SEPARATOR); | |
244 if (NULL == filename) { | |
245 filename = fullPath; | |
246 } else { | |
247 ++filename; | |
248 } | |
249 return SkString(filename); | |
250 } | |
251 } | |
229 #endif | 252 #endif |
OLD | NEW |