Coverage Report

Created: 2022-01-25 06:29

/Users/buildslave/jenkins/workspace/coverage/llvm-project/lldb/include/lldb/Interpreter/OptionValueFormatEntity.h
Line
Count
Source (jump to first uncovered line)
1
//===-- OptionValueFormatEntity.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_OPTIONVALUEFORMATENTITY_H
10
#define LLDB_INTERPRETER_OPTIONVALUEFORMATENTITY_H
11
12
#include "lldb/Core/FormatEntity.h"
13
#include "lldb/Interpreter/OptionValue.h"
14
15
namespace lldb_private {
16
17
class OptionValueFormatEntity
18
    : public Cloneable<OptionValueFormatEntity, OptionValue> {
19
public:
20
  OptionValueFormatEntity(const char *default_format);
21
22
29.7k
  ~OptionValueFormatEntity() override = default;
23
24
  // Virtual subclass pure virtual overrides
25
26
1.00M
  OptionValue::Type GetType() const override { return eTypeFormatEntity; }
27
28
  void DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
29
                 uint32_t dump_mask) override;
30
31
  Status
32
  SetValueFromString(llvm::StringRef value,
33
                     VarSetOperationType op = eVarSetOperationAssign) override;
34
35
  void Clear() override;
36
37
  void AutoComplete(CommandInterpreter &interpreter,
38
                    CompletionRequest &request) override;
39
40
  // Subclass specific functions
41
42
0
  FormatEntity::Entry &GetCurrentValue() { return m_current_entry; }
43
44
1.00M
  const FormatEntity::Entry &GetCurrentValue() const { return m_current_entry; }
45
46
0
  void SetCurrentValue(const FormatEntity::Entry &value) {
47
0
    m_current_entry = value;
48
0
  }
49
50
0
  FormatEntity::Entry &GetDefaultValue() { return m_default_entry; }
51
52
0
  const FormatEntity::Entry &GetDefaultValue() const { return m_default_entry; }
53
54
protected:
55
  std::string m_current_format;
56
  std::string m_default_format;
57
  FormatEntity::Entry m_current_entry;
58
  FormatEntity::Entry m_default_entry;
59
};
60
61
} // namespace lldb_private
62
63
#endif // LLDB_INTERPRETER_OPTIONVALUEFORMATENTITY_H