1 //===-- CommandObjectRegexCommand.h -----------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_CommandObjectRegexCommand_h_
11 #define liblldb_CommandObjectRegexCommand_h_
17 // Other libraries and framework includes
19 #include "lldb/Interpreter/CommandObject.h"
20 #include "lldb/Utility/RegularExpression.h"
22 namespace lldb_private {
24 //-------------------------------------------------------------------------
25 // CommandObjectRegexCommand
26 //-------------------------------------------------------------------------
28 class CommandObjectRegexCommand : public CommandObjectRaw {
30 CommandObjectRegexCommand(CommandInterpreter &interpreter, llvm::StringRef name,
31 llvm::StringRef help, llvm::StringRef syntax,
32 uint32_t max_matches, uint32_t completion_type_mask,
35 ~CommandObjectRegexCommand() override;
37 bool IsRemovable() const override { return m_is_removable; }
39 bool AddRegexCommand(const char *re_cstr, const char *command_cstr);
41 bool HasRegexEntries() const { return !m_entries.empty(); }
43 int HandleCompletion(Args &input, int &cursor_index,
44 int &cursor_char_position, int match_start_point,
45 int max_return_elements, bool &word_complete,
46 StringList &matches) override;
49 bool DoExecute(const char *command, CommandReturnObject &result) override;
52 RegularExpression regex;
56 typedef std::list<Entry> EntryCollection;
57 const uint32_t m_max_matches;
58 const uint32_t m_completion_type_mask;
59 EntryCollection m_entries;
63 DISALLOW_COPY_AND_ASSIGN(CommandObjectRegexCommand);
66 } // namespace lldb_private
68 #endif // liblldb_CommandObjectRegexCommand_h_