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

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

Issue 15747004: Add path utils, plus a test for it. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Remove extra SkPathJoin implementation. Created 7 years, 7 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
(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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698