Chromium Code Reviews| 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 |