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

Unified Diff: include/core/SkOSFile.h

Issue 15740024: Reland 'Add path utils, plus a test for it.' (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: 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..8564d43027a8a3b2e37a97a74f923b668399fecb 100644
--- a/include/core/SkOSFile.h
+++ b/include/core/SkOSFile.h
@@ -105,4 +105,27 @@ private:
uint16_t* fStr;
};
+/**
+ * Functions for modifying SkStrings which represent paths on the filesystem.
+ */
+class SkOSPath {
+public:
+ /**
+ * Assembles rootPath and relativePath into a single path, like this:
+ * rootPath/relativePath
+ *
+ * Uses SkPATH_SEPARATOR, to work on all platforms.
+ */
+ static 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.
+ */
+ static SkString SkBasename(const char* fullPath);
+};
#endif

Powered by Google App Engine
This is Rietveld 408576698