1 //===-- OptionValuePathMappings.h -------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_OptionValuePathMappings_h_
11 #define liblldb_OptionValuePathMappings_h_
15 // Other libraries and framework includes
17 #include "lldb/Interpreter/OptionValue.h"
18 #include "lldb/Target/PathMappingList.h"
20 namespace lldb_private {
22 class OptionValuePathMappings : public OptionValue {
24 OptionValuePathMappings(bool notify_changes)
25 : OptionValue(), m_path_mappings(), m_notify_changes(notify_changes) {}
27 ~OptionValuePathMappings() override {}
29 //---------------------------------------------------------------------
30 // Virtual subclass pure virtual overrides
31 //---------------------------------------------------------------------
33 OptionValue::Type GetType() const override { return eTypePathMap; }
35 void DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
36 uint32_t dump_mask) override;
39 SetValueFromString(llvm::StringRef value,
40 VarSetOperationType op = eVarSetOperationAssign) override;
42 SetValueFromString(const char *,
43 VarSetOperationType = eVarSetOperationAssign) = delete;
45 bool Clear() override {
46 m_path_mappings.Clear(m_notify_changes);
47 m_value_was_set = false;
51 lldb::OptionValueSP DeepCopy() const override;
53 bool IsAggregateValue() const override { return true; }
55 //---------------------------------------------------------------------
56 // Subclass specific functions
57 //---------------------------------------------------------------------
59 PathMappingList &GetCurrentValue() { return m_path_mappings; }
61 const PathMappingList &GetCurrentValue() const { return m_path_mappings; }
64 PathMappingList m_path_mappings;
65 bool m_notify_changes;
68 } // namespace lldb_private
70 #endif // liblldb_OptionValuePathMappings_h_