class SmallString
Declaration
template <unsigned int InternalLen>
class SmallString { /* full declaration omitted */ };
Description
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better as a string (e.g. operator+ etc).
Declared at: llvm/include/llvm/ADT/SmallString.h:25
Templates
- unsigned int InternalLen
Method Overview
- public SmallString<InternalLen>(llvm::StringRef S)
- public SmallString<InternalLen>()
- public template <typename ItTy> SmallString<InternalLen>(ItTy S, ItTy E)
- public template <typename in_iter>void append(in_iter S, in_iter E)
- public void append(const SmallVectorImpl<char> & RHS)
- public void append(llvm::StringRef RHS)
- public void append(size_t NumInputs, char Elt)
- public void assign(const SmallVectorImpl<char> & RHS)
- public void assign(size_t NumElts, char Elt)
- public template <typename in_iter>void assign(in_iter S, in_iter E)
- public void assign(llvm::StringRef RHS)
- public const char * c_str()
- public int compare(llvm::StringRef RHS) const
- public int compare_lower(llvm::StringRef RHS) const
- public int compare_numeric(llvm::StringRef RHS) const
- public size_t count(llvm::StringRef Str) const
- public size_t count(char C) const
- public bool endswith(llvm::StringRef Suffix) const
- public bool equals(llvm::StringRef RHS) const
- public bool equals_lower(llvm::StringRef RHS) const
- public size_t find(llvm::StringRef Str, size_t From = 0) const
- public size_t find(char C, size_t From = 0) const
- public size_t find_first_not_of(char C, size_t From = 0) const
- public size_t find_first_not_of(llvm::StringRef Chars, size_t From = 0) const
- public size_t find_first_of(char C, size_t From = 0) const
- public size_t find_first_of(llvm::StringRef Chars, size_t From = 0) const
- public size_t find_last_of(char C, size_t From = StringRef::npos) const
- public size_t find_last_of(llvm::StringRef Chars, size_t From = StringRef::npos) const
- public llvm::StringRef operator StringRef() const
- public size_t rfind(llvm::StringRef Str) const
- public size_t rfind(char C, size_t From = StringRef::npos) const
- public llvm::StringRef slice(size_t Start, size_t End) const
- public bool startswith(llvm::StringRef Prefix) const
- public llvm::StringRef str() const
- public llvm::StringRef substr(size_t Start, size_t N = StringRef::npos) const
Methods
¶SmallString<InternalLen>(llvm::StringRef S)
SmallString<InternalLen>(llvm::StringRef S)
Description
Initialize from a StringRef.
Declared at: llvm/include/llvm/ADT/SmallString.h:31
Parameters
¶SmallString<InternalLen>()
SmallString<InternalLen>()
Description
Default ctor - Initialize to empty.
Declared at: llvm/include/llvm/ADT/SmallString.h:28
¶template <typename ItTy>
SmallString<InternalLen>(ItTy S, ItTy E)
template <typename ItTy>
SmallString<InternalLen>(ItTy S, ItTy E)
Description
Initialize with a range.
Declared at: llvm/include/llvm/ADT/SmallString.h:35
Templates
- ItTy
Parameters
- ItTy S
- ItTy E
¶template <typename in_iter>
void append(in_iter S, in_iter E)
template <typename in_iter>
void append(in_iter S, in_iter E)
Description
Append from an iterator pair.
Declared at: llvm/include/llvm/ADT/SmallString.h:74
Templates
- in_iter
Parameters
- in_iter S
- in_iter E
¶void append(const SmallVectorImpl<char>& RHS)
void append(const SmallVectorImpl<char>& RHS)
Description
Append from a SmallVector.
Declared at: llvm/include/llvm/ADT/SmallString.h:88
Parameters
- const SmallVectorImpl<char>& RHS
¶void append(llvm::StringRef RHS)
void append(llvm::StringRef RHS)
Description
Append from a StringRef.
Declared at: llvm/include/llvm/ADT/SmallString.h:83
Parameters
- llvm::StringRef RHS
¶void append(size_t NumInputs, char Elt)
void append(size_t NumInputs, char Elt)
Declared at: llvm/include/llvm/ADT/SmallString.h:78
Parameters
- size_t NumInputs
- char Elt
¶void assign(const SmallVectorImpl<char>& RHS)
void assign(const SmallVectorImpl<char>& RHS)
Description
Assign from a SmallVector.
Declared at: llvm/include/llvm/ADT/SmallString.h:63
Parameters
- const SmallVectorImpl<char>& RHS
¶void assign(size_t NumElts, char Elt)
void assign(size_t NumElts, char Elt)
Description
Assign from a repeated element.
Declared at: llvm/include/llvm/ADT/SmallString.h:45
Parameters
- size_t NumElts
- char Elt
¶template <typename in_iter>
void assign(in_iter S, in_iter E)
template <typename in_iter>
void assign(in_iter S, in_iter E)
Description
Assign from an iterator pair.
Declared at: llvm/include/llvm/ADT/SmallString.h:51
Templates
- in_iter
Parameters
- in_iter S
- in_iter E
¶void assign(llvm::StringRef RHS)
void assign(llvm::StringRef RHS)
Description
Assign from a StringRef.
Declared at: llvm/include/llvm/ADT/SmallString.h:57
Parameters
- llvm::StringRef RHS
¶const char* c_str()
const char* c_str()
Declared at: llvm/include/llvm/ADT/SmallString.h:269
¶int compare(llvm::StringRef RHS) const
int compare(llvm::StringRef RHS) const
Description
Compare two strings; the result is -1, 0, or 1 if this string is lexicographically less than, equal to, or greater than the \p RHS.
Declared at: llvm/include/llvm/ADT/SmallString.h:109
Parameters
- llvm::StringRef RHS
¶int compare_lower(llvm::StringRef RHS) const
int compare_lower(llvm::StringRef RHS) const
Description
compare_lower - Compare two strings, ignoring case.
Declared at: llvm/include/llvm/ADT/SmallString.h:114
Parameters
- llvm::StringRef RHS
¶int compare_numeric(llvm::StringRef RHS) const
int compare_numeric(llvm::StringRef RHS) const
Description
compare_numeric - Compare two strings, treating sequences of digits as numbers.
Declared at: llvm/include/llvm/ADT/SmallString.h:120
Parameters
- llvm::StringRef RHS
¶size_t count(llvm::StringRef Str) const
size_t count(llvm::StringRef Str) const
Description
Return the number of non-overlapped occurrences of \p Str in the string.
Declared at: llvm/include/llvm/ADT/SmallString.h:228
Parameters
- llvm::StringRef Str
¶size_t count(char C) const
size_t count(char C) const
Description
Return the number of occurrences of \p C in the string.
Declared at: llvm/include/llvm/ADT/SmallString.h:222
Parameters
- char C
¶bool endswith(llvm::StringRef Suffix) const
bool endswith(llvm::StringRef Suffix) const
Description
endswith - Check if this string ends with the given \p Suffix.
Declared at: llvm/include/llvm/ADT/SmallString.h:134
Parameters
- llvm::StringRef Suffix
¶bool equals(llvm::StringRef RHS) const
bool equals(llvm::StringRef RHS) const
Description
Check for string equality. This is more efficient than compare() when the relative ordering of inequal strings isn't needed.
Declared at: llvm/include/llvm/ADT/SmallString.h:98
Parameters
- llvm::StringRef RHS
¶bool equals_lower(llvm::StringRef RHS) const
bool equals_lower(llvm::StringRef RHS) const
Description
Check for string equality, ignoring case.
Declared at: llvm/include/llvm/ADT/SmallString.h:103
Parameters
- llvm::StringRef RHS
¶size_t find(llvm::StringRef Str,
size_t From = 0) const
size_t find(llvm::StringRef Str,
size_t From = 0) const
Description
Search for the first string \p Str in the string.
Declared at: llvm/include/llvm/ADT/SmallString.h:154
Parameters
- llvm::StringRef Str
- size_t From = 0
Returns
The index of the first occurrence of \p Str, or npos if not found.
¶size_t find(char C, size_t From = 0) const
size_t find(char C, size_t From = 0) const
Description
find - Search for the first character \p C in the string.
Declared at: llvm/include/llvm/ADT/SmallString.h:146
Parameters
- char C
- size_t From = 0
Returns
- The index of the first occurrence of \p C, or npos if not found.
¶size_t find_first_not_of(char C,
size_t From = 0) const
size_t find_first_not_of(char C,
size_t From = 0) const
Description
Find the first character in the string that is not \p C or npos if not found.
Declared at: llvm/include/llvm/ADT/SmallString.h:190
Parameters
- char C
- size_t From = 0
¶size_t find_first_not_of(llvm::StringRef Chars,
size_t From = 0) const
size_t find_first_not_of(llvm::StringRef Chars,
size_t From = 0) const
Description
Find the first character in the string that is not in the string\p Chars, or npos if not found. Complexity: O(size() + Chars.size())
Declared at: llvm/include/llvm/ADT/SmallString.h:198
Parameters
- llvm::StringRef Chars
- size_t From = 0
¶size_t find_first_of(char C,
size_t From = 0) const
size_t find_first_of(char C,
size_t From = 0) const
Description
Find the first character in the string that is \p C, or npos if not found. Same as find.
Declared at: llvm/include/llvm/ADT/SmallString.h:176
Parameters
- char C
- size_t From = 0
¶size_t find_first_of(llvm::StringRef Chars,
size_t From = 0) const
size_t find_first_of(llvm::StringRef Chars,
size_t From = 0) const
Description
Find the first character in the string that is in \p Chars, or npos if not found. Complexity: O(size() + Chars.size())
Declared at: llvm/include/llvm/ADT/SmallString.h:184
Parameters
- llvm::StringRef Chars
- size_t From = 0
¶size_t find_last_of(
char C,
size_t From = StringRef::npos) const
size_t find_last_of(
char C,
size_t From = StringRef::npos) const
Description
Find the last character in the string that is \p C, or npos if not found.
Declared at: llvm/include/llvm/ADT/SmallString.h:204
Parameters
- char C
- size_t From = StringRef::npos
¶size_t find_last_of(
llvm::StringRef Chars,
size_t From = StringRef::npos) const
size_t find_last_of(
llvm::StringRef Chars,
size_t From = StringRef::npos) const
Description
Find the last character in the string that is in \p C, or npos if not found. Complexity: O(size() + Chars.size())
Declared at: llvm/include/llvm/ADT/SmallString.h:212
Parameters
- llvm::StringRef Chars
- size_t From = StringRef::npos
¶llvm::StringRef operator StringRef() const
llvm::StringRef operator StringRef() const
Description
Implicit conversion to StringRef.
Declared at: llvm/include/llvm/ADT/SmallString.h:276
¶size_t rfind(llvm::StringRef Str) const
size_t rfind(llvm::StringRef Str) const
Description
Search for the last string \p Str in the string.
Declared at: llvm/include/llvm/ADT/SmallString.h:170
Parameters
- llvm::StringRef Str
Returns
The index of the last occurrence of \p Str, or npos if not found.
¶size_t rfind(char C,
size_t From = StringRef::npos) const
size_t rfind(char C,
size_t From = StringRef::npos) const
Description
Search for the last character \p C in the string.
Declared at: llvm/include/llvm/ADT/SmallString.h:162
Parameters
- char C
- size_t From = StringRef::npos
Returns
The index of the last occurrence of \p C, or npos if not found.
¶llvm::StringRef slice(size_t Start,
size_t End) const
llvm::StringRef slice(size_t Start,
size_t End) const
Description
Return a reference to the substring from [Start, End).
Declared at: llvm/include/llvm/ADT/SmallString.h:259
Parameters
- size_t Start
- The index of the starting character in the substring; if the index is npos or greater than the length of the string then the empty substring will be returned.
- size_t End
- The index following the last character to include in the substring. If this is npos, or less than \p Start, or exceeds the number of characters remaining in the string, the string suffix (starting with \p Start) will be returned.
¶bool startswith(llvm::StringRef Prefix) const
bool startswith(llvm::StringRef Prefix) const
Description
startswith - Check if this string starts with the given \p Prefix.
Declared at: llvm/include/llvm/ADT/SmallString.h:129
Parameters
- llvm::StringRef Prefix
¶llvm::StringRef str() const
llvm::StringRef str() const
Description
Explicit conversion to StringRef.
Declared at: llvm/include/llvm/ADT/SmallString.h:266
¶llvm::StringRef substr(
size_t Start,
size_t N = StringRef::npos) const
llvm::StringRef substr(
size_t Start,
size_t N = StringRef::npos) const
Description
Return a reference to the substring from [Start, Start + N).
Declared at: llvm/include/llvm/ADT/SmallString.h:245
Parameters
- size_t Start
- The index of the starting character in the substring; if the index is npos or greater than the length of the string then the empty substring will be returned.
- size_t N = StringRef::npos
- The number of characters to included in the substring. If \p N exceeds the number of characters remaining in the string, the string suffix (starting with \p Start) will be returned.