Coverage Report

Created: 2023-11-11 10:31

/Users/buildslave/jenkins/workspace/coverage/llvm-project/lldb/include/lldb/Interpreter/OptionValueFormat.h
Line
Count
Source (jump to first uncovered line)
1
//===-- OptionValueFormat.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_OPTIONVALUEFORMAT_H
10
#define LLDB_INTERPRETER_OPTIONVALUEFORMAT_H
11
12
#include "lldb/Interpreter/OptionValue.h"
13
14
namespace lldb_private {
15
16
class OptionValueFormat
17
    : public Cloneable<OptionValueFormat, OptionValue> {
18
public:
19
  OptionValueFormat(lldb::Format value)
20
0
      : m_current_value(value), m_default_value(value) {}
21
22
  OptionValueFormat(lldb::Format current_value, lldb::Format default_value)
23
55.2k
      : m_current_value(current_value), m_default_value(default_value) {}
24
25
55.2k
  ~OptionValueFormat() override = default;
26
27
  // Virtual subclass pure virtual overrides
28
29
0
  OptionValue::Type GetType() const override { return eTypeFormat; }
30
31
  void DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
32
                 uint32_t dump_mask) override;
33
34
  llvm::json::Value ToJSON(const ExecutionContext *exe_ctx) override;
35
36
  Status
37
  SetValueFromString(llvm::StringRef value,
38
                     VarSetOperationType op = eVarSetOperationAssign) override;
39
40
52.2k
  void Clear() override {
41
52.2k
    m_current_value = m_default_value;
42
52.2k
    m_value_was_set = false;
43
52.2k
  }
44
45
  // Subclass specific functions
46
47
15.1k
  lldb::Format GetCurrentValue() const { return m_current_value; }
48
49
0
  lldb::Format GetDefaultValue() const { return m_default_value; }
50
51
46
  void SetCurrentValue(lldb::Format value) { m_current_value = value; }
52
53
0
  void SetDefaultValue(lldb::Format value) { m_default_value = value; }
54
55
protected:
56
  lldb::Format m_current_value;
57
  lldb::Format m_default_value;
58
};
59
60
} // namespace lldb_private
61
62
#endif // LLDB_INTERPRETER_OPTIONVALUEFORMAT_H