Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: src/utils/SkOSFile.cpp

Issue 15747004: Add path utils, plus a test for it. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Remove unnecessary changes. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698