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:26

Templates

unsigned int InternalLen

Method Overview

Methods

SmallString<InternalLen>(llvm::StringRef S)

Description

Initialize from a StringRef.

Declared at: llvm/include/llvm/ADT/SmallString.h:32

Parameters

llvm::StringRef S

template <typename ItTy>
SmallString<InternalLen>(ItTy S, ItTy E)

Description

Initialize with a range.

Declared at: llvm/include/llvm/ADT/SmallString.h:42

Templates

ItTy

Parameters

ItTy S
ItTy E

SmallString<InternalLen>(
    std::initializer_list<StringRef> Refs)

Description

Initialize by concatenating a list of StringRefs.

Declared at: llvm/include/llvm/ADT/SmallString.h:35

Parameters

std::initializer_list<StringRef> Refs

SmallString<InternalLen>()

Description

Default ctor - Initialize to empty.

Declared at: llvm/include/llvm/ADT/SmallString.h:29

void append(llvm::StringRef RHS)

Description

Append from a StringRef.

Declared at: llvm/include/llvm/ADT/SmallString.h:68

Parameters

llvm::StringRef RHS

void append(std::initializer_list<StringRef> Refs)

Description

Append from a list of StringRefs.

Declared at: llvm/include/llvm/ADT/SmallString.h:73

Parameters

std::initializer_list<StringRef> Refs

void assign(llvm::StringRef RHS)

Description

Assign from a StringRef.

Declared at: llvm/include/llvm/ADT/SmallString.h:51

Parameters

llvm::StringRef RHS

void assign(std::initializer_list<StringRef> Refs)

Description

Assign from a list of StringRefs.

Declared at: llvm/include/llvm/ADT/SmallString.h:56

Parameters

std::initializer_list<StringRef> Refs

const char* c_str()

Declared at: llvm/include/llvm/ADT/SmallString.h:263

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:103

Parameters

llvm::StringRef RHS

int compare_insensitive(llvm::StringRef RHS) const

Description

compare_insensitive - Compare two strings, ignoring case.

Declared at: llvm/include/llvm/ADT/SmallString.h:108

Parameters

llvm::StringRef RHS

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:114

Parameters

llvm::StringRef RHS

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:222

Parameters

llvm::StringRef Str

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:216

Parameters

char C

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:128

Parameters

llvm::StringRef Suffix

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:92

Parameters

llvm::StringRef RHS

bool equals_insensitive(llvm::StringRef RHS) const

Description

Check for string equality, ignoring case.

Declared at: llvm/include/llvm/ADT/SmallString.h:97

Parameters

llvm::StringRef RHS

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:148

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

Description

find - Search for the first character \p C in the string.

Declared at: llvm/include/llvm/ADT/SmallString.h:140

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

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:184

Parameters

char C
size_t From = 0

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:192

Parameters

llvm::StringRef Chars
size_t From = 0

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:170

Parameters

char C
size_t From = 0

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:178

Parameters

llvm::StringRef Chars
size_t From = 0

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:198

Parameters

char C
size_t From = StringRef::npos

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:206

Parameters

llvm::StringRef Chars
size_t From = StringRef::npos

llvm::StringRef operator StringRef() const

Description

Implicit conversion to StringRef.

Declared at: llvm/include/llvm/ADT/SmallString.h:270

std::string operator basic_string() const

Declared at: llvm/include/llvm/ADT/SmallString.h:272

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:164

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

Description

Search for the last character \p C in the string.

Declared at: llvm/include/llvm/ADT/SmallString.h:156

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

Description

Return a reference to the substring from [Start, End).

Declared at: llvm/include/llvm/ADT/SmallString.h:253

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

Description

startswith - Check if this string starts with the given \p Prefix.

Declared at: llvm/include/llvm/ADT/SmallString.h:123

Parameters

llvm::StringRef Prefix

llvm::StringRef str() const

Description

Explicit conversion to StringRef.

Declared at: llvm/include/llvm/ADT/SmallString.h:260

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:239

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.