Coverage Report

Created: 2022-01-18 06:27

/Users/buildslave/jenkins/workspace/coverage/llvm-project/lldb/include/lldb/Interpreter/OptionValueChar.h
Line
Count
Source (jump to first uncovered line)
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
12
#include "lldb/Interpreter/OptionValue.h"
13
14
namespace lldb_private {
15
16
class OptionValueChar : public Cloneable<OptionValueChar, OptionValue> {
17
public:
18
  OptionValueChar(char value)
19
0
      : m_current_value(value), m_default_value(value) {}
20
21
  OptionValueChar(char current_value, char default_value)
22
0
      : m_current_value(current_value), m_default_value(default_value) {}
23
24
0
  ~OptionValueChar() override = default;
25
26
  // Virtual subclass pure virtual overrides
27
28
0
  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,
35
                     VarSetOperationType op = eVarSetOperationAssign) override;
36
37
0
  void Clear() override {
38
0
    m_current_value = m_default_value;
39
0
    m_value_was_set = false;
40
0
  }
41
42
  // Subclass specific functions
43
44
0
  const char &operator=(char c) {
45
0
    m_current_value = c;
46
0
    return m_current_value;
47
0
  }
48
49
0
  char GetCurrentValue() const { return m_current_value; }
50
51
0
  char GetDefaultValue() const { return m_default_value; }
52
53
0
  void SetCurrentValue(char value) { m_current_value = value; }
54
55
0
  void SetDefaultValue(char value) { m_default_value = value; }
56
57
protected:
58
  char m_current_value;
59
  char m_default_value;
60
};
61
62
} // namespace lldb_private
63
64
#endif // LLDB_INTERPRETER_OPTIONVALUECHAR_H