diff options
Diffstat (limited to 'src/util/StringUtil.cxx')
-rw-r--r-- | src/util/StringUtil.cxx | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/src/util/StringUtil.cxx b/src/util/StringUtil.cxx index b9c99eb4a..337476f18 100644 --- a/src/util/StringUtil.cxx +++ b/src/util/StringUtil.cxx @@ -27,54 +27,6 @@ #include <assert.h> #include <string.h> -bool -StringStartsWith(const char *haystack, const char *needle) -{ - const size_t length = strlen(needle); - return memcmp(haystack, needle, length) == 0; -} - -bool -StringEndsWith(const char *haystack, const char *needle) -{ - const size_t haystack_length = strlen(haystack); - const size_t needle_length = strlen(needle); - - return haystack_length >= needle_length && - memcmp(haystack + haystack_length - needle_length, - needle, needle_length) == 0; -} - -const char * -StringAfterPrefix(const char *string, const char *prefix) -{ -#if !CLANG_CHECK_VERSION(3,6) - /* disabled on clang due to -Wtautological-pointer-compare */ - assert(string != nullptr); - assert(prefix != nullptr); -#endif - - size_t prefix_length = strlen(prefix); - return StringIsEqual(string, prefix, prefix_length) - ? string + prefix_length - : nullptr; -} - -const char * -FindStringSuffix(const char *p, const char *suffix) -{ - const size_t p_length = strlen(p); - const size_t suffix_length = strlen(suffix); - - if (p_length < suffix_length) - return nullptr; - - const char *q = p + p_length - suffix_length; - return memcmp(q, suffix, suffix_length) == 0 - ? q - : nullptr; -} - char * CopyString(char *gcc_restrict dest, const char *gcc_restrict src, size_t size) { |