Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:42:50

0001 //===-- OptionValueFormatEntity.h --------------------------------*- C++-*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLDB_INTERPRETER_OPTIONVALUEFORMATENTITY_H
0010 #define LLDB_INTERPRETER_OPTIONVALUEFORMATENTITY_H
0011 
0012 #include "lldb/Core/FormatEntity.h"
0013 #include "lldb/Interpreter/OptionValue.h"
0014 
0015 namespace lldb_private {
0016 
0017 class OptionValueFormatEntity
0018     : public Cloneable<OptionValueFormatEntity, OptionValue> {
0019 public:
0020   OptionValueFormatEntity(const char *default_format);
0021 
0022   ~OptionValueFormatEntity() override = default;
0023 
0024   // Virtual subclass pure virtual overrides
0025 
0026   OptionValue::Type GetType() const override { return eTypeFormatEntity; }
0027 
0028   void DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
0029                  uint32_t dump_mask) override;
0030 
0031   llvm::json::Value ToJSON(const ExecutionContext *exe_ctx) override;
0032 
0033   Status
0034   SetValueFromString(llvm::StringRef value,
0035                      VarSetOperationType op = eVarSetOperationAssign) override;
0036 
0037   void Clear() override;
0038 
0039   void AutoComplete(CommandInterpreter &interpreter,
0040                     CompletionRequest &request) override;
0041 
0042   // Subclass specific functions
0043 
0044   FormatEntity::Entry &GetCurrentValue() { return m_current_entry; }
0045 
0046   const FormatEntity::Entry &GetCurrentValue() const { return m_current_entry; }
0047 
0048   void SetCurrentValue(const FormatEntity::Entry &value) {
0049     m_current_entry = value;
0050   }
0051 
0052   FormatEntity::Entry &GetDefaultValue() { return m_default_entry; }
0053 
0054   const FormatEntity::Entry &GetDefaultValue() const { return m_default_entry; }
0055 
0056 protected:
0057   std::string m_current_format;
0058   std::string m_default_format;
0059   FormatEntity::Entry m_current_entry;
0060   FormatEntity::Entry m_default_entry;
0061 };
0062 
0063 } // namespace lldb_private
0064 
0065 #endif // LLDB_INTERPRETER_OPTIONVALUEFORMATENTITY_H