Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 // TODO: add unittests for all these operations | 10 // TODO: add unittests for all these operations |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 98 ~SkUTF16_Str() | 98 ~SkUTF16_Str() |
| 99 { | 99 { |
| 100 sk_free(fStr); | 100 sk_free(fStr); |
| 101 } | 101 } |
| 102 const uint16_t* get() const { return fStr; } | 102 const uint16_t* get() const { return fStr; } |
| 103 | 103 |
| 104 private: | 104 private: |
| 105 uint16_t* fStr; | 105 uint16_t* fStr; |
| 106 }; | 106 }; |
| 107 | 107 |
| 108 /** | |
| 109 * Functions for modifying SkStrings which represent paths on the filesystem. | |
| 110 */ | |
| 111 namespace SkOSPathUtils { | |
| 112 /** | |
| 113 * Assembles rootPath and relativePath into a single path, like this: | |
| 114 * rootPath/relativePath | |
| 115 * | |
| 116 * Uses SkPATH_SEPARATOR, to work on all platforms. | |
| 117 */ | |
| 118 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.
| |
| 119 | |
| 120 /** | |
| 121 * Return the name of the file, ignoring the directory structure. | |
| 122 * Behaves like python's os.path.basename. If the fullPath is | |
| 123 * /dir/subdir/, an empty string is returned. | |
| 124 * @param fullPath Full path to the file. | |
| 125 * @return SkString The basename of the file - anything beyond the | |
| 126 * final slash, or the full name if there is no slash. | |
| 127 */ | |
| 128 SkString SkBasename(const char* fullPath); | |
| 129 } | |
| 108 #endif | 130 #endif |
| OLD | NEW |