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_
13 #include "lldb/Interpreter/OptionValue.h"
14 #include "lldb/Target/PathMappingList.h"
16 namespace lldb_private {
18 class OptionValuePathMappings : public OptionValue {
20 OptionValuePathMappings(bool notify_changes)
21 : OptionValue(), m_path_mappings(), m_notify_changes(notify_changes) {}
23 ~OptionValuePathMappings() override {}
25 //---------------------------------------------------------------------
26 // Virtual subclass pure virtual overrides
27 //---------------------------------------------------------------------
29 OptionValue::Type GetType() const override { return eTypePathMap; }
31 void DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
32 uint32_t dump_mask) override;
35 SetValueFromString(llvm::StringRef value,
36 VarSetOperationType op = eVarSetOperationAssign) override;
38 SetValueFromString(const char *,
39 VarSetOperationType = eVarSetOperationAssign) = delete;
41 bool Clear() override {
42 m_path_mappings.Clear(m_notify_changes);
43 m_value_was_set = false;
47 lldb::OptionValueSP DeepCopy() const override;
49 bool IsAggregateValue() const override { return true; }
51 //---------------------------------------------------------------------
52 // Subclass specific functions
53 //---------------------------------------------------------------------
55 PathMappingList &GetCurrentValue() { return m_path_mappings; }
57 const PathMappingList &GetCurrentValue() const { return m_path_mappings; }
60 PathMappingList m_path_mappings;
61 bool m_notify_changes;
64 } // namespace lldb_private
66 #endif // liblldb_OptionValuePathMappings_h_