9#ifndef LLDB_DATAFORMATTERS_FORMATTERSCONTAINER_H
10#define LLDB_DATAFORMATTERS_FORMATTERSCONTAINER_H
70 while (type_lexer.
NextIf({
' ',
'\t',
'\v',
'\f'}).first)
99 return m_name == type_name ||
112 std::make_shared<TypeImpl>(candidate_type.
GetType()));
143 typedef typename std::shared_ptr<ValueType>
ValueSP;
144 typedef std::vector<std::pair<TypeMatcher, ValueSP>>
MapType;
147 typedef typename std::shared_ptr<FormattersContainer<ValueType>>
158 entry->GetRevision() = 0;
160 std::lock_guard<std::recursive_mutex> guard(
m_map_mutex);
162 m_map.emplace_back(std::move(matcher), std::move(entry));
168 std::lock_guard<std::recursive_mutex> guard(
m_map_mutex);
169 for (
auto iter =
m_map.begin(); iter !=
m_map.end(); ++iter)
170 if (iter->first.CreatedBySameMatchString(matcher)) {
181 std::lock_guard<std::recursive_mutex> guard(
m_map_mutex);
182 for (
auto &formatter : llvm::reverse(
m_map)) {
183 if (formatter.first.Matches(candidate)) {
184 entry = formatter.second;
195 if (
Get(candidate, entry)) {
196 if (candidate.IsMatch(entry) ==
false) {
208 std::lock_guard<std::recursive_mutex> guard(
m_map_mutex);
209 for (
const auto &pos :
m_map)
210 if (pos.first.CreatedBySameMatchString(matcher)) {
218 std::lock_guard<std::recursive_mutex> guard(
m_map_mutex);
219 if (index >=
m_map.size())
221 return m_map[index].second;
225 std::lock_guard<std::recursive_mutex> guard(
m_map_mutex);
226 if (index >=
m_map.size())
229 return std::make_shared<TypeNameSpecifierImpl>(
235 std::lock_guard<std::recursive_mutex> guard(
m_map_mutex);
243 std::lock_guard<std::recursive_mutex> guard(
m_map_mutex);
244 for (
const auto &pos :
m_map) {
246 if (!callback(type, pos.second))
253 std::lock_guard<std::recursive_mutex> guard(
m_map_mutex);
static llvm::StringRef GetName(XcodeSDK::Type type)
"lldb/Utility/ArgCompletionRequest.h"
void TryCompleteCurrentArg(llvm::StringRef completion, llvm::StringRef description="")
Adds a possible completion string if the completion would complete the current argument.
A uniqued constant string class.
const char * AsCString(const char *value_if_empty=nullptr) const
Get the string value as a C string.
bool IsEmpty() const
Test for empty string.
llvm::StringRef GetStringRef() const
Get the string value as a llvm::StringRef.
bool Execute(llvm::StringRef string, llvm::SmallVectorImpl< llvm::StringRef > *matches=nullptr) const
Execute a regular expression match using the compiled regular expression that is already in this obje...
llvm::StringRef GetText() const
Access the regular expression text.
virtual bool FormatterCallbackFunction(const char *function_name, lldb::TypeImplSP type_impl_sp)
bool AdvanceIf(const std::string &token)
Class for matching type names.
ConstString GetMatchString() const
Returns the underlying match string for this TypeMatcher.
TypeMatcher(lldb::TypeNameSpecifierImplSP type_specifier)
Creates a matcher using the matching type and string from the given type name specifier.
TypeMatcher(ConstString type_name)
Creates a matcher that accepts any type with exactly the given type name.
lldb::FormatterMatchType m_match_type
Indicates what kind of matching strategy should be used:
RegularExpression m_type_name_regex
lldb::FormatterMatchType GetMatchType() const
static ConstString StripTypeName(ConstString type)
bool CreatedBySameMatchString(TypeMatcher other) const
Returns true if this TypeMatcher and the given one were most created by the same match string.
TypeMatcher(RegularExpression regex)
Creates a matcher that accepts any type matching the given regex.
ConstString m_name
Type name for exact match, or name of the python callback if m_match_type is eFormatterMatchCallback.
bool Matches(FormattersMatchCandidate candidate_type) const
True iff this matches the given type.
A class that represents a running process on the host machine.
std::vector< FormattersMatchCandidate > FormattersMatchVector
std::shared_ptr< lldb_private::TypeNameSpecifierImpl > TypeNameSpecifierImplSP
FormatterMatchType
Type of match to be performed when looking for a formatter for a data type.
@ eFormatterMatchCallback