LLVM API Documentation

Public Member Functions
llvm::SmallString< InternalLen > Class Template Reference

#include <SmallString.h>

Inheritance diagram for llvm::SmallString< InternalLen >:
Inheritance graph
[legend]
Collaboration diagram for llvm::SmallString< InternalLen >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 SmallString ()
 Default ctor - Initialize to empty.
 SmallString (StringRef S)
 Initialize from a StringRef.
template<typename ItTy >
 SmallString (ItTy S, ItTy E)
 Initialize with a range.
 SmallString (const SmallString &RHS)
 Copy ctor.
String Assignment
void assign (size_t NumElts, char Elt)
 Assign from a repeated element.
template<typename in_iter >
void assign (in_iter S, in_iter E)
 Assign from an iterator pair.
void assign (StringRef RHS)
 Assign from a StringRef.
void assign (const SmallVectorImpl< char > &RHS)
 Assign from a SmallVector.
String Concatenation
template<typename in_iter >
void append (in_iter S, in_iter E)
 Append from an iterator pair.
void append (size_t NumInputs, char Elt)
void append (StringRef RHS)
 Append from a StringRef.
void append (const SmallVectorImpl< char > &RHS)
 Append from a SmallVector.
String Comparison
bool equals (StringRef RHS) const
bool equals_lower (StringRef RHS) const
 Check for string equality, ignoring case.
int compare (StringRef RHS) const
int compare_lower (StringRef RHS) const
 compare_lower - Compare two strings, ignoring case.
int compare_numeric (StringRef RHS) const
String Predicates
bool startswith (StringRef Prefix) const
 startswith - Check if this string starts with the given Prefix.
bool endswith (StringRef Suffix) const
 endswith - Check if this string ends with the given Suffix.
String Searching
size_t find (char C, size_t From=0) const
size_t find (StringRef Str, size_t From=0) const
size_t rfind (char C, size_t From=StringRef::npos) const
size_t rfind (StringRef Str) const
size_t find_first_of (char C, size_t From=0) const
size_t find_first_of (StringRef Chars, size_t From=0) const
size_t find_first_not_of (char C, size_t From=0) const
size_t find_first_not_of (StringRef Chars, size_t From=0) const
size_t find_last_of (char C, size_t From=StringRef::npos) const
size_t find_last_of (StringRef Chars, size_t From=StringRef::npos) const
Helpful Algorithms
size_t count (char C) const
 Return the number of occurrences of C in the string.
size_t count (StringRef Str) const
Substring Operations
StringRef substr (size_t Start, size_t N=StringRef::npos) const
StringRef slice (size_t Start, size_t End) const
StringRef str () const
 Explicit conversion to StringRef.
const char * c_str ()
 operator StringRef () const
 Implicit conversion to StringRef.
const SmallStringoperator= (StringRef RHS)
SmallStringoperator+= (StringRef RHS)
SmallStringoperator+= (char C)

Detailed Description

template<unsigned InternalLen>
class llvm::SmallString< InternalLen >

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 25 of file SmallString.h.


Constructor & Destructor Documentation

template<unsigned InternalLen>
llvm::SmallString< InternalLen >::SmallString ( ) [inline]

Default ctor - Initialize to empty.

Definition at line 28 of file SmallString.h.

template<unsigned InternalLen>
llvm::SmallString< InternalLen >::SmallString ( StringRef  S) [inline]

Initialize from a StringRef.

Definition at line 31 of file SmallString.h.

template<unsigned InternalLen>
template<typename ItTy >
llvm::SmallString< InternalLen >::SmallString ( ItTy  S,
ItTy  E 
) [inline]

Initialize with a range.

Definition at line 35 of file SmallString.h.

template<unsigned InternalLen>
llvm::SmallString< InternalLen >::SmallString ( const SmallString< InternalLen > &  RHS) [inline]

Copy ctor.

Definition at line 38 of file SmallString.h.


Member Function Documentation

template<unsigned InternalLen>
template<typename in_iter >
void llvm::SmallString< InternalLen >::append ( in_iter  S,
in_iter  E 
) [inline]
template<unsigned InternalLen>
void llvm::SmallString< InternalLen >::append ( size_t  NumInputs,
char  Elt 
) [inline]

Definition at line 81 of file SmallString.h.

template<unsigned InternalLen>
void llvm::SmallString< InternalLen >::append ( StringRef  RHS) [inline]

Append from a StringRef.

Definition at line 87 of file SmallString.h.

template<unsigned InternalLen>
void llvm::SmallString< InternalLen >::append ( const SmallVectorImpl< char > &  RHS) [inline]

Append from a SmallVector.

Definition at line 92 of file SmallString.h.

template<unsigned InternalLen>
void llvm::SmallString< InternalLen >::assign ( size_t  NumElts,
char  Elt 
) [inline]

Assign from a repeated element.

Definition at line 48 of file SmallString.h.

Referenced by llvm::SmallString< 256 >::assign().

template<unsigned InternalLen>
template<typename in_iter >
void llvm::SmallString< InternalLen >::assign ( in_iter  S,
in_iter  E 
) [inline]

Assign from an iterator pair.

Definition at line 54 of file SmallString.h.

template<unsigned InternalLen>
void llvm::SmallString< InternalLen >::assign ( StringRef  RHS) [inline]

Assign from a StringRef.

Definition at line 60 of file SmallString.h.

template<unsigned InternalLen>
void llvm::SmallString< InternalLen >::assign ( const SmallVectorImpl< char > &  RHS) [inline]

Assign from a SmallVector.

Definition at line 66 of file SmallString.h.

template<unsigned InternalLen>
const char* llvm::SmallString< InternalLen >::c_str ( ) [inline]
template<unsigned InternalLen>
int llvm::SmallString< InternalLen >::compare ( StringRef  RHS) const [inline]

Compare two strings; the result is -1, 0, or 1 if this string is lexicographically less than, equal to, or greater than the RHS.

Definition at line 113 of file SmallString.h.

template<unsigned InternalLen>
int llvm::SmallString< InternalLen >::compare_lower ( StringRef  RHS) const [inline]

compare_lower - Compare two strings, ignoring case.

Definition at line 118 of file SmallString.h.

template<unsigned InternalLen>
int llvm::SmallString< InternalLen >::compare_numeric ( StringRef  RHS) const [inline]

compare_numeric - Compare two strings, treating sequences of digits as numbers.

Definition at line 124 of file SmallString.h.

template<unsigned InternalLen>
size_t llvm::SmallString< InternalLen >::count ( char  C) const [inline]

Return the number of occurrences of C in the string.

Definition at line 226 of file SmallString.h.

template<unsigned InternalLen>
size_t llvm::SmallString< InternalLen >::count ( StringRef  Str) const [inline]

Return the number of non-overlapped occurrences of Str in the string.

Definition at line 232 of file SmallString.h.

template<unsigned InternalLen>
bool llvm::SmallString< InternalLen >::endswith ( StringRef  Suffix) const [inline]

endswith - Check if this string ends with the given Suffix.

Definition at line 138 of file SmallString.h.

template<unsigned InternalLen>
bool llvm::SmallString< InternalLen >::equals ( StringRef  RHS) const [inline]

Check for string equality. This is more efficient than compare() when the relative ordering of inequal strings isn't needed.

Definition at line 102 of file SmallString.h.

Referenced by llvm::DILineInfo::operator==().

template<unsigned InternalLen>
bool llvm::SmallString< InternalLen >::equals_lower ( StringRef  RHS) const [inline]

Check for string equality, ignoring case.

Definition at line 107 of file SmallString.h.

template<unsigned InternalLen>
size_t llvm::SmallString< InternalLen >::find ( char  C,
size_t  From = 0 
) const [inline]

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

Returns:
- The index of the first occurrence of C, or npos if not found.

Definition at line 150 of file SmallString.h.

template<unsigned InternalLen>
size_t llvm::SmallString< InternalLen >::find ( StringRef  Str,
size_t  From = 0 
) const [inline]

Search for the first string Str in the string.

Returns:
The index of the first occurrence of Str, or npos if not found.

Definition at line 158 of file SmallString.h.

template<unsigned InternalLen>
size_t llvm::SmallString< InternalLen >::find_first_not_of ( char  C,
size_t  From = 0 
) const [inline]

Find the first character in the string that is not C or npos if not found.

Definition at line 194 of file SmallString.h.

template<unsigned InternalLen>
size_t llvm::SmallString< InternalLen >::find_first_not_of ( StringRef  Chars,
size_t  From = 0 
) const [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 202 of file SmallString.h.

template<unsigned InternalLen>
size_t llvm::SmallString< InternalLen >::find_first_of ( char  C,
size_t  From = 0 
) const [inline]

Find the first character in the string that is C, or npos if not found. Same as find.

Definition at line 180 of file SmallString.h.

template<unsigned InternalLen>
size_t llvm::SmallString< InternalLen >::find_first_of ( StringRef  Chars,
size_t  From = 0 
) const [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 188 of file SmallString.h.

template<unsigned InternalLen>
size_t llvm::SmallString< InternalLen >::find_last_of ( char  C,
size_t  From = StringRef::npos 
) const [inline]

Find the last character in the string that is C, or npos if not found.

Definition at line 208 of file SmallString.h.

template<unsigned InternalLen>
size_t llvm::SmallString< InternalLen >::find_last_of ( StringRef  Chars,
size_t  From = StringRef::npos 
) const [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 216 of file SmallString.h.

template<unsigned InternalLen>
llvm::SmallString< InternalLen >::operator StringRef ( ) const [inline]

Implicit conversion to StringRef.

Definition at line 280 of file SmallString.h.

template<unsigned InternalLen>
SmallString& llvm::SmallString< InternalLen >::operator+= ( StringRef  RHS) [inline]

Definition at line 288 of file SmallString.h.

template<unsigned InternalLen>
SmallString& llvm::SmallString< InternalLen >::operator+= ( char  C) [inline]

Definition at line 292 of file SmallString.h.

template<unsigned InternalLen>
const SmallString& llvm::SmallString< InternalLen >::operator= ( StringRef  RHS) [inline]

Definition at line 283 of file SmallString.h.

template<unsigned InternalLen>
size_t llvm::SmallString< InternalLen >::rfind ( char  C,
size_t  From = StringRef::npos 
) const [inline]

Search for the last character C in the string.

Returns:
The index of the last occurrence of C, or npos if not found.

Definition at line 166 of file SmallString.h.

template<unsigned InternalLen>
size_t llvm::SmallString< InternalLen >::rfind ( StringRef  Str) const [inline]

Search for the last string Str in the string.

Returns:
The index of the last occurrence of Str, or npos if not found.

Definition at line 174 of file SmallString.h.

template<unsigned InternalLen>
StringRef llvm::SmallString< InternalLen >::slice ( size_t  Start,
size_t  End 
) const [inline]

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

Parameters:
StartThe 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.
EndThe 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 263 of file SmallString.h.

template<unsigned InternalLen>
bool llvm::SmallString< InternalLen >::startswith ( StringRef  Prefix) const [inline]

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

Definition at line 133 of file SmallString.h.

Referenced by GetSymbolFromOperand().

template<unsigned InternalLen>
StringRef llvm::SmallString< InternalLen >::str ( ) const [inline]

Explicit conversion to StringRef.

Definition at line 270 of file SmallString.h.

Referenced by llvm::SmallString< 256 >::compare(), llvm::SmallString< 256 >::compare_lower(), llvm::SmallString< 256 >::compare_numeric(), llvm::SmallString< 256 >::count(), CrashHandler(), llvm::APInt::dump(), llvm::MCStreamer::EmitRawText(), llvm::SmallString< 256 >::endswith(), llvm::SmallString< 256 >::equals(), llvm::SmallString< 256 >::equals_lower(), llvm::SmallString< 256 >::find(), llvm::SmallString< 256 >::find_first_not_of(), llvm::SmallString< 256 >::find_first_of(), llvm::SmallString< 256 >::find_last_of(), llvm::MBlazeMCInstLower::GetConstantPoolIndexSymbol(), llvm::MSP430MCInstLower::GetConstantPoolIndexSymbol(), llvm::AsmPrinter::GetExternalSymbolSymbol(), llvm::DWARFDebugLine::LineTable::getFileNameByIndex(), getFileNameForCompileUnit(), llvm::getFnSpecificMDNode(), llvm::jitprofiling::FilenameCache::getFullPath(), llvm::MachineFunction::getJTISymbol(), llvm::MBlazeMCInstLower::GetJumpTableSymbol(), llvm::MSP430MCInstLower::GetJumpTableSymbol(), llvm::MCContext::getMachOSection(), llvm::MCContext::GetOrCreateSymbol(), llvm::getOrInsertFnSpecificMDNode(), llvm::Mangler::getSymbol(), GetSymbolFromOperand(), llvm::AsmPrinter::GetSymbolWithGlobalValueBase(), LLVMDisasmInstruction(), llvm::LockFileManager::LockFileManager(), llvm::MCContext::LookupSymbol(), llvm::opt::ArgList::MakeArgString(), llvm::SmallString< 256 >::operator StringRef(), llvm::APInt::print(), llvm::SmallString< 256 >::rfind(), llvm::TargetLoweringObjectFileELF::SelectSectionForGlobal(), llvm::TargetLoweringObjectFileCOFF::SelectSectionForGlobal(), llvm::Triple::setArchName(), llvm::FileRemover::setFile(), llvm::SmallString< 256 >::slice(), llvm::SmallString< 256 >::startswith(), llvm::SmallString< 256 >::substr(), llvm::APInt::toString(), llvm::LockFileManager::waitForUnlock(), llvm::WriteConstantInternal(), writeFragment(), llvm::FileRemover::~FileRemover(), and llvm::LockFileManager::~LockFileManager().

template<unsigned InternalLen>
StringRef llvm::SmallString< InternalLen >::substr ( size_t  Start,
size_t  N = StringRef::npos 
) const [inline]

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

Parameters:
StartThe 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.
NThe 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 249 of file SmallString.h.


The documentation for this class was generated from the following file: