LLDB
mainline
llvm-project
lldb
include
lldb
Interpreter
OptionValueLanguage.h
Go to the documentation of this file.
1
//===-- OptionValueLanguage.h -------------------------------------*- C++
2
//-*-===//
3
//
4
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5
// See https://llvm.org/LICENSE.txt for license information.
6
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7
//
8
//===----------------------------------------------------------------------===//
9
10
#ifndef LLDB_INTERPRETER_OPTIONVALUELANGUAGE_H
11
#define LLDB_INTERPRETER_OPTIONVALUELANGUAGE_H
12
13
#include "
lldb/Interpreter/OptionValue.h
"
14
#include "
lldb/lldb-enumerations.h
"
15
16
namespace
lldb_private
{
17
18
class
OptionValueLanguage
:
public
Cloneable
<OptionValueLanguage, OptionValue> {
19
public
:
20
OptionValueLanguage
(
lldb::LanguageType
value)
21
:
m_current_value
(value),
m_default_value
(value) {}
22
23
OptionValueLanguage
(
lldb::LanguageType
current_value,
24
lldb::LanguageType
default_value)
25
:
m_current_value
(current_value),
m_default_value
(default_value) {}
26
27
~OptionValueLanguage
()
override
=
default
;
28
29
// Virtual subclass pure virtual overrides
30
31
OptionValue::Type
GetType
()
const override
{
return
eTypeLanguage
; }
32
33
void
DumpValue
(
const
ExecutionContext
*exe_ctx,
Stream
&strm,
34
uint32_t dump_mask)
override
;
35
36
llvm::json::Value
ToJSON
(
const
ExecutionContext
*exe_ctx)
override
;
37
38
Status
39
SetValueFromString
(llvm::StringRef value,
40
VarSetOperationType
op =
eVarSetOperationAssign
)
override
;
41
42
void
Clear
()
override
{
43
m_current_value
=
m_default_value
;
44
m_value_was_set
=
false
;
45
}
46
47
// Subclass specific functions
48
49
lldb::LanguageType
GetCurrentValue
()
const
{
return
m_current_value
; }
50
51
lldb::LanguageType
GetDefaultValue
()
const
{
return
m_default_value
; }
52
53
void
SetCurrentValue
(
lldb::LanguageType
value) {
m_current_value
= value; }
54
55
void
SetDefaultValue
(
lldb::LanguageType
value) {
m_default_value
= value; }
56
57
protected
:
58
lldb::LanguageType
m_current_value
;
59
lldb::LanguageType
m_default_value
;
60
};
61
62
}
// namespace lldb_private
63
64
#endif
// LLDB_INTERPRETER_OPTIONVALUELANGUAGE_H
OptionValue.h
lldb_private::Cloneable
A class that implements CRTP-based "virtual constructor" idiom.
Definition:
Cloneable.h:40
lldb_private::ExecutionContext
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
Definition:
ExecutionContext.h:292
lldb_private::OptionValueLanguage
Definition:
OptionValueLanguage.h:18
lldb_private::OptionValueLanguage::ToJSON
llvm::json::Value ToJSON(const ExecutionContext *exe_ctx) override
Definition:
OptionValueLanguage.cpp:32
lldb_private::OptionValueLanguage::GetType
OptionValue::Type GetType() const override
Definition:
OptionValueLanguage.h:31
lldb_private::OptionValueLanguage::GetDefaultValue
lldb::LanguageType GetDefaultValue() const
Definition:
OptionValueLanguage.h:51
lldb_private::OptionValueLanguage::GetCurrentValue
lldb::LanguageType GetCurrentValue() const
Definition:
OptionValueLanguage.h:49
lldb_private::OptionValueLanguage::Clear
void Clear() override
Definition:
OptionValueLanguage.h:42
lldb_private::OptionValueLanguage::SetDefaultValue
void SetDefaultValue(lldb::LanguageType value)
Definition:
OptionValueLanguage.h:55
lldb_private::OptionValueLanguage::OptionValueLanguage
OptionValueLanguage(lldb::LanguageType current_value, lldb::LanguageType default_value)
Definition:
OptionValueLanguage.h:23
lldb_private::OptionValueLanguage::OptionValueLanguage
OptionValueLanguage(lldb::LanguageType value)
Definition:
OptionValueLanguage.h:20
lldb_private::OptionValueLanguage::~OptionValueLanguage
~OptionValueLanguage() override=default
lldb_private::OptionValueLanguage::SetCurrentValue
void SetCurrentValue(lldb::LanguageType value)
Definition:
OptionValueLanguage.h:53
lldb_private::OptionValueLanguage::m_current_value
lldb::LanguageType m_current_value
Definition:
OptionValueLanguage.h:58
lldb_private::OptionValueLanguage::m_default_value
lldb::LanguageType m_default_value
Definition:
OptionValueLanguage.h:59
lldb_private::OptionValueLanguage::DumpValue
void DumpValue(const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask) override
Definition:
OptionValueLanguage.cpp:20
lldb_private::OptionValueLanguage::SetValueFromString
Status SetValueFromString(llvm::StringRef value, VarSetOperationType op=eVarSetOperationAssign) override
Definition:
OptionValueLanguage.cpp:36
lldb_private::OptionValue::m_value_was_set
bool m_value_was_set
Definition:
OptionValue.h:346
lldb_private::OptionValue::Type
Type
Definition:
OptionValue.h:33
lldb_private::OptionValue::eTypeLanguage
@ eTypeLanguage
Definition:
OptionValue.h:46
lldb_private::Status
An error handling class.
Definition:
Status.h:44
lldb_private::Stream
A stream class that can stream formatted output to a file.
Definition:
Stream.h:28
lldb-enumerations.h
lldb_private
A class that represents a running process on the host machine.
Definition:
SBAddressRange.h:14
lldb_private::VarSetOperationType
VarSetOperationType
Settable state variable types.
Definition:
lldb-private-enumerations.h:85
lldb_private::eVarSetOperationAssign
@ eVarSetOperationAssign
Definition:
lldb-private-enumerations.h:92
lldb::LanguageType
LanguageType
Programming language type.
Definition:
lldb-enumerations.h:461
Generated on Wed Nov 20 2024 18:14:35 for LLDB by
1.9.6