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 |