1 //===-- SBVariablesOptions.cpp --------------------------------------*- 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 //===----------------------------------------------------------------------===//
11 #include "lldb/API/SBVariablesOptions.h"
14 using namespace lldb_private;
16 class VariablesOptionsImpl
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)
28 VariablesOptionsImpl (const VariablesOptionsImpl&) = default;
30 ~VariablesOptionsImpl () = default;
33 operator = (const VariablesOptionsImpl&) = default;
36 GetIncludeArguments () const
38 return m_include_arguments;
42 SetIncludeArguments (bool b)
44 m_include_arguments = b;
48 GetIncludeLocals () const
50 return m_include_locals;
54 SetIncludeLocals (bool b)
60 GetIncludeStatics () const
62 return m_include_statics;
66 SetIncludeStatics (bool b)
68 m_include_statics = b;
72 GetInScopeOnly () const
74 return m_in_scope_only;
78 SetInScopeOnly (bool b)
84 GetIncludeRuntimeSupportValues () const
86 return m_include_runtime_support_values;
90 SetIncludeRuntimeSupportValues (bool b)
92 m_include_runtime_support_values = b;
95 lldb::DynamicValueType
96 GetUseDynamic () const
102 SetUseDynamic (lldb::DynamicValueType d)
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;
117 SBVariablesOptions::SBVariablesOptions () :
118 m_opaque_ap(new VariablesOptionsImpl())
122 SBVariablesOptions::SBVariablesOptions (const SBVariablesOptions& options) :
123 m_opaque_ap(new VariablesOptionsImpl(options.ref()))
128 SBVariablesOptions::operator = (const SBVariablesOptions& options)
130 m_opaque_ap.reset(new VariablesOptionsImpl(options.ref()));
134 SBVariablesOptions::~SBVariablesOptions () = default;
137 SBVariablesOptions::IsValid () const
139 return m_opaque_ap.get() != nullptr;
143 SBVariablesOptions::GetIncludeArguments () const
145 return m_opaque_ap->GetIncludeArguments();
149 SBVariablesOptions::SetIncludeArguments (bool arguments)
151 m_opaque_ap->SetIncludeArguments(arguments);
155 SBVariablesOptions::GetIncludeLocals () const
157 return m_opaque_ap->GetIncludeLocals();
161 SBVariablesOptions::SetIncludeLocals (bool locals)
163 m_opaque_ap->SetIncludeLocals(locals);
167 SBVariablesOptions::GetIncludeStatics () const
169 return m_opaque_ap->GetIncludeStatics();
173 SBVariablesOptions::SetIncludeStatics (bool statics)
175 m_opaque_ap->SetIncludeStatics(statics);
179 SBVariablesOptions::GetInScopeOnly () const
181 return m_opaque_ap->GetInScopeOnly();
185 SBVariablesOptions::SetInScopeOnly (bool in_scope_only)
187 m_opaque_ap->SetInScopeOnly(in_scope_only);
191 SBVariablesOptions::GetIncludeRuntimeSupportValues () const
193 return m_opaque_ap->GetIncludeRuntimeSupportValues();
197 SBVariablesOptions::SetIncludeRuntimeSupportValues (bool runtime_support_values)
199 m_opaque_ap->SetIncludeRuntimeSupportValues(runtime_support_values);
202 lldb::DynamicValueType
203 SBVariablesOptions::GetUseDynamic () const
205 return m_opaque_ap->GetUseDynamic();
209 SBVariablesOptions::SetUseDynamic (lldb::DynamicValueType dynamic)
211 m_opaque_ap->SetUseDynamic(dynamic);
214 VariablesOptionsImpl *
215 SBVariablesOptions::operator->()
217 return m_opaque_ap.operator->();
220 const VariablesOptionsImpl *
221 SBVariablesOptions::operator->() const
223 return m_opaque_ap.operator->();
226 VariablesOptionsImpl *
227 SBVariablesOptions::get ()
229 return m_opaque_ap.get();
232 VariablesOptionsImpl &
233 SBVariablesOptions::ref()
238 const VariablesOptionsImpl &
239 SBVariablesOptions::ref() const
244 SBVariablesOptions::SBVariablesOptions (VariablesOptionsImpl *lldb_object_ptr) :
245 m_opaque_ap(std::move(lldb_object_ptr))
250 SBVariablesOptions::SetOptions (VariablesOptionsImpl *lldb_object_ptr)
252 m_opaque_ap.reset(std::move(lldb_object_ptr));