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

Unified Diff: include/core/SkOSFile.h

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, 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/core/SkOSFile.h
diff --git a/include/core/SkOSFile.h b/include/core/SkOSFile.h
index 257b66ae67b30454d5819bcf21a15752bc378d9b..e67da3bfa9651a1787ce333b9d42b52423fe1557 100644
--- a/include/core/SkOSFile.h
+++ b/include/core/SkOSFile.h
@@ -105,4 +105,26 @@ private:
uint16_t* fStr;
};
+/**
+ * Functions for modifying SkStrings which represent paths on the filesystem.
+ */
+namespace SkOSPathUtils {
+ /**
+ * 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);
epoger 2013/05/24 16:42:55 Rather than creating the new SkOSPathUtils namespa
scroggo 2013/05/24 17:36:05 I like that better. Done.
+
+ /**
+ * 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);
+}
#endif

Powered by Google App Engine
This is Rietveld 408576698