LLVM
17.0.0git
|
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better as a string (e.g. More...
#include "llvm/ADT/SmallString.h"
Public Member Functions | |
SmallString ()=default | |
Default ctor - Initialize to empty. More... | |
SmallString (StringRef S) | |
Initialize from a StringRef. More... | |
SmallString (std::initializer_list< StringRef > Refs) | |
Initialize by concatenating a list of StringRefs. More... | |
template<typename ItTy > | |
SmallString (ItTy S, ItTy E) | |
Initialize with a range. More... | |
String Assignment | |
void | assign (StringRef RHS) |
Assign from a StringRef. More... | |
void | assign (std::initializer_list< StringRef > Refs) |
Assign from a list of StringRefs. More... | |
String Concatenation | |
void | append (StringRef RHS) |
Append from a StringRef. More... | |
void | append (std::initializer_list< StringRef > Refs) |
Append from a list of StringRefs. More... | |
String Comparison | |
bool | equals (StringRef RHS) const |
Check for string equality. More... | |
bool | equals_insensitive (StringRef RHS) const |
Check for string equality, ignoring case. More... | |
int | compare (StringRef RHS) const |
compare - Compare two strings; the result is negative, zero, or positive if this string is lexicographically less than, equal to, or greater than the RHS . More... | |
int | compare_insensitive (StringRef RHS) const |
compare_insensitive - Compare two strings, ignoring case. More... | |
int | compare_numeric (StringRef RHS) const |
compare_numeric - Compare two strings, treating sequences of digits as numbers. More... | |
String Predicates | |
bool | startswith (StringRef Prefix) const |
startswith - Check if this string starts with the given Prefix . More... | |
bool | endswith (StringRef Suffix) const |
endswith - Check if this string ends with the given Suffix . More... | |
String Searching | |
size_t | find (char C, size_t From=0) const |
find - Search for the first character C in the string. More... | |
size_t | find (StringRef Str, size_t From=0) const |
Search for the first string Str in the string. More... | |
size_t | rfind (char C, size_t From=StringRef::npos) const |
Search for the last character C in the string. More... | |
size_t | rfind (StringRef Str) const |
Search for the last string Str in the string. More... | |
size_t | find_first_of (char C, size_t From=0) const |
Find the first character in the string that is C , or npos if not found. More... | |
size_t | find_first_of (StringRef Chars, size_t From=0) const |
Find the first character in the string that is in Chars , or npos if not found. More... | |
size_t | find_first_not_of (char C, size_t From=0) const |
Find the first character in the string that is not C or npos if not found. More... | |
size_t | find_first_not_of (StringRef Chars, size_t From=0) const |
Find the first character in the string that is not in the string Chars , or npos if not found. More... | |
size_t | find_last_of (char C, size_t From=StringRef::npos) const |
Find the last character in the string that is C , or npos if not found. More... | |
size_t | find_last_of (StringRef Chars, size_t From=StringRef::npos) const |
Find the last character in the string that is in C , or npos if not found. More... | |
Helpful Algorithms | |
size_t | count (char C) const |
Return the number of occurrences of C in the string. More... | |
size_t | count (StringRef Str) const |
Return the number of non-overlapped occurrences of Str in the string. More... | |
Substring Operations | |
StringRef | substr (size_t Start, size_t N=StringRef::npos) const |
Return a reference to the substring from [Start, Start + N). More... | |
StringRef | slice (size_t Start, size_t End) const |
Return a reference to the substring from [Start, End). More... | |
StringRef | str () const |
Explicit conversion to StringRef. More... | |
const char * | c_str () |
operator StringRef () const | |
Implicit conversion to StringRef. More... | |
operator std::string () const | |
SmallString & | operator= (StringRef RHS) |
SmallString & | operator+= (StringRef RHS) |
SmallString & | operator+= (char C) |
![]() | |
SmallVector () | |
SmallVector (size_t Size, const char &Value=char()) | |
SmallVector (ItTy S, ItTy E) | |
SmallVector (const iterator_range< RangeTy > &R) | |
SmallVector (std::initializer_list< char > IL) | |
SmallVector (ArrayRef< U > A) | |
SmallVector (const SmallVector &RHS) | |
SmallVector (SmallVector &&RHS) | |
SmallVector (SmallVectorImpl< char > &&RHS) | |
~SmallVector () | |
SmallVector & | operator= (const SmallVector &RHS) |
SmallVector & | operator= (SmallVector &&RHS) |
SmallVector & | operator= (SmallVectorImpl< char > &&RHS) |
SmallVector & | operator= (std::initializer_list< char > IL) |
![]() | |
SmallVectorImpl (const SmallVectorImpl &)=delete | |
~SmallVectorImpl () | |
void | clear () |
void | resize (size_type N) |
void | resize (size_type N, ValueParamT NV) |
void | resize_for_overwrite (size_type N) |
Like resize, but T is POD, the new values won't be initialized. More... | |
void | truncate (size_type N) |
Like resize, but requires that N is less than size(). More... | |
void | reserve (size_type N) |
void | pop_back_n (size_type NumItems) |
char | pop_back_val () |
void | swap (SmallVectorImpl &RHS) |
void | append (ItTy in_start, ItTy in_end) |
Add the specified range to the end of the SmallVector. More... | |
void | append (size_type NumInputs, ValueParamT Elt) |
Append NumInputs copies of Elt to the end. More... | |
void | append (std::initializer_list< char > IL) |
void | append (const SmallVectorImpl &RHS) |
void | assign (size_type NumElts, ValueParamT Elt) |
void | assign (ItTy in_start, ItTy in_end) |
void | assign (std::initializer_list< char > IL) |
void | assign (const SmallVectorImpl &RHS) |
iterator | erase (const_iterator CI) |
iterator | erase (const_iterator CS, const_iterator CE) |
iterator | insert (iterator I, char &&Elt) |
iterator | insert (iterator I, const char &Elt) |
iterator | insert (iterator I, size_type NumToInsert, ValueParamT Elt) |
iterator | insert (iterator I, ItTy From, ItTy To) |
void | insert (iterator I, std::initializer_list< char > IL) |
reference | emplace_back (ArgTypes &&... Args) |
SmallVectorImpl & | operator= (const SmallVectorImpl &RHS) |
SmallVectorImpl & | operator= (SmallVectorImpl &&RHS) |
bool | operator== (const SmallVectorImpl &RHS) const |
bool | operator!= (const SmallVectorImpl &RHS) const |
bool | operator< (const SmallVectorImpl &RHS) const |
bool | operator> (const SmallVectorImpl &RHS) const |
bool | operator<= (const SmallVectorImpl &RHS) const |
bool | operator>= (const SmallVectorImpl &RHS) const |
Additional Inherited Members | |
![]() | |
using | iterator = typename SuperClass::iterator |
using | const_iterator = typename SuperClass::const_iterator |
using | reference = typename SuperClass::reference |
using | size_type = typename SuperClass::size_type |
![]() | |
using | ValueParamT = typename SuperClass::ValueParamT |
![]() | |
SmallVectorImpl (unsigned N) | |
void | assignRemote (SmallVectorImpl &&RHS) |
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better as a string (e.g.
operator+ etc).
Definition at line 26 of file SmallString.h.
|
default |
Default ctor - Initialize to empty.
|
inline |
Initialize from a StringRef.
Definition at line 32 of file SmallString.h.
|
inline |
Initialize by concatenating a list of StringRefs.
Definition at line 35 of file SmallString.h.
|
inline |
Initialize with a range.
Definition at line 42 of file SmallString.h.
|
inline |
Append from a list of StringRefs.
Definition at line 73 of file SmallString.h.
|
inline |
Append from a StringRef.
Definition at line 68 of file SmallString.h.
Referenced by llvm::SmallString< 256 >::assign(), llvm::createCFAOffset(), createDefCFAExpression(), ExpandBasePaths(), llvm::unittest::getInputFileDirectory(), llvm::OpenMPIRBuilder::getOrCreateSrcLocStr(), llvm::R600TargetMachine::getSubtargetImpl(), llvm::GCNTargetMachine::getSubtargetImpl(), llvm::TargetLoweringObjectFile::getSymbolWithGlobalValueBase(), llvm::sys::unicode::nameToGeneratedCodePoint(), llvm::sys::unicode::nameToHangulCodePoint(), llvm::sys::path::native(), llvm::SmallString< 256 >::operator+=(), parseBackslash(), llvm::codegen::setFunctionAttributes(), and llvm::SmallString< 256 >::SmallString().
|
inline |
Assign from a list of StringRefs.
Definition at line 56 of file SmallString.h.
|
inline |
Assign from a StringRef.
Definition at line 51 of file SmallString.h.
Referenced by llvm::cl::ExpansionContext::findConfigFile(), llvm::SmallString< 256 >::operator=(), and llvm::cl::ExpansionContext::readConfigFile().
|
inline |
Definition at line 264 of file SmallString.h.
Referenced by llvm::object::XCOFFObjectFile::getSectionFileOffsetToRawData(), printSymbolizedStackTrace(), llvm::DotCfgChangeReporter::registerCallbacks(), llvm::CachedPathResolver::resolve(), llvm::LockFileManager::waitForUnlock(), and llvm::ThinLTOCodeGenerator::writeGeneratedObject().
|
inline |
compare - Compare two strings; the result is negative, zero, or positive if this string is lexicographically less than, equal to, or greater than the RHS
.
Definition at line 104 of file SmallString.h.
|
inline |
compare_insensitive - Compare two strings, ignoring case.
Definition at line 109 of file SmallString.h.
|
inline |
compare_numeric - Compare two strings, treating sequences of digits as numbers.
Definition at line 115 of file SmallString.h.
|
inline |
Return the number of occurrences of C
in the string.
Definition at line 217 of file SmallString.h.
|
inline |
Return the number of non-overlapped occurrences of Str
in the string.
Definition at line 223 of file SmallString.h.
|
inline |
endswith - Check if this string ends with the given Suffix
.
Definition at line 129 of file SmallString.h.
|
inline |
Check for string equality.
This is more efficient than compare() when the relative ordering of inequal strings isn't needed.
Definition at line 92 of file SmallString.h.
Referenced by llvm::object::ExportEntry::operator==().
|
inline |
Check for string equality, ignoring case.
Definition at line 97 of file SmallString.h.
|
inline |
find - Search for the first character C
in the string.
C
, or npos if not found. Definition at line 141 of file SmallString.h.
|
inline |
Search for the first string Str
in the string.
Str
, or npos if not found. Definition at line 149 of file SmallString.h.
|
inline |
Find the first character in the string that is not C
or npos if not found.
Definition at line 185 of file SmallString.h.
|
inline |
Find the first character in the string that is not in the string Chars
, or npos if not found.
Complexity: O(size() + Chars.size())
Definition at line 193 of file SmallString.h.
|
inline |
Find the first character in the string that is C
, or npos if not found.
Same as find.
Definition at line 171 of file SmallString.h.
|
inline |
Find the first character in the string that is in Chars
, or npos if not found.
Complexity: O(size() + Chars.size())
Definition at line 179 of file SmallString.h.
|
inline |
Find the last character in the string that is C
, or npos if not found.
Definition at line 199 of file SmallString.h.
|
inline |
Find the last character in the string that is in C
, or npos if not found.
Complexity: O(size() + Chars.size())
Definition at line 207 of file SmallString.h.
|
inlineexplicit |
Definition at line 273 of file SmallString.h.
|
inline |
Implicit conversion to StringRef.
Definition at line 271 of file SmallString.h.
|
inline |
Definition at line 287 of file SmallString.h.
|
inline |
Definition at line 283 of file SmallString.h.
|
inline |
Definition at line 278 of file SmallString.h.
|
inline |
Search for the last character C
in the string.
C
, or npos if not found. Definition at line 157 of file SmallString.h.
|
inline |
Search for the last string Str
in the string.
Str
, or npos if not found. Definition at line 165 of file SmallString.h.
|
inline |
Return a reference to the substring from [Start, End).
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. |
End | The index following the last character to include in the substring. If this is npos, or less than Start , or exceeds the number of characters remaining in the string, the string suffix (starting with Start ) will be returned. |
Definition at line 254 of file SmallString.h.
|
inline |
startswith - Check if this string starts with the given Prefix
.
Definition at line 124 of file SmallString.h.
|
inline |
Explicit conversion to StringRef.
Definition at line 261 of file SmallString.h.
Referenced by llvm::appendArchToWindowsSDKLibPath(), llvm::SmallString< 256 >::compare(), llvm::SmallString< 256 >::compare_insensitive(), llvm::SmallString< 256 >::compare_numeric(), llvm::computeArchiveRelativePath(), llvm::SmallString< 256 >::count(), llvm::createCFAOffset(), createDefCFAExpression(), emitComments(), llvm::MCStreamer::emitIntValue(), llvm::SmallString< 256 >::endswith(), llvm::SmallString< 256 >::equals(), llvm::SmallString< 256 >::equals_insensitive(), ExpandBasePaths(), llvm::SmallString< 256 >::find(), llvm::SmallString< 256 >::find_first_not_of(), llvm::SmallString< 256 >::find_first_of(), llvm::SmallString< 256 >::find_last_of(), llvm::sys::Process::FindInEnvPath(), llvm::findVCToolChainViaCommandLine(), llvm::findVCToolChainViaRegistry(), llvm::findVCToolChainViaSetupConfig(), getDefaultOutputPath(), llvm::MCCVDefRangeFragment::getFixedSizePortion(), llvm::object::Archive::Child::getFullName(), llvm::ModuleSummaryIndex::getGlobalNameForLocal(), llvm::ExecutionEngine::getMangledName(), llvm::OpenMPIRBuilder::getOrCreateSrcLocStr(), llvm::lto::getThinLTOOutputFile(), getWindowsSDKDirViaCommandLine(), llvm::HTTPRequest::HTTPRequest(), llvm::localCache(), llvm::LockFileManager::LockFileManager(), llvm::SmallString< 256 >::operator StringRef(), printSymbolizedStackTrace(), llvm::cl::ExpansionContext::readConfigFile(), llvm::sys::fs::directory_entry::replace_filename(), llvm::SmallString< 256 >::rfind(), llvm::vfs::RedirectingFileSystem::setCurrentWorkingDirectory(), llvm::VFABI::setVectorVariantNames(), solveTypeName(), llvm::SmallString< 256 >::startswith(), llvm::SmallString< 256 >::substr(), llvm::cl::TokenizeGNUCommandLine(), and tokenizeWindowsCommandLineImpl().
|
inline |
Return a reference to the substring from [Start, Start + N).
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. |
N | The number of characters to included in the substring. If N exceeds the number of characters remaining in the string, the string suffix (starting with Start ) will be returned. |
Definition at line 240 of file SmallString.h.