]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Interpreter/OptionValueUUID.h
Merge clang 7.0.1 and several follow-up changes
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Interpreter / OptionValueUUID.h
1 //===-- OptionValueUUID.h --------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef liblldb_OptionValueUUID_h_
11 #define liblldb_OptionValueUUID_h_
12
13 // C Includes
14 // C++ Includes
15 // Other libraries and framework includes
16 // Project includes
17 #include "lldb/Utility/UUID.h"
18 #include "lldb/Interpreter/OptionValue.h"
19
20 namespace lldb_private {
21
22 class OptionValueUUID : public OptionValue {
23 public:
24   OptionValueUUID() : OptionValue(), m_uuid() {}
25
26   OptionValueUUID(const UUID &uuid) : OptionValue(), m_uuid(uuid) {}
27
28   ~OptionValueUUID() override {}
29
30   //---------------------------------------------------------------------
31   // Virtual subclass pure virtual overrides
32   //---------------------------------------------------------------------
33
34   OptionValue::Type GetType() const override { return eTypeUUID; }
35
36   void DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
37                  uint32_t dump_mask) override;
38
39   Status
40   SetValueFromString(llvm::StringRef value,
41                      VarSetOperationType op = eVarSetOperationAssign) override;
42   Status
43   SetValueFromString(const char *,
44                      VarSetOperationType = eVarSetOperationAssign) = delete;
45
46   bool Clear() override {
47     m_uuid.Clear();
48     m_value_was_set = false;
49     return true;
50   }
51
52   lldb::OptionValueSP DeepCopy() const override;
53
54   //---------------------------------------------------------------------
55   // Subclass specific functions
56   //---------------------------------------------------------------------
57
58   UUID &GetCurrentValue() { return m_uuid; }
59
60   const UUID &GetCurrentValue() const { return m_uuid; }
61
62   void SetCurrentValue(const UUID &value) { m_uuid = value; }
63
64   size_t AutoComplete(CommandInterpreter &interpreter,
65                       CompletionRequest &request) override;
66
67 protected:
68   UUID m_uuid;
69 };
70
71 } // namespace lldb_private
72
73 #endif // liblldb_OptionValueUUID_h_