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 class SkOSPath { |
| 112 public: |
| 113 /** |
| 114 * Assembles rootPath and relativePath into a single path, like this: |
| 115 * rootPath/relativePath |
| 116 * |
| 117 * Uses SkPATH_SEPARATOR, to work on all platforms. |
| 118 */ |
| 119 static SkString SkPathJoin(const char *rootPath, const char *relativePath); |
| 120 |
| 121 /** |
| 122 * Return the name of the file, ignoring the directory structure. |
| 123 * Behaves like python's os.path.basename. If the fullPath is |
| 124 * /dir/subdir/, an empty string is returned. |
| 125 * @param fullPath Full path to the file. |
| 126 * @return SkString The basename of the file - anything beyond the |
| 127 * final slash, or the full name if there is no slash. |
| 128 */ |
| 129 static SkString SkBasename(const char* fullPath); |
| 130 }; |
108 #endif | 131 #endif |
OLD | NEW |