OptionValuePathMappings.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. #ifndef LLDB_INTERPRETER_OPTIONVALUEPATHMAPPINGS_H
  9. #define LLDB_INTERPRETER_OPTIONVALUEPATHMAPPINGS_H
  10. #include "lldb/Interpreter/OptionValue.h"
  11. #include "lldb/Target/PathMappingList.h"
  12. namespace lldb_private {
  13. class OptionValuePathMappings
  14. : public Cloneable<OptionValuePathMappings, OptionValue> {
  15. public:
  16. OptionValuePathMappings(bool notify_changes)
  17. : m_notify_changes(notify_changes) {}
  18. ~OptionValuePathMappings() override = default;
  19. // Virtual subclass pure virtual overrides
  20. OptionValue::Type GetType() const override { return eTypePathMap; }
  21. void DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
  22. uint32_t dump_mask) override;
  23. Status
  24. SetValueFromString(llvm::StringRef value,
  25. VarSetOperationType op = eVarSetOperationAssign) override;
  26. void Clear() override {
  27. m_path_mappings.Clear(m_notify_changes);
  28. m_value_was_set = false;
  29. }
  30. bool IsAggregateValue() const override { return true; }
  31. // Subclass specific functions
  32. PathMappingList &GetCurrentValue() { return m_path_mappings; }
  33. const PathMappingList &GetCurrentValue() const { return m_path_mappings; }
  34. protected:
  35. PathMappingList m_path_mappings;
  36. bool m_notify_changes;
  37. };
  38. } // namespace lldb_private
  39. #endif // LLDB_INTERPRETER_OPTIONVALUEPATHMAPPINGS_H