LLDB mainline
|
Class for matching type names. More...
#include <FormattersContainer.h>
Public Member Functions | |
TypeMatcher ()=delete | |
TypeMatcher (ConstString type_name) | |
Creates a matcher that accepts any type with exactly the given type name. | |
TypeMatcher (RegularExpression regex) | |
Creates a matcher that accepts any type matching the given regex. | |
TypeMatcher (lldb::TypeNameSpecifierImplSP type_specifier) | |
Creates a matcher using the matching type and string from the given type name specifier. | |
bool | Matches (FormattersMatchCandidate candidate_type) const |
True iff this matches the given type. | |
lldb::FormatterMatchType | GetMatchType () const |
ConstString | GetMatchString () const |
Returns the underlying match string for this TypeMatcher. | |
bool | CreatedBySameMatchString (TypeMatcher other) const |
Returns true if this TypeMatcher and the given one were most created by the same match string. | |
Static Private Member Functions | |
static ConstString | StripTypeName (ConstString type) |
Private Attributes | |
ConstString | m_name |
Type name for exact match, or name of the python callback if m_match_type is eFormatterMatchCallback . | |
RegularExpression | m_type_name_regex |
lldb::FormatterMatchType | m_match_type |
Indicates what kind of matching strategy should be used: | |
Class for matching type names.
Definition at line 41 of file FormattersContainer.h.
|
delete |
|
inline |
Creates a matcher that accepts any type with exactly the given type name.
Definition at line 79 of file FormattersContainer.h.
|
inline |
Creates a matcher that accepts any type matching the given regex.
Definition at line 82 of file FormattersContainer.h.
|
inline |
Creates a matcher using the matching type and string from the given type name specifier.
Definition at line 87 of file FormattersContainer.h.
References lldb::eFormatterMatchRegex, m_match_type, and m_type_name_regex.
|
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 136 of file FormattersContainer.h.
References GetMatchString().
|
inline |
Returns the underlying match string for this TypeMatcher.
Definition at line 120 of file FormattersContainer.h.
References lldb::eFormatterMatchExact, lldb::eFormatterMatchRegex, lldb_private::RegularExpression::GetText(), m_match_type, m_name, m_type_name_regex, and StripTypeName().
Referenced by lldb_private::FormattersContainer< ValueType >::AutoComplete(), CommandObjectTypeCategoryDefine::CommandObjectTypeCategoryDefine(), CreatedBySameMatchString(), and lldb_private::FormattersContainer< ValueType >::GetTypeNameSpecifierAtIndex().
|
inline |
Definition at line 117 of file FormattersContainer.h.
References m_match_type.
Referenced by lldb_private::FormattersContainer< ValueType >::GetTypeNameSpecifierAtIndex().
|
inline |
True iff this matches the given type.
Definition at line 95 of file FormattersContainer.h.
References lldb_private::ConstString::AsCString(), lldb::eFormatterMatchCallback, lldb::eFormatterMatchExact, lldb::eFormatterMatchRegex, lldb_private::RegularExpression::Execute(), lldb_private::ScriptInterpreter::FormatterCallbackFunction(), lldb_private::FormattersMatchCandidate::GetScriptInterpreter(), lldb_private::ConstString::GetStringRef(), lldb_private::FormattersMatchCandidate::GetType(), lldb_private::FormattersMatchCandidate::GetTypeName(), m_match_type, m_name, m_type_name_regex, and StripTypeName().
|
inlinestaticprivate |
Definition at line 58 of file FormattersContainer.h.
References lldb_private::StringLexer::AdvanceIf(), lldb_private::ConstString::AsCString(), lldb_private::StringLexer::GetUnlexed(), lldb_private::ConstString::IsEmpty(), and lldb_private::StringLexer::NextIf().
Referenced by GetMatchString(), and Matches().
|
private |
Indicates what kind of matching strategy should be used:
m_type_name_regex
instead.Definition at line 52 of file FormattersContainer.h.
Referenced by GetMatchString(), GetMatchType(), Matches(), and TypeMatcher().
|
private |
Type name for exact match, or name of the python callback if m_match_type is eFormatterMatchCallback
.
Definition at line 44 of file FormattersContainer.h.
Referenced by GetMatchString(), and Matches().
|
private |
Definition at line 45 of file FormattersContainer.h.
Referenced by GetMatchString(), Matches(), and TypeMatcher().