]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Interpreter/OptionValuePathMappings.h
Merge ^/head r305087 through r305219.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / 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 // C Includes
14 // C++ Includes
15 // Other libraries and framework includes
16 // Project includes
17 #include "lldb/Target/PathMappingList.h"
18 #include "lldb/Interpreter/OptionValue.h"
19
20 namespace lldb_private {
21
22 class OptionValuePathMappings : public OptionValue
23 {
24 public:
25     OptionValuePathMappings (bool notify_changes) :
26         OptionValue(),
27         m_path_mappings (),
28         m_notify_changes (notify_changes)
29     {
30     }
31     
32     ~OptionValuePathMappings() override
33     {
34     }
35     
36     //---------------------------------------------------------------------
37     // Virtual subclass pure virtual overrides
38     //---------------------------------------------------------------------
39     
40     OptionValue::Type
41     GetType() const override
42     {
43         return eTypePathMap;
44     }
45     
46     void
47     DumpValue(const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask) override;
48     
49     Error
50     SetValueFromString(llvm::StringRef value,
51                        VarSetOperationType op = eVarSetOperationAssign) override;
52     
53     bool
54     Clear() override
55     {
56         m_path_mappings.Clear(m_notify_changes);
57         m_value_was_set = false;
58         return true;
59     }
60     
61     lldb::OptionValueSP
62     DeepCopy() const override;
63     
64     bool
65     IsAggregateValue() const override
66     {
67         return true;
68     }
69
70     //---------------------------------------------------------------------
71     // Subclass specific functions
72     //---------------------------------------------------------------------
73     
74     PathMappingList &
75     GetCurrentValue()
76     {
77         return m_path_mappings;
78     }
79     
80     const PathMappingList &
81     GetCurrentValue() const
82     {
83         return m_path_mappings;
84     }
85     
86 protected:
87     PathMappingList m_path_mappings;
88     bool m_notify_changes;
89 };
90
91 } // namespace lldb_private
92
93 #endif // liblldb_OptionValuePathMappings_h_