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

Unified Diff: include/utils/SkOSPathUtils.h

Issue 15747004: Add path utils, plus a test for it. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Respond to comments. 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 side-by-side diff with in-line comments
Download patch
Index: include/utils/SkOSPathUtils.h
diff --git a/include/utils/SkOSPathUtils.h b/include/utils/SkOSPathUtils.h
new file mode 100644
index 0000000000000000000000000000000000000000..6aff5c77346b88476f3da8b1a590926fe79d8984
--- /dev/null
+++ b/include/utils/SkOSPathUtils.h
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2013 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+class SkString;
+
+/**
+ * Assembles rootPath and relativePath into a single path, like this:
+ * rootPath/relativePath
+ *
+ * Uses SkPATH_SEPARATOR, to work on all platforms.
+ */
+SkString SkPathJoin(const char *rootPath, const char *relativePath);
+
+/**
+ * Return the name of the file, ignoring the directory structure.
+ * Behaves like python's os.path.basename. If the fullPath is
+ * /dir/subdir/, an empty string is returned.
+ * @param fullPath Full path to the file.
+ * @return SkString The basename of the file - anything beyond the
+ * final slash, or the full name if there is no slash.
+ */
+SkString SkBasename(const char* fullPath);
« no previous file with comments | « gyp/utils.gyp ('k') | src/utils/SkOSPathUtils.cpp » ('j') | tools/skimage_main.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698