Back to home page

EIC code displayed by LXR

 
 

    


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

0001 //===-- OptionValueUUID.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_OPTIONVALUEUUID_H
0010 #define LLDB_INTERPRETER_OPTIONVALUEUUID_H
0011 
0012 #include "lldb/Utility/UUID.h"
0013 #include "lldb/Interpreter/OptionValue.h"
0014 
0015 namespace lldb_private {
0016 
0017 class OptionValueUUID : public Cloneable<OptionValueUUID, OptionValue> {
0018 public:
0019   OptionValueUUID() = default;
0020 
0021   OptionValueUUID(const UUID &uuid) : m_uuid(uuid) {}
0022 
0023   ~OptionValueUUID() override = default;
0024 
0025   // Virtual subclass pure virtual overrides
0026 
0027   OptionValue::Type GetType() const override { return eTypeUUID; }
0028 
0029   void DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
0030                  uint32_t dump_mask) override;
0031 
0032   llvm::json::Value ToJSON(const ExecutionContext *exe_ctx) override {
0033     return m_uuid.GetAsString();
0034   }
0035 
0036   Status
0037   SetValueFromString(llvm::StringRef value,
0038                      VarSetOperationType op = eVarSetOperationAssign) override;
0039 
0040   void Clear() override {
0041     m_uuid.Clear();
0042     m_value_was_set = false;
0043   }
0044 
0045   // Subclass specific functions
0046 
0047   UUID &GetCurrentValue() { return m_uuid; }
0048 
0049   const UUID &GetCurrentValue() const { return m_uuid; }
0050 
0051   void SetCurrentValue(const UUID &value) { m_uuid = value; }
0052 
0053   void AutoComplete(CommandInterpreter &interpreter,
0054                     CompletionRequest &request) override;
0055 
0056 protected:
0057   UUID m_uuid;
0058 };
0059 
0060 } // namespace lldb_private
0061 
0062 #endif // LLDB_INTERPRETER_OPTIONVALUEUUID_H