Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:42:50

0001 //===-- OptionValuePathMappings.h -------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLDB_INTERPRETER_OPTIONVALUEPATHMAPPINGS_H
0010 #define LLDB_INTERPRETER_OPTIONVALUEPATHMAPPINGS_H
0011 
0012 #include "lldb/Interpreter/OptionValue.h"
0013 #include "lldb/Target/PathMappingList.h"
0014 
0015 namespace lldb_private {
0016 
0017 class OptionValuePathMappings
0018     : public Cloneable<OptionValuePathMappings, OptionValue> {
0019 public:
0020   OptionValuePathMappings(bool notify_changes)
0021       : m_notify_changes(notify_changes) {}
0022 
0023   ~OptionValuePathMappings() override = default;
0024 
0025   // Virtual subclass pure virtual overrides
0026 
0027   OptionValue::Type GetType() const override { return eTypePathMap; }
0028 
0029   void DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
0030                  uint32_t dump_mask) override;
0031 
0032   llvm::json::Value ToJSON(const ExecutionContext *exe_ctx) override;
0033 
0034   Status
0035   SetValueFromString(llvm::StringRef value,
0036                      VarSetOperationType op = eVarSetOperationAssign) override;
0037 
0038   void Clear() override {
0039     m_path_mappings.Clear(m_notify_changes);
0040     m_value_was_set = false;
0041   }
0042 
0043   bool IsAggregateValue() const override { return true; }
0044 
0045   // Subclass specific functions
0046 
0047   PathMappingList &GetCurrentValue() { return m_path_mappings; }
0048 
0049   const PathMappingList &GetCurrentValue() const { return m_path_mappings; }
0050 
0051 protected:
0052   PathMappingList m_path_mappings;
0053   bool m_notify_changes;
0054 };
0055 
0056 } // namespace lldb_private
0057 
0058 #endif // LLDB_INTERPRETER_OPTIONVALUEPATHMAPPINGS_H