summaryrefslogtreecommitdiff
path: root/include/llvm/ADT/StringExtras.h
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2010-01-11 19:45:18 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2010-01-11 19:45:18 +0000
commit7462b5dd99163785480a11a7c999569b349a137c (patch)
treec8eae5441b8650654dda7037b87533540eb3fc1c /include/llvm/ADT/StringExtras.h
parentcd1fd251ebfcc5e3d9bbbb6dda7ed921b28481bc (diff)
downloadllvm-7462b5dd99163785480a11a7c999569b349a137c.tar.gz
llvm-7462b5dd99163785480a11a7c999569b349a137c.tar.bz2
llvm-7462b5dd99163785480a11a7c999569b349a137c.tar.xz
Add StrInStrNoCase, a StringRef version of CStrInCStrNoCase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93174 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/StringExtras.h')
-rw-r--r--include/llvm/ADT/StringExtras.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/llvm/ADT/StringExtras.h b/include/llvm/ADT/StringExtras.h
index 2f5c39cad8..55a7cfb983 100644
--- a/include/llvm/ADT/StringExtras.h
+++ b/include/llvm/ADT/StringExtras.h
@@ -203,6 +203,11 @@ static inline const char* CStrInCStrNoCase(const char *s1, const char *s2) {
return *I2 == '\0' ? s1 : 0;
}
+/// StrInStrNoCase - Portable version of strcasestr. Locates the first
+/// occurrence of string 's1' in string 's2', ignoring case. Returns
+/// the offset of s2 in s1 or npos if s2 cannot be found.
+StringRef::size_type StrInStrNoCase(StringRef s1, StringRef s2);
+
/// getToken - This function extracts one token from source, ignoring any
/// leading characters that appear in the Delimiters string, and ending the
/// token at any of the characters that appear in the Delimiters string. If