LLDB  mainline
OptionValueChar.h
Go to the documentation of this file.
1 //===-- OptionValueChar.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_OPTIONVALUECHAR_H
10 #define LLDB_INTERPRETER_OPTIONVALUECHAR_H
11 
13 
14 namespace lldb_private {
15 
16 class OptionValueChar : public Cloneable<OptionValueChar, OptionValue> {
17 public:
18  OptionValueChar(char value)
19  : m_current_value(value), m_default_value(value) {}
20 
21  OptionValueChar(char current_value, char default_value)
22  : m_current_value(current_value), m_default_value(default_value) {}
23 
24  ~OptionValueChar() override = default;
25 
26  // Virtual subclass pure virtual overrides
27 
28  OptionValue::Type GetType() const override { return eTypeChar; }
29 
30  void DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
31  uint32_t dump_mask) override;
32 
33  Status
34  SetValueFromString(llvm::StringRef value,
36 
37  void Clear() override {
39  m_value_was_set = false;
40  }
41 
42  // Subclass specific functions
43 
44  const char &operator=(char c) {
45  m_current_value = c;
46  return m_current_value;
47  }
48 
49  char GetCurrentValue() const { return m_current_value; }
50 
51  char GetDefaultValue() const { return m_default_value; }
52 
53  void SetCurrentValue(char value) { m_current_value = value; }
54 
55  void SetDefaultValue(char value) { m_default_value = value; }
56 
57 protected:
60 };
61 
62 } // namespace lldb_private
63 
64 #endif // LLDB_INTERPRETER_OPTIONVALUECHAR_H
lldb_private::ExecutionContext
Definition: ExecutionContext.h:292
lldb_private::OptionValueChar::GetDefaultValue
char GetDefaultValue() const
Definition: OptionValueChar.h:51
lldb_private::OptionValueChar::SetValueFromString
Status SetValueFromString(llvm::StringRef value, VarSetOperationType op=eVarSetOperationAssign) override
Definition: OptionValueChar.cpp:34
lldb_private::Stream
Definition: Stream.h:28
lldb_private::Cloneable
Definition: Cloneable.h:40
lldb_private::OptionValueChar::m_current_value
char m_current_value
Definition: OptionValueChar.h:58
OptionValue.h
lldb_private::VarSetOperationType
VarSetOperationType
Settable state variable types.
Definition: lldb-private-enumerations.h:83
lldb_private::OptionValueChar::GetCurrentValue
char GetCurrentValue() const
Definition: OptionValueChar.h:49
lldb_private::OptionValueChar::~OptionValueChar
~OptionValueChar() override=default
lldb_private::OptionValueChar::SetDefaultValue
void SetDefaultValue(char value)
Definition: OptionValueChar.h:55
lldb_private::OptionValueChar::GetType
OptionValue::Type GetType() const override
Definition: OptionValueChar.h:28
lldb_private::OptionValueChar
Definition: OptionValueChar.h:16
lldb_private::Status
Definition: Status.h:44
lldb_private::OptionValue::Type
Type
Definition: OptionValue.h:26
lldb_private::OptionValue::eTypeChar
@ eTypeChar
Definition: OptionValue.h:32
uint32_t
lldb_private::OptionValue::m_value_was_set
bool m_value_was_set
Definition: OptionValue.h:332
lldb_private::OptionValueChar::m_default_value
char m_default_value
Definition: OptionValueChar.h:59
lldb_private::OptionValueChar::SetCurrentValue
void SetCurrentValue(char value)
Definition: OptionValueChar.h:53
lldb_private::OptionValueChar::OptionValueChar
OptionValueChar(char current_value, char default_value)
Definition: OptionValueChar.h:21
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::OptionValueChar::Clear
void Clear() override
Definition: OptionValueChar.h:37
lldb_private::OptionValueChar::operator=
const char & operator=(char c)
Definition: OptionValueChar.h:44
lldb_private::OptionValueChar::OptionValueChar
OptionValueChar(char value)
Definition: OptionValueChar.h:18
lldb_private::OptionValueChar::DumpValue
void DumpValue(const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask) override
Definition: OptionValueChar.cpp:19
lldb_private::eVarSetOperationAssign
@ eVarSetOperationAssign
Definition: lldb-private-enumerations.h:90