LLDB
mainline
llvm-project
lldb
include
lldb
Interpreter
OptionValueEnumeration.h
Go to the documentation of this file.
1
//===-- OptionValueEnumeration.h --------------------------------*- C++ -*-===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
9
#ifndef LLDB_INTERPRETER_OPTIONVALUEENUMERATION_H
10
#define LLDB_INTERPRETER_OPTIONVALUEENUMERATION_H
11
12
#include "
lldb/Core/UniqueCStringMap.h
"
13
#include "
lldb/Interpreter/OptionValue.h
"
14
#include "
lldb/Utility/ConstString.h
"
15
#include "
lldb/Utility/Status.h
"
16
#include "
lldb/Utility/Stream.h
"
17
#include "
lldb/Utility/StreamString.h
"
18
#include "
lldb/lldb-private-types.h
"
19
20
namespace
lldb_private
{
21
22
class
OptionValueEnumeration
23
:
public
Cloneable
<OptionValueEnumeration, OptionValue> {
24
public
:
25
typedef
int64_t
enum_type
;
26
struct
EnumeratorInfo
{
27
enum_type
value
;
28
const
char
*
description
;
29
};
30
typedef
UniqueCStringMap<EnumeratorInfo>
EnumerationMap
;
31
typedef
EnumerationMap::Entry
EnumerationMapEntry
;
32
33
OptionValueEnumeration
(
const
OptionEnumValues
&enumerators,
enum_type
value);
34
35
~OptionValueEnumeration
()
override
=
default
;
36
37
// Virtual subclass pure virtual overrides
38
39
OptionValue::Type
GetType
()
const override
{
return
eTypeEnum
; }
40
41
void
DumpValue
(
const
ExecutionContext
*exe_ctx,
Stream
&strm,
42
uint32_t dump_mask)
override
;
43
44
Status
45
SetValueFromString
(llvm::StringRef value,
46
VarSetOperationType
op =
eVarSetOperationAssign
)
override
;
47
48
void
Clear
()
override
{
49
m_current_value
=
m_default_value
;
50
m_value_was_set
=
false
;
51
}
52
53
void
AutoComplete
(
CommandInterpreter
&interpreter,
54
CompletionRequest
&request)
override
;
55
56
// Subclass specific functions
57
58
enum_type
operator=
(
enum_type
value) {
59
m_current_value
= value;
60
return
m_current_value
;
61
}
62
63
enum_type
GetCurrentValue
()
const
{
return
m_current_value
; }
64
65
enum_type
GetDefaultValue
()
const
{
return
m_default_value
; }
66
67
void
SetCurrentValue
(
enum_type
value) {
m_current_value
= value; }
68
69
void
SetDefaultValue
(
enum_type
value) {
m_default_value
= value; }
70
71
protected
:
72
void
SetEnumerations
(
const
OptionEnumValues
&enumerators);
73
74
enum_type
m_current_value
;
75
enum_type
m_default_value
;
76
EnumerationMap
m_enumerations
;
77
};
78
79
}
// namespace lldb_private
80
81
#endif
// LLDB_INTERPRETER_OPTIONVALUEENUMERATION_H
ConstString.h
OptionValue.h
Status.h
StreamString.h
Stream.h
UniqueCStringMap.h
lldb_private::Cloneable
A class that implements CRTP-based "virtual constructor" idiom.
Definition:
Cloneable.h:40
lldb_private::CommandInterpreter
Definition:
CommandInterpreter.h:231
lldb_private::CompletionRequest
"lldb/Utility/ArgCompletionRequest.h"
Definition:
CompletionRequest.h:100
lldb_private::ExecutionContext
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
Definition:
ExecutionContext.h:292
lldb_private::OptionValueEnumeration
Definition:
OptionValueEnumeration.h:23
lldb_private::OptionValueEnumeration::EnumerationMapEntry
EnumerationMap::Entry EnumerationMapEntry
Definition:
OptionValueEnumeration.h:31
lldb_private::OptionValueEnumeration::SetCurrentValue
void SetCurrentValue(enum_type value)
Definition:
OptionValueEnumeration.h:67
lldb_private::OptionValueEnumeration::GetDefaultValue
enum_type GetDefaultValue() const
Definition:
OptionValueEnumeration.h:65
lldb_private::OptionValueEnumeration::EnumerationMap
UniqueCStringMap< EnumeratorInfo > EnumerationMap
Definition:
OptionValueEnumeration.h:30
lldb_private::OptionValueEnumeration::SetDefaultValue
void SetDefaultValue(enum_type value)
Definition:
OptionValueEnumeration.h:69
lldb_private::OptionValueEnumeration::SetEnumerations
void SetEnumerations(const OptionEnumValues &enumerators)
Definition:
OptionValueEnumeration.cpp:85
lldb_private::OptionValueEnumeration::GetType
OptionValue::Type GetType() const override
Definition:
OptionValueEnumeration.h:39
lldb_private::OptionValueEnumeration::SetValueFromString
Status SetValueFromString(llvm::StringRef value, VarSetOperationType op=eVarSetOperationAssign) override
Definition:
OptionValueEnumeration.cpp:40
lldb_private::OptionValueEnumeration::enum_type
int64_t enum_type
Definition:
OptionValueEnumeration.h:25
lldb_private::OptionValueEnumeration::~OptionValueEnumeration
~OptionValueEnumeration() override=default
lldb_private::OptionValueEnumeration::m_enumerations
EnumerationMap m_enumerations
Definition:
OptionValueEnumeration.h:76
lldb_private::OptionValueEnumeration::DumpValue
void DumpValue(const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask) override
Definition:
OptionValueEnumeration.cpp:22
lldb_private::OptionValueEnumeration::Clear
void Clear() override
Definition:
OptionValueEnumeration.h:48
lldb_private::OptionValueEnumeration::m_default_value
enum_type m_default_value
Definition:
OptionValueEnumeration.h:75
lldb_private::OptionValueEnumeration::operator=
enum_type operator=(enum_type value)
Definition:
OptionValueEnumeration.h:58
lldb_private::OptionValueEnumeration::m_current_value
enum_type m_current_value
Definition:
OptionValueEnumeration.h:74
lldb_private::OptionValueEnumeration::AutoComplete
void AutoComplete(CommandInterpreter &interpreter, CompletionRequest &request) override
Definition:
OptionValueEnumeration.cpp:98
lldb_private::OptionValueEnumeration::GetCurrentValue
enum_type GetCurrentValue() const
Definition:
OptionValueEnumeration.h:63
lldb_private::OptionValue::m_value_was_set
bool m_value_was_set
Definition:
OptionValue.h:347
lldb_private::OptionValue::Type
Type
Definition:
OptionValue.h:33
lldb_private::OptionValue::eTypeEnum
@ eTypeEnum
Definition:
OptionValue.h:41
lldb_private::Status
An error handling class.
Definition:
Status.h:115
lldb_private::Stream
A stream class that can stream formatted output to a file.
Definition:
Stream.h:28
lldb_private::UniqueCStringMap
Definition:
UniqueCStringMap.h:26
lldb-private-types.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:86
lldb_private::eVarSetOperationAssign
@ eVarSetOperationAssign
Definition:
lldb-private-enumerations.h:93
lldb_private::OptionEnumValues
llvm::ArrayRef< OptionEnumValueElement > OptionEnumValues
Definition:
lldb-private-types.h:127
lldb_private::OptionValueEnumeration::EnumeratorInfo
Definition:
OptionValueEnumeration.h:26
lldb_private::OptionValueEnumeration::EnumeratorInfo::value
enum_type value
Definition:
OptionValueEnumeration.h:27
lldb_private::OptionValueEnumeration::EnumeratorInfo::description
const char * description
Definition:
OptionValueEnumeration.h:28
Generated on Fri Dec 20 2024 17:26:47 for LLDB by
1.9.6