blob: 7c453567c0ae68782b370b1dbca37ef916b43446 [file] [log] [blame]
Zachary Turner51f96ee2015-02-17 17:55:50 +00001//===-- SBVariablesOptions.cpp --------------------------------------*- 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
11#include "lldb/API/SBVariablesOptions.h"
12
13using namespace lldb;
14using namespace lldb_private;
15
16class VariablesOptionsImpl
17{
18public:
19 VariablesOptionsImpl () :
20 m_include_arguments(false),
21 m_include_locals(false),
22 m_include_statics(false),
23 m_in_scope_only(false),
24 m_include_runtime_support_values(false),
25 m_use_dynamic(lldb::eNoDynamicValues)
26 {}
27
28 VariablesOptionsImpl (const VariablesOptionsImpl&) = default;
29
30 ~VariablesOptionsImpl () = default;
31
32 VariablesOptionsImpl&
33 operator = (const VariablesOptionsImpl&) = default;
34
35 bool
36 GetIncludeArguments () const
37 {
38 return m_include_arguments;
39 }
40
41 void
42 SetIncludeArguments (bool b)
43 {
44 m_include_arguments = b;
45 }
46
47 bool
48 GetIncludeLocals () const
49 {
50 return m_include_locals;
51 }
52
53 void
54 SetIncludeLocals (bool b)
55 {
56 m_include_locals = b;
57 }
58
59 bool
60 GetIncludeStatics () const
61 {
62 return m_include_statics;
63 }
64
65 void
66 SetIncludeStatics (bool b)
67 {
68 m_include_statics = b;
69 }
70
71 bool
72 GetInScopeOnly () const
73 {
74 return m_in_scope_only;
75 }
76
77 void
78 SetInScopeOnly (bool b)
79 {
80 m_in_scope_only = b;
81 }
82
83 bool
84 GetIncludeRuntimeSupportValues () const
85 {
86 return m_include_runtime_support_values;
87 }
88
89 void
90 SetIncludeRuntimeSupportValues (bool b)
91 {
92 m_include_runtime_support_values = b;
93 }
94
95 lldb::DynamicValueType
96 GetUseDynamic () const
97 {
98 return m_use_dynamic;
99 }
100
101 void
102 SetUseDynamic (lldb::DynamicValueType d)
103 {
104 m_use_dynamic = d;
105 }
106
107
108private:
109 bool m_include_arguments : 1;
110 bool m_include_locals : 1;
111 bool m_include_statics : 1;
112 bool m_in_scope_only : 1;
113 bool m_include_runtime_support_values : 1;
114 lldb::DynamicValueType m_use_dynamic;
115};
116
117SBVariablesOptions::SBVariablesOptions () :
118m_opaque_ap(new VariablesOptionsImpl())
119{
120}
121
122SBVariablesOptions::SBVariablesOptions (const SBVariablesOptions& options) :
123m_opaque_ap(new VariablesOptionsImpl(options.ref()))
124{
125}
126
127SBVariablesOptions&
128SBVariablesOptions::operator = (const SBVariablesOptions& options)
129{
130 m_opaque_ap.reset(new VariablesOptionsImpl(options.ref()));
131 return *this;
132}
133
134SBVariablesOptions::~SBVariablesOptions () = default;
135
136bool
137SBVariablesOptions::IsValid () const
138{
139 return m_opaque_ap.get() != nullptr;
140}
141
142bool
143SBVariablesOptions::GetIncludeArguments () const
144{
145 return m_opaque_ap->GetIncludeArguments();
146}
147
148void
149SBVariablesOptions::SetIncludeArguments (bool arguments)
150{
151 m_opaque_ap->SetIncludeArguments(arguments);
152}
153
154bool
155SBVariablesOptions::GetIncludeLocals () const
156{
157 return m_opaque_ap->GetIncludeLocals();
158}
159
160void
161SBVariablesOptions::SetIncludeLocals (bool locals)
162{
163 m_opaque_ap->SetIncludeLocals(locals);
164}
165
166bool
167SBVariablesOptions::GetIncludeStatics () const
168{
169 return m_opaque_ap->GetIncludeStatics();
170}
171
172void
173SBVariablesOptions::SetIncludeStatics (bool statics)
174{
175 m_opaque_ap->SetIncludeStatics(statics);
176}
177
178bool
179SBVariablesOptions::GetInScopeOnly () const
180{
181 return m_opaque_ap->GetInScopeOnly();
182}
183
184void
185SBVariablesOptions::SetInScopeOnly (bool in_scope_only)
186{
187 m_opaque_ap->SetInScopeOnly(in_scope_only);
188}
189
190bool
191SBVariablesOptions::GetIncludeRuntimeSupportValues () const
192{
193 return m_opaque_ap->GetIncludeRuntimeSupportValues();
194}
195
196void
197SBVariablesOptions::SetIncludeRuntimeSupportValues (bool runtime_support_values)
198{
199 m_opaque_ap->SetIncludeRuntimeSupportValues(runtime_support_values);
200}
201
202lldb::DynamicValueType
203SBVariablesOptions::GetUseDynamic () const
204{
205 return m_opaque_ap->GetUseDynamic();
206}
207
208void
209SBVariablesOptions::SetUseDynamic (lldb::DynamicValueType dynamic)
210{
211 m_opaque_ap->SetUseDynamic(dynamic);
212}
213
214VariablesOptionsImpl *
215SBVariablesOptions::operator->()
216{
217 return m_opaque_ap.operator->();
218}
219
220const VariablesOptionsImpl *
221SBVariablesOptions::operator->() const
222{
223 return m_opaque_ap.operator->();
224}
225
226VariablesOptionsImpl *
227SBVariablesOptions::get ()
228{
229 return m_opaque_ap.get();
230}
231
232VariablesOptionsImpl &
233SBVariablesOptions::ref()
234{
235 return *m_opaque_ap;
236}
237
238const VariablesOptionsImpl &
239SBVariablesOptions::ref() const
240{
241 return *m_opaque_ap;
242}
243
244SBVariablesOptions::SBVariablesOptions (VariablesOptionsImpl *lldb_object_ptr) :
245m_opaque_ap(std::move(lldb_object_ptr))
246{
247}
248
249void
250SBVariablesOptions::SetOptions (VariablesOptionsImpl *lldb_object_ptr)
251{
252 m_opaque_ap.reset(std::move(lldb_object_ptr));
253}
254