LLDB mainline
OptionValueUUID.h
Go to the documentation of this file.
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
9#ifndef LLDB_INTERPRETER_OPTIONVALUEUUID_H
10#define LLDB_INTERPRETER_OPTIONVALUEUUID_H
11
12#include "lldb/Utility/UUID.h"
14
15namespace lldb_private {
16
17class OptionValueUUID : public Cloneable<OptionValueUUID, OptionValue> {
18public:
19 OptionValueUUID() = default;
20
21 OptionValueUUID(const UUID &uuid) : m_uuid(uuid) {}
22
23 ~OptionValueUUID() override = default;
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 llvm::json::Value ToJSON(const ExecutionContext *exe_ctx) override {
33 return m_uuid.GetAsString();
34 }
35
36 Status
37 SetValueFromString(llvm::StringRef value,
39
40 void Clear() override {
41 m_uuid.Clear();
42 m_value_was_set = false;
43 }
44
45 // Subclass specific functions
46
48
49 const UUID &GetCurrentValue() const { return m_uuid; }
50
51 void SetCurrentValue(const UUID &value) { m_uuid = value; }
52
53 void AutoComplete(CommandInterpreter &interpreter,
54 CompletionRequest &request) override;
55
56protected:
58};
59
60} // namespace lldb_private
61
62#endif // LLDB_INTERPRETER_OPTIONVALUEUUID_H
A class that implements CRTP-based "virtual constructor" idiom.
Definition: Cloneable.h:40
"lldb/Utility/ArgCompletionRequest.h"
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
void SetCurrentValue(const UUID &value)
OptionValueUUID(const UUID &uuid)
~OptionValueUUID() override=default
const UUID & GetCurrentValue() const
Status SetValueFromString(llvm::StringRef value, VarSetOperationType op=eVarSetOperationAssign) override
void DumpValue(const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask) override
OptionValue::Type GetType() const override
llvm::json::Value ToJSON(const ExecutionContext *exe_ctx) override
void AutoComplete(CommandInterpreter &interpreter, CompletionRequest &request) override
An error handling class.
Definition: Status.h:44
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
void Clear()
Definition: UUID.h:62
std::string GetAsString(llvm::StringRef separator="-") const
Definition: UUID.cpp:49
A class that represents a running process on the host machine.
Definition: SBAttachInfo.h:14
VarSetOperationType
Settable state variable types.