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 #include "lldb/Utility/UUID.h"
14 #include "lldb/Interpreter/OptionValue.h"
15 
16 namespace lldb_private {
17 
18 class OptionValueUUID : public OptionValue {
19 public:
OptionValueUUID()20   OptionValueUUID() : OptionValue(), m_uuid() {}
21 
OptionValueUUID(const UUID & uuid)22   OptionValueUUID(const UUID &uuid) : OptionValue(), m_uuid(uuid) {}
23 
~OptionValueUUID()24   ~OptionValueUUID() override {}
25 
26   //---------------------------------------------------------------------
27   // Virtual subclass pure virtual overrides
28   //---------------------------------------------------------------------
29 
GetType()30   OptionValue::Type GetType() const override { return eTypeUUID; }
31 
32   void DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
33                  uint32_t dump_mask) override;
34 
35   Status
36   SetValueFromString(llvm::StringRef value,
37                      VarSetOperationType op = eVarSetOperationAssign) override;
38   Status
39   SetValueFromString(const char *,
40                      VarSetOperationType = eVarSetOperationAssign) = delete;
41 
Clear()42   bool Clear() override {
43     m_uuid.Clear();
44     m_value_was_set = false;
45     return true;
46   }
47 
48   lldb::OptionValueSP DeepCopy() const override;
49 
50   //---------------------------------------------------------------------
51   // Subclass specific functions
52   //---------------------------------------------------------------------
53 
GetCurrentValue()54   UUID &GetCurrentValue() { return m_uuid; }
55 
GetCurrentValue()56   const UUID &GetCurrentValue() const { return m_uuid; }
57 
SetCurrentValue(const UUID & value)58   void SetCurrentValue(const UUID &value) { m_uuid = value; }
59 
60   size_t AutoComplete(CommandInterpreter &interpreter,
61                       CompletionRequest &request) override;
62 
63 protected:
64   UUID m_uuid;
65 };
66 
67 } // namespace lldb_private
68 
69 #endif // liblldb_OptionValueUUID_h_
70