LLDB  mainline
Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
lldb_private::TypeMatcher Class Reference

Class for matching type names. More...

#include <FormattersContainer.h>

Collaboration diagram for lldb_private::TypeMatcher:
Collaboration graph
[legend]

Public Member Functions

 TypeMatcher ()=delete
 
 TypeMatcher (ConstString type_name)
 Creates a matcher that accepts any type with exactly the given type name. More...
 
 TypeMatcher (RegularExpression regex)
 Creates a matcher that accepts any type matching the given regex. More...
 
bool Matches (ConstString type_name) const
 True iff this matches the given type name. More...
 
ConstString GetMatchString () const
 Returns the underlying match string for this TypeMatcher. More...
 
bool CreatedBySameMatchString (TypeMatcher other) const
 Returns true if this TypeMatcher and the given one were most created by the same match string. More...
 

Static Private Member Functions

static ConstString StripTypeName (ConstString type)
 

Private Attributes

RegularExpression m_type_name_regex
 
ConstString m_type_name
 
bool m_is_regex
 False if m_type_name_regex should be used for matching. More...
 

Detailed Description

Class for matching type names.

Definition at line 41 of file FormattersContainer.h.

Constructor & Destructor Documentation

◆ TypeMatcher() [1/3]

lldb_private::TypeMatcher::TypeMatcher ( )
delete

◆ TypeMatcher() [2/3]

lldb_private::TypeMatcher::TypeMatcher ( ConstString  type_name)
inline

Creates a matcher that accepts any type with exactly the given type name.

Definition at line 73 of file FormattersContainer.h.

◆ TypeMatcher() [3/3]

lldb_private::TypeMatcher::TypeMatcher ( RegularExpression  regex)
inline

Creates a matcher that accepts any type matching the given regex.

Definition at line 76 of file FormattersContainer.h.

Member Function Documentation

◆ CreatedBySameMatchString()

bool lldb_private::TypeMatcher::CreatedBySameMatchString ( TypeMatcher  other) const
inline

Returns true if this TypeMatcher and the given one were most created by the same match string.

The main purpose of this function is to find existing TypeMatcher instances by the user input that created them. This is necessary as LLDB allows referencing existing TypeMatchers in commands by the user input that originally created them: (lldb) type summary add –summary-string "A" -x TypeName (lldb) type summary delete TypeName

Definition at line 102 of file FormattersContainer.h.

References GetMatchString().

Referenced by CommandObjectTypeFormatterList< TypeFormatImpl >::DoExecute().

◆ GetMatchString()

ConstString lldb_private::TypeMatcher::GetMatchString ( ) const
inline

◆ Matches()

bool lldb_private::TypeMatcher::Matches ( ConstString  type_name) const
inline

◆ StripTypeName()

static ConstString lldb_private::TypeMatcher::StripTypeName ( ConstString  type)
inlinestaticprivate

Member Data Documentation

◆ m_is_regex

bool lldb_private::TypeMatcher::m_is_regex
private

False if m_type_name_regex should be used for matching.

False if this is just matching by comparing with m_type_name string.

Definition at line 46 of file FormattersContainer.h.

Referenced by GetMatchString(), and Matches().

◆ m_type_name

ConstString lldb_private::TypeMatcher::m_type_name
private

Definition at line 43 of file FormattersContainer.h.

Referenced by GetMatchString(), and Matches().

◆ m_type_name_regex

RegularExpression lldb_private::TypeMatcher::m_type_name_regex
private

Definition at line 42 of file FormattersContainer.h.

Referenced by GetMatchString(), and Matches().


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