| 1267 | |
| 1268 | template<typename T> |
| 1269 | static int TIndexOf(int s, const T *str, int strLen, const T *sought, int soughtLen) |
| 1270 | { |
| 1271 | if (soughtLen==1) |
| 1272 | { |
| 1273 | T test = *sought; |
| 1274 | while(s<strLen) |
| 1275 | { |
| 1276 | if (str[s]==test) |
| 1277 | return s; |
| 1278 | ++s; |
| 1279 | } |
| 1280 | } |
| 1281 | else |
| 1282 | { |
| 1283 | while(s+soughtLen<=strLen) |
| 1284 | { |
| 1285 | if (!memcmp(str + s,sought,soughtLen*sizeof(T))) |
| 1286 | return s; |
| 1287 | s++; |
| 1288 | } |
| 1289 | } |
| 1290 | return -1; |
| 1291 | } |
| 1292 | |
| 1293 | static bool StrMatch(const char16_t *src0, const char *src1, int len) |
| 1294 | { |