Util2.cpp (pymol-v2.1.0.tar.bz2) | : | Util2.cpp (pymol-open-source-2.2.0) | ||
---|---|---|---|---|
skipping to change at line 80 | skipping to change at line 80 | |||
return cstrlessnat(a + na, b + nb); | return cstrlessnat(a + na, b + nb); | |||
} | } | |||
/* | /* | |||
* Natural string compare: F1 < F2 < F10 | * Natural string compare: F1 < F2 < F10 | |||
*/ | */ | |||
bool strlessnat(const std::string& a, const std::string& b) { | bool strlessnat(const std::string& a, const std::string& b) { | |||
return cstrlessnat(a.c_str(), b.c_str()); | return cstrlessnat(a.c_str(), b.c_str()); | |||
} | } | |||
/* | ||||
* Return true if s starts with the specified prefix, false otherwise. | ||||
*/ | ||||
bool p_strstartswith(const char * s, const char * prefix) { | ||||
while (*prefix) | ||||
if (*s++ != *prefix++) | ||||
return false; | ||||
return true; | ||||
} | ||||
/* | ||||
* case-insensitive version of p_strstartswith | ||||
*/ | ||||
bool p_strcasestartswith(const char * s, const char * prefix) { | ||||
for (; *prefix; ++s, ++prefix) | ||||
if (*s != *prefix && tolower(*s) != tolower(*prefix)) | ||||
return false; | ||||
return true; | ||||
} | ||||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 0 lines changed or added |