OptionValueUUID.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. //===-- OptionValueUUID.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. #ifndef LLDB_INTERPRETER_OPTIONVALUEUUID_H
  9. #define LLDB_INTERPRETER_OPTIONVALUEUUID_H
  10. #include "lldb/Utility/UUID.h"
  11. #include "lldb/Interpreter/OptionValue.h"
  12. namespace lldb_private {
  13. class OptionValueUUID : public Cloneable<OptionValueUUID, OptionValue> {
  14. public:
  15. OptionValueUUID() = default;
  16. OptionValueUUID(const UUID &uuid) : m_uuid(uuid) {}
  17. ~OptionValueUUID() override = default;
  18. // Virtual subclass pure virtual overrides
  19. OptionValue::Type GetType() const override { return eTypeUUID; }
  20. void DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
  21. uint32_t dump_mask) override;
  22. Status
  23. SetValueFromString(llvm::StringRef value,
  24. VarSetOperationType op = eVarSetOperationAssign) override;
  25. void Clear() override {
  26. m_uuid.Clear();
  27. m_value_was_set = false;
  28. }
  29. // Subclass specific functions
  30. UUID &GetCurrentValue() { return m_uuid; }
  31. const UUID &GetCurrentValue() const { return m_uuid; }
  32. void SetCurrentValue(const UUID &value) { m_uuid = value; }
  33. void AutoComplete(CommandInterpreter &interpreter,
  34. CompletionRequest &request) override;
  35. protected:
  36. UUID m_uuid;
  37. };
  38. } // namespace lldb_private
  39. #endif // LLDB_INTERPRETER_OPTIONVALUEUUID_H