1 //===-- VariableList.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_VariableList_h_
11 #define liblldb_VariableList_h_
13 #include "lldb/lldb-private.h"
14 #include "lldb/Symbol/SymbolContext.h"
15 #include "lldb/Symbol/Variable.h"
17 namespace lldb_private {
22 //------------------------------------------------------------------
23 // Constructors and Destructors
24 //------------------------------------------------------------------
25 // VariableList(const SymbolContext &symbol_context);
27 virtual ~VariableList();
30 AddVariable (const lldb::VariableSP &var_sp);
33 AddVariableIfUnique (const lldb::VariableSP &var_sp);
36 AddVariables (VariableList *variable_list);
42 Dump(Stream *s, bool show_context) const;
45 GetVariableAtIndex(size_t idx) const;
48 RemoveVariableAtIndex (size_t idx);
51 FindVariable (const ConstString& name);
54 FindVariable (const ConstString& name, lldb::ValueType value_type);
57 FindVariableIndex (const lldb::VariableSP &var_sp);
60 AppendVariablesIfUnique(VariableList &var_list);
62 // Returns the actual number of unique variables that were added to the
63 // list. "total_matches" will get updated with the actualy number of
64 // matches that were found regardless of whether they were unique or not
65 // to allow for error conditions when nothing is found, versus conditions
66 // where any varaibles that match "regex" were already in "var_list".
68 AppendVariablesIfUnique (const RegularExpression& regex,
69 VariableList &var_list,
70 size_t& total_matches);
73 AppendVariablesWithScope (lldb::ValueType type,
74 VariableList &var_list,
75 bool if_unique = true);
78 FindIndexForVariable (Variable* variable);
87 typedef std::vector<lldb::VariableSP> collection;
88 typedef collection::iterator iterator;
89 typedef collection::const_iterator const_iterator;
91 collection m_variables;
93 //------------------------------------------------------------------
94 // For VariableList only
95 //------------------------------------------------------------------
96 DISALLOW_COPY_AND_ASSIGN (VariableList);
99 } // namespace lldb_private
101 #endif // liblldb_VariableList_h_