LLDB mainline
OptionValueFormatEntity.h
Go to the documentation of this file.
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
14
15namespace lldb_private {
16
18 : public Cloneable<OptionValueFormatEntity, OptionValue> {
19public:
20 OptionValueFormatEntity(const char *default_format);
21
22 ~OptionValueFormatEntity() override = default;
23
24 OptionValue::Type GetType() const override { return eTypeFormatEntity; }
25
26 void DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
27 uint32_t dump_mask) override;
28
29 llvm::json::Value ToJSON(const ExecutionContext *exe_ctx) const override;
30
31 Status
32 SetValueFromString(llvm::StringRef value,
34
35 void Clear() override;
36
37 bool IsDefault() const override {
39 }
40
41 void AutoComplete(CommandInterpreter &interpreter,
42 CompletionRequest &request) override;
43
45
47 m_current_entry = value;
48 }
49
51
52protected:
53 std::string m_current_format;
54 std::string m_default_format;
57};
58
59} // namespace lldb_private
60
61#endif // LLDB_INTERPRETER_OPTIONVALUEFORMATENTITY_H
A class that implements CRTP-based "virtual constructor" idiom.
Definition Cloneable.h:40
"lldb/Utility/ArgCompletionRequest.h"
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
const FormatEntity::Entry & GetCurrentValue() const
llvm::json::Value ToJSON(const ExecutionContext *exe_ctx) const override
const FormatEntity::Entry & GetDefaultValue() const
void SetCurrentValue(const FormatEntity::Entry &value)
void DumpValue(const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask) override
bool IsDefault() const override
Return true if the current value equals the default value.
Status SetValueFromString(llvm::StringRef value, VarSetOperationType op=eVarSetOperationAssign) override
OptionValue::Type GetType() const override
void AutoComplete(CommandInterpreter &interpreter, CompletionRequest &request) override
~OptionValueFormatEntity() override=default
OptionValueFormatEntity(const char *default_format)
An error handling class.
Definition Status.h:118
A stream class that can stream formatted output to a file.
Definition Stream.h:28
A class that represents a running process on the host machine.
VarSetOperationType
Settable state variable types.