BreakpointIDList.h revision 36da2aa6dc5ad9994b638ed09eb81c44cc05540b
1//===-- BreakpointIDList.h --------------------------------------*- C++ -*-===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef liblldb_BreakpointIDList_h_
11#define liblldb_BreakpointIDList_h_
12
13// C Includes
14// C++ Includes
15#include <vector>
16
17// Other libraries and framework includes
18// Project includes
19
20#include "lldb/lldb-private.h"
21#include "lldb/Breakpoint/BreakpointID.h"
22
23namespace lldb_private {
24
25//----------------------------------------------------------------------
26// class BreakpointIDList
27//----------------------------------------------------------------------
28
29
30class BreakpointIDList
31{
32public:
33    typedef std::vector<BreakpointID> BreakpointIDArray;
34
35    BreakpointIDList ();
36
37    virtual
38    ~BreakpointIDList ();
39
40    size_t
41    GetSize();
42
43    BreakpointID &
44    GetBreakpointIDAtIndex (size_t index);
45
46    bool
47    RemoveBreakpointIDAtIndex (size_t index);
48
49    void
50    Clear();
51
52    bool
53    AddBreakpointID (BreakpointID bp_id);
54
55    bool
56    AddBreakpointID (const char *bp_id);
57
58    bool
59    FindBreakpointID (BreakpointID &bp_id, size_t *position);
60
61    bool
62    FindBreakpointID (const char *bp_id, size_t *position);
63
64    void
65    InsertStringArray (const char **string_array, size_t array_size, CommandReturnObject &result);
66
67    static bool
68    StringContainsIDRangeExpression (const char *in_string, size_t *range_start_len, size_t *range_end_pos);
69
70    static void
71    FindAndReplaceIDRanges (Args &old_args, Target *target, CommandReturnObject &result, Args &new_args);
72
73private:
74    BreakpointIDArray m_breakpoint_ids;
75    BreakpointID m_invalid_id;
76
77    DISALLOW_COPY_AND_ASSIGN(BreakpointIDList);
78};
79
80} // namespace lldb_private
81
82#endif  // liblldb_BreakpointIDList_h_
83