Andrew Walbran | 3d2c197 | 2020-04-07 12:24:26 +0100 | [diff] [blame] | 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 | |
Olivier Deprez | f4ef2d0 | 2021-04-20 13:36:24 +0200 | [diff] [blame] | 9 | #ifndef LLDB_INTERPRETER_OPTIONVALUEUUID_H |
| 10 | #define LLDB_INTERPRETER_OPTIONVALUEUUID_H |
Andrew Walbran | 3d2c197 | 2020-04-07 12:24:26 +0100 | [diff] [blame] | 11 | |
| 12 | #include "lldb/Utility/UUID.h" |
| 13 | #include "lldb/Interpreter/OptionValue.h" |
| 14 | |
| 15 | namespace lldb_private { |
| 16 | |
| 17 | class OptionValueUUID : public OptionValue { |
| 18 | public: |
| 19 | OptionValueUUID() : OptionValue(), m_uuid() {} |
| 20 | |
| 21 | OptionValueUUID(const UUID &uuid) : OptionValue(), m_uuid(uuid) {} |
| 22 | |
| 23 | ~OptionValueUUID() override {} |
| 24 | |
| 25 | // Virtual subclass pure virtual overrides |
| 26 | |
| 27 | OptionValue::Type GetType() const override { return eTypeUUID; } |
| 28 | |
| 29 | void DumpValue(const ExecutionContext *exe_ctx, Stream &strm, |
| 30 | uint32_t dump_mask) override; |
| 31 | |
| 32 | Status |
| 33 | SetValueFromString(llvm::StringRef value, |
| 34 | VarSetOperationType op = eVarSetOperationAssign) override; |
| 35 | Status |
| 36 | SetValueFromString(const char *, |
| 37 | VarSetOperationType = eVarSetOperationAssign) = delete; |
| 38 | |
Olivier Deprez | f4ef2d0 | 2021-04-20 13:36:24 +0200 | [diff] [blame] | 39 | void Clear() override { |
Andrew Walbran | 3d2c197 | 2020-04-07 12:24:26 +0100 | [diff] [blame] | 40 | m_uuid.Clear(); |
| 41 | m_value_was_set = false; |
Andrew Walbran | 3d2c197 | 2020-04-07 12:24:26 +0100 | [diff] [blame] | 42 | } |
| 43 | |
| 44 | lldb::OptionValueSP DeepCopy() const override; |
| 45 | |
| 46 | // Subclass specific functions |
| 47 | |
| 48 | UUID &GetCurrentValue() { return m_uuid; } |
| 49 | |
| 50 | const UUID &GetCurrentValue() const { return m_uuid; } |
| 51 | |
| 52 | void SetCurrentValue(const UUID &value) { m_uuid = value; } |
| 53 | |
Olivier Deprez | f4ef2d0 | 2021-04-20 13:36:24 +0200 | [diff] [blame] | 54 | void AutoComplete(CommandInterpreter &interpreter, |
| 55 | CompletionRequest &request) override; |
Andrew Walbran | 3d2c197 | 2020-04-07 12:24:26 +0100 | [diff] [blame] | 56 | |
| 57 | protected: |
| 58 | UUID m_uuid; |
| 59 | }; |
| 60 | |
| 61 | } // namespace lldb_private |
| 62 | |
Olivier Deprez | f4ef2d0 | 2021-04-20 13:36:24 +0200 | [diff] [blame] | 63 | #endif // LLDB_INTERPRETER_OPTIONVALUEUUID_H |