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/Core/RegularExpression.h"
20 #include "lldb/Interpreter/CommandObject.h"
22 namespace lldb_private {
24 //-------------------------------------------------------------------------
25 // CommandObjectRegexCommand
26 //-------------------------------------------------------------------------
28 class CommandObjectRegexCommand : public CommandObjectRaw
31 CommandObjectRegexCommand (CommandInterpreter &interpreter,
36 uint32_t completion_type_mask,
39 ~CommandObjectRegexCommand() override;
42 IsRemovable () const override { return m_is_removable; }
45 AddRegexCommand (const char *re_cstr, const char *command_cstr);
48 HasRegexEntries () const
50 return !m_entries.empty();
54 HandleCompletion (Args &input,
56 int &cursor_char_position,
57 int match_start_point,
58 int max_return_elements,
60 StringList &matches) override;
64 DoExecute (const char *command, CommandReturnObject &result) override;
68 RegularExpression regex;
72 typedef std::list<Entry> EntryCollection;
73 const uint32_t m_max_matches;
74 const uint32_t m_completion_type_mask;
75 EntryCollection m_entries;
79 DISALLOW_COPY_AND_ASSIGN (CommandObjectRegexCommand);
82 } // namespace lldb_private
84 #endif // liblldb_CommandObjectRegexCommand_h_