LLVM  7.0.0
Public Member Functions | Static Public Attributes | List of all members
StringView Class Reference

#include "Demangle/StringView.h"

Collaboration diagram for StringView:
[legend]

Public Member Functions

template<size_t N>
 StringView (const char(&Str)[N])
 
 StringView (const char *First_, const char *Last_)
 
 StringView (const char *First_, size_t Len)
 
 StringView (const char *Str)
 
 StringView ()
 
StringView substr (size_t From) const
 
size_t find (char C, size_t From=0) const
 
StringView substr (size_t From, size_t To) const
 
StringView dropFront (size_t N=1) const
 
StringView dropBack (size_t N=1) const
 
char front () const
 
char back () const
 
char popFront ()
 
bool consumeFront (char C)
 
bool consumeFront (StringView S)
 
bool startsWith (char C) const
 
bool startsWith (StringView Str) const
 
const char & operator[] (size_t Idx) const
 
const char * begin () const
 
const char * end () const
 
size_t size () const
 
bool empty () const
 

Static Public Attributes

static const size_t npos = ~size_t(0)
 

Detailed Description

Definition at line 20 of file StringView.h.

Constructor & Destructor Documentation

◆ StringView() [1/5]

template<size_t N>
StringView::StringView ( const char(&)  Str[N])
inline

Definition at line 28 of file StringView.h.

◆ StringView() [2/5]

StringView::StringView ( const char *  First_,
const char *  Last_ 
)
inline

Definition at line 29 of file StringView.h.

◆ StringView() [3/5]

StringView::StringView ( const char *  First_,
size_t  Len 
)
inline

Definition at line 31 of file StringView.h.

◆ StringView() [4/5]

StringView::StringView ( const char *  Str)
inline

Definition at line 33 of file StringView.h.

◆ StringView() [5/5]

StringView::StringView ( )
inline

Definition at line 34 of file StringView.h.

Referenced by dropBack(), dropFront(), and substr().

Member Function Documentation

◆ back()

char StringView::back ( ) const
inline

Definition at line 76 of file StringView.h.

References assert(), empty(), and end().

◆ begin()

const char* StringView::begin ( ) const
inline

◆ consumeFront() [1/2]

bool StringView::consumeFront ( char  C)
inline

◆ consumeFront() [2/2]

bool StringView::consumeFront ( StringView  S)
inline

Definition at line 93 of file StringView.h.

References dropFront(), size(), and startsWith().

◆ dropBack()

StringView StringView::dropBack ( size_t  N = 1) const
inline

Definition at line 65 of file StringView.h.

References N, size(), and StringView().

◆ dropFront()

StringView StringView::dropFront ( size_t  N = 1) const
inline

Definition at line 59 of file StringView.h.

References N, size(), and StringView().

Referenced by consumeFront(), demanglePointerCVQualifiers(), and outputName().

◆ empty()

bool StringView::empty ( ) const
inline

◆ end()

const char* StringView::end ( ) const
inline

Definition at line 111 of file StringView.h.

Referenced by back(), operator==(), and startsWith().

◆ find()

size_t StringView::find ( char  C,
size_t  From = 0 
) const
inline

Definition at line 40 of file StringView.h.

References npos, P, and size().

Referenced by outputName().

◆ front()

char StringView::front ( ) const
inline

◆ operator[]()

const char& StringView::operator[] ( size_t  Idx) const
inline

Definition at line 108 of file StringView.h.

References begin().

◆ popFront()

char StringView::popFront ( )
inline

Definition at line 81 of file StringView.h.

References assert(), and empty().

Referenced by demanglePointerCVQualifiers(), isFunctionType(), isMemberPointer(), and outputName().

◆ size()

size_t StringView::size ( ) const
inline

◆ startsWith() [1/2]

bool StringView::startsWith ( char  C) const
inline

Definition at line 100 of file StringView.h.

References begin(), C, and empty().

Referenced by consumeFront(), demanglePointerCVQualifiers(), isFunctionType(), isPointerType(), and outputName().

◆ startsWith() [2/2]

bool StringView::startsWith ( StringView  Str) const
inline

Definition at line 102 of file StringView.h.

References begin(), end(), llvm::lltok::equal, and size().

◆ substr() [1/2]

StringView StringView::substr ( size_t  From) const
inline

Definition at line 36 of file StringView.h.

References begin(), size(), and StringView().

Referenced by outputName().

◆ substr() [2/2]

StringView StringView::substr ( size_t  From,
size_t  To 
) const
inline

Definition at line 51 of file StringView.h.

References size(), and StringView().

Member Data Documentation

◆ npos

const size_t StringView::npos = ~size_t(0)
static

Definition at line 25 of file StringView.h.

Referenced by find(), and outputName().


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