1 //===-- BreakpointIDList.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_BreakpointIDList_h_
11 #define liblldb_BreakpointIDList_h_
18 // Other libraries and framework includes
21 #include "lldb/Breakpoint/BreakpointID.h"
22 #include "lldb/lldb-private.h"
24 namespace lldb_private {
26 //----------------------------------------------------------------------
27 // class BreakpointIDList
28 //----------------------------------------------------------------------
30 class BreakpointIDList {
32 // TODO: Convert this class to StringRef.
33 typedef std::vector<BreakpointID> BreakpointIDArray;
37 virtual ~BreakpointIDList();
39 size_t GetSize() const;
41 const BreakpointID &GetBreakpointIDAtIndex(size_t index) const;
43 bool RemoveBreakpointIDAtIndex(size_t index);
47 bool AddBreakpointID(BreakpointID bp_id);
49 bool AddBreakpointID(const char *bp_id);
51 // TODO: This should take a const BreakpointID.
52 bool FindBreakpointID(BreakpointID &bp_id, size_t *position) const;
54 bool FindBreakpointID(const char *bp_id, size_t *position) const;
56 void InsertStringArray(const char **string_array, size_t array_size,
57 CommandReturnObject &result);
59 // Returns a pair consisting of the beginning and end of a breakpoint
60 // ID range expression. If the input string is not a valid specification,
61 // returns an empty pair.
62 static std::pair<llvm::StringRef, llvm::StringRef>
63 SplitIDRangeExpression(llvm::StringRef in_string);
65 static void FindAndReplaceIDRanges(Args &old_args, Target *target,
67 CommandReturnObject &result,
71 BreakpointIDArray m_breakpoint_ids;
72 BreakpointID m_invalid_id;
74 DISALLOW_COPY_AND_ASSIGN(BreakpointIDList);
77 } // namespace lldb_private
79 #endif // liblldb_BreakpointIDList_h_