]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - include/lldb/Interpreter/OptionValuePathMappings.h
Vendor import of lldb trunk r351319 (just before the release_80 branch
[FreeBSD/FreeBSD.git] / include / lldb / Interpreter / OptionValuePathMappings.h
1 //===-- OptionValuePathMappings.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_OptionValuePathMappings_h_
11 #define liblldb_OptionValuePathMappings_h_
12
13 #include "lldb/Interpreter/OptionValue.h"
14 #include "lldb/Target/PathMappingList.h"
15
16 namespace lldb_private {
17
18 class OptionValuePathMappings : public OptionValue {
19 public:
20   OptionValuePathMappings(bool notify_changes)
21       : OptionValue(), m_path_mappings(), m_notify_changes(notify_changes) {}
22
23   ~OptionValuePathMappings() override {}
24
25   //---------------------------------------------------------------------
26   // Virtual subclass pure virtual overrides
27   //---------------------------------------------------------------------
28
29   OptionValue::Type GetType() const override { return eTypePathMap; }
30
31   void DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
32                  uint32_t dump_mask) override;
33
34   Status
35   SetValueFromString(llvm::StringRef value,
36                      VarSetOperationType op = eVarSetOperationAssign) override;
37   Status
38   SetValueFromString(const char *,
39                      VarSetOperationType = eVarSetOperationAssign) = delete;
40
41   bool Clear() override {
42     m_path_mappings.Clear(m_notify_changes);
43     m_value_was_set = false;
44     return true;
45   }
46
47   lldb::OptionValueSP DeepCopy() const override;
48
49   bool IsAggregateValue() const override { return true; }
50
51   //---------------------------------------------------------------------
52   // Subclass specific functions
53   //---------------------------------------------------------------------
54
55   PathMappingList &GetCurrentValue() { return m_path_mappings; }
56
57   const PathMappingList &GetCurrentValue() const { return m_path_mappings; }
58
59 protected:
60   PathMappingList m_path_mappings;
61   bool m_notify_changes;
62 };
63
64 } // namespace lldb_private
65
66 #endif // liblldb_OptionValuePathMappings_h_