1 //===-- OptionValuePathMappings.h -------------------------------*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 #ifndef LLDB_INTERPRETER_OPTIONVALUEPATHMAPPINGS_H 10 #define LLDB_INTERPRETER_OPTIONVALUEPATHMAPPINGS_H 11 12 #include "lldb/Interpreter/OptionValue.h" 13 #include "lldb/Target/PathMappingList.h" 14 15 namespace lldb_private { 16 17 class OptionValuePathMappings 18 : public Cloneable<OptionValuePathMappings, OptionValue> { 19 public: OptionValuePathMappings(bool notify_changes)20 OptionValuePathMappings(bool notify_changes) 21 : m_notify_changes(notify_changes) {} 22 23 ~OptionValuePathMappings() override = default; 24 25 // Virtual subclass pure virtual overrides 26 GetType()27 OptionValue::Type GetType() const override { return eTypePathMap; } 28 29 void DumpValue(const ExecutionContext *exe_ctx, Stream &strm, 30 uint32_t dump_mask) override; 31 32 llvm::json::Value ToJSON(const ExecutionContext *exe_ctx) override; 33 34 Status 35 SetValueFromString(llvm::StringRef value, 36 VarSetOperationType op = eVarSetOperationAssign) override; 37 Clear()38 void Clear() override { 39 m_path_mappings.Clear(m_notify_changes); 40 m_value_was_set = false; 41 } 42 IsAggregateValue()43 bool IsAggregateValue() const override { return true; } 44 45 // Subclass specific functions 46 GetCurrentValue()47 PathMappingList &GetCurrentValue() { return m_path_mappings; } 48 GetCurrentValue()49 const PathMappingList &GetCurrentValue() const { return m_path_mappings; } 50 51 protected: 52 PathMappingList m_path_mappings; 53 bool m_notify_changes; 54 }; 55 56 } // namespace lldb_private 57 58 #endif // LLDB_INTERPRETER_OPTIONVALUEPATHMAPPINGS_H 59