1 //===-- OptionValueFormatEntity.h --------------------------------*- C++-*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_OptionValueFormatEntity_h_
11 #define liblldb_OptionValueFormatEntity_h_
15 // Other libraries and framework includes
17 #include "lldb/Core/FormatEntity.h"
18 #include "lldb/Interpreter/OptionValue.h"
20 namespace lldb_private {
22 class OptionValueFormatEntity : public OptionValue {
24 OptionValueFormatEntity(const char *default_format);
26 ~OptionValueFormatEntity() override {}
28 //---------------------------------------------------------------------
29 // Virtual subclass pure virtual overrides
30 //---------------------------------------------------------------------
32 OptionValue::Type GetType() const override { return eTypeFormatEntity; }
34 void DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
35 uint32_t dump_mask) override;
38 SetValueFromString(llvm::StringRef value,
39 VarSetOperationType op = eVarSetOperationAssign) override;
41 SetValueFromString(const char *,
42 VarSetOperationType = eVarSetOperationAssign) = delete;
44 bool Clear() override;
46 lldb::OptionValueSP DeepCopy() const override;
48 size_t AutoComplete(CommandInterpreter &interpreter, llvm::StringRef s,
49 int match_start_point, int max_return_elements,
50 bool &word_complete, StringList &matches) override;
52 //---------------------------------------------------------------------
53 // Subclass specific functions
54 //---------------------------------------------------------------------
56 FormatEntity::Entry &GetCurrentValue() { return m_current_entry; }
58 const FormatEntity::Entry &GetCurrentValue() const { return m_current_entry; }
60 void SetCurrentValue(const FormatEntity::Entry &value) {
61 m_current_entry = value;
64 FormatEntity::Entry &GetDefaultValue() { return m_default_entry; }
66 const FormatEntity::Entry &GetDefaultValue() const { return m_default_entry; }
69 std::string m_current_format;
70 std::string m_default_format;
71 FormatEntity::Entry m_current_entry;
72 FormatEntity::Entry m_default_entry;
75 } // namespace lldb_private
77 #endif // liblldb_OptionValueFormatEntity_h_