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 FindVariableIndex (const lldb::VariableSP &var_sp);
56 // Returns the actual number of unique variables that were added to the
57 // list. "total_matches" will get updated with the actualy number of
58 // matches that were found regardless of whether they were unique or not
59 // to allow for error conditions when nothing is found, versus conditions
60 // where any varaibles that match "regex" were already in "var_list".
62 AppendVariablesIfUnique (const RegularExpression& regex,
63 VariableList &var_list,
64 size_t& total_matches);
67 AppendVariablesWithScope (lldb::ValueType type,
68 VariableList &var_list,
69 bool if_unique = true);
72 FindIndexForVariable (Variable* variable);
81 typedef std::vector<lldb::VariableSP> collection;
82 typedef collection::iterator iterator;
83 typedef collection::const_iterator const_iterator;
85 collection m_variables;
87 //------------------------------------------------------------------
88 // For VariableList only
89 //------------------------------------------------------------------
90 DISALLOW_COPY_AND_ASSIGN (VariableList);
93 } // namespace lldb_private
95 #endif // liblldb_VariableList_h_