LLDB mainline
CommandObjectRegexCommand.h
Go to the documentation of this file.
1//===-- CommandObjectRegexCommand.h -----------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLDB_INTERPRETER_COMMANDOBJECTREGEXCOMMAND_H
10#define LLDB_INTERPRETER_COMMANDOBJECTREGEXCOMMAND_H
11
12#include <list>
13
17
18namespace lldb_private {
19
20// CommandObjectRegexCommand
21
23public:
25 llvm::StringRef name, llvm::StringRef help,
26 llvm::StringRef syntax,
27 uint32_t completion_type_mask, bool is_removable);
28
30
31 bool IsRemovable() const override { return m_is_removable; }
32
33 bool AddRegexCommand(llvm::StringRef re_cstr, llvm::StringRef command_cstr);
34
35 bool HasRegexEntries() const { return !m_entries.empty(); }
36
37 void HandleCompletion(CompletionRequest &request) override;
38
39protected:
40 void DoExecute(llvm::StringRef command, CommandReturnObject &result) override;
41
42 /// Substitute variables of the format %\d+ in the input string.
43 static llvm::Expected<std::string> SubstituteVariables(
44 llvm::StringRef input,
45 const llvm::SmallVectorImpl<llvm::StringRef> &replacements);
46
47 struct Entry {
49 std::string command;
50 };
51
52 typedef std::list<Entry> EntryCollection;
53 const uint32_t m_completion_type_mask;
56
57private:
61};
62
63} // namespace lldb_private
64
65#endif // LLDB_INTERPRETER_COMMANDOBJECTREGEXCOMMAND_H
const CommandObjectRegexCommand & operator=(const CommandObjectRegexCommand &)=delete
static llvm::Expected< std::string > SubstituteVariables(llvm::StringRef input, const llvm::SmallVectorImpl< llvm::StringRef > &replacements)
Substitute variables of the format %\d+ in the input string.
void HandleCompletion(CompletionRequest &request) override
This default version handles calling option argument completions and then calls HandleArgumentComplet...
CommandObjectRegexCommand(const CommandObjectRegexCommand &)=delete
void DoExecute(llvm::StringRef command, CommandReturnObject &result) override
bool AddRegexCommand(llvm::StringRef re_cstr, llvm::StringRef command_cstr)
"lldb/Utility/ArgCompletionRequest.h"
A class that represents a running process on the host machine.
Definition: SBAttachInfo.h:14