Go to the documentation of this file.
9 #ifndef LLDB_DATAFORMATTERS_FORMATTERSCONTAINER_H
10 #define LLDB_DATAFORMATTERS_FORMATTERSCONTAINER_H
64 while (type_lexer.
NextIf({
' ',
'\t',
'\v',
'\f'}).first)
109 typedef typename std::shared_ptr<ValueType>
ValueSP;
110 typedef std::vector<std::pair<TypeMatcher, ValueSP>>
MapType;
113 typedef typename std::shared_ptr<FormattersContainer<ValueType>>
124 entry->GetRevision() = 0;
126 std::lock_guard<std::recursive_mutex> guard(
m_map_mutex);
128 m_map.emplace_back(std::move(matcher), std::move(entry));
134 std::lock_guard<std::recursive_mutex> guard(
m_map_mutex);
135 for (
auto iter =
m_map.begin(); iter !=
m_map.end(); ++iter)
136 if (iter->first.CreatedBySameMatchString(matcher)) {
146 std::lock_guard<std::recursive_mutex> guard(
m_map_mutex);
147 for (
auto &formatter : llvm::reverse(
m_map)) {
148 if (formatter.first.Matches(type)) {
149 entry = formatter.second;
157 std::lock_guard<std::recursive_mutex> guard(
m_map_mutex);
158 for (
const auto &pos :
m_map)
159 if (pos.first.CreatedBySameMatchString(matcher)) {
167 std::lock_guard<std::recursive_mutex> guard(
m_map_mutex);
168 if (index >=
m_map.size())
170 return m_map[index].second;
174 std::lock_guard<std::recursive_mutex> guard(
m_map_mutex);
175 if (index >=
m_map.size())
176 return lldb::TypeNameSpecifierImplSP();
178 return std::make_shared<TypeNameSpecifierImpl>(
183 std::lock_guard<std::recursive_mutex> guard(
m_map_mutex);
191 std::lock_guard<std::recursive_mutex> guard(
m_map_mutex);
192 for (
const auto &pos :
m_map) {
194 if (!callback(type, pos.second))
201 std::lock_guard<std::recursive_mutex> guard(
m_map_mutex);
218 if (
Get(candidate.GetTypeName(), entry)) {
219 if (candidate.IsMatch(entry) ==
false) {
237 #endif // LLDB_DATAFORMATTERS_FORMATTERSCONTAINER_H
static ConstString StripTypeName(ConstString type)
Class for matching type names.
void TryCompleteCurrentArg(llvm::StringRef completion, llvm::StringRef description="")
Adds a possible completion string if the completion would complete the current argument.
RegularExpression m_type_name_regex
TypeMatcher(RegularExpression regex)
Creates a matcher that accepts any type matching the given regex.
const char * AsCString(const char *value_if_empty=nullptr) const
Get the string value as a C string.
TypeMatcher(ConstString type_name)
Creates a matcher that accepts any type with exactly the given type name.
llvm::StringRef GetStringRef() const
Get the string value as a llvm::StringRef.
bool IsEmpty() const
Test for empty string.
std::vector< FormattersMatchCandidate > FormattersMatchVector
string(SUBSTRING ${p} 10 -1 pStripped) if($
bool AdvanceIf(const std::string &token)
A class that represents a running process on the host machine.
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.
bool CreatedBySameMatchString(TypeMatcher other) const
Returns true if this TypeMatcher and the given one were most created by the same match string.
ConstString GetMatchString() const
Returns the underlying match string for this TypeMatcher.
bool m_is_regex
False if m_type_name_regex should be used for matching.
bool Matches(ConstString type_name) const
True iff this matches the given type name.