| OLD | NEW |
| 1 #include "SkOSFile.h" | 1 #include "SkOSFile.h" |
| 2 | 2 |
| 3 #ifdef SK_BUILD_FOR_WIN | 3 #ifdef SK_BUILD_FOR_WIN |
| 4 | 4 |
| 5 static uint16_t* concat_to_16(const char src[], const char suffix[]) | 5 static uint16_t* concat_to_16(const char src[], const char suffix[]) |
| 6 { | 6 { |
| 7 size_t i, len = strlen(src); | 7 size_t i, len = strlen(src); |
| 8 size_t len2 = 3 + (suffix ? strlen(suffix) : 0); | 8 size_t len2 = 3 + (suffix ? strlen(suffix) : 0); |
| 9 uint16_t* dst = (uint16_t*)sk_malloc_throw((len + len2) * sizeof(uint16_t)); | 9 uint16_t* dst = (uint16_t*)sk_malloc_throw((len + len2) * sizeof(uint16_t)); |
| 10 | 10 |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 } | 165 } |
| 166 else | 166 else |
| 167 fSuffix.reset(); | 167 fSuffix.reset(); |
| 168 } | 168 } |
| 169 | 169 |
| 170 // returns true if suffix is empty, or if str ends with suffix | 170 // returns true if suffix is empty, or if str ends with suffix |
| 171 static bool issuffixfor(const SkString& suffix, const char str[]) | 171 static bool issuffixfor(const SkString& suffix, const char str[]) |
| 172 { | 172 { |
| 173 size_t suffixLen = suffix.size(); | 173 size_t suffixLen = suffix.size(); |
| 174 size_t strLen = strlen(str); | 174 size_t strLen = strlen(str); |
| 175 | 175 |
| 176 return strLen >= suffixLen && | 176 return strLen >= suffixLen && |
| 177 suffixLen == 0 || | 177 suffixLen == 0 || |
| 178 memcmp(suffix.c_str(), str + strLen - suffixLen, suffixLen) == 0; | 178 memcmp(suffix.c_str(), str + strLen - suffixLen, suffixLen) == 0; |
| 179 } | 179 } |
| 180 | 180 |
| 181 #include <sys/stat.h> | 181 #include <sys/stat.h> |
| 182 | 182 |
| 183 bool SkOSFile::Iter::next(SkString* name, bool getDir) | 183 bool SkOSFile::Iter::next(SkString* name, bool getDir) |
| 184 { | 184 { |
| 185 if (fDIR) | 185 if (fDIR) |
| (...skipping 28 matching lines...) Expand all Loading... |
| 214 if (name) | 214 if (name) |
| 215 name->set(entry->d_name); | 215 name->set(entry->d_name); |
| 216 return true; | 216 return true; |
| 217 } | 217 } |
| 218 } | 218 } |
| 219 return false; | 219 return false; |
| 220 } | 220 } |
| 221 | 221 |
| 222 #endif | 222 #endif |
| 223 | 223 |
| OLD | NEW |