OptionValuePathMappings.h revision 321369
1//===-- OptionValuePathMappings.h -------------------------------*- C++ -*-===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef liblldb_OptionValuePathMappings_h_
11#define liblldb_OptionValuePathMappings_h_
12
13// C Includes
14// C++ Includes
15// Other libraries and framework includes
16// Project includes
17#include "lldb/Interpreter/OptionValue.h"
18#include "lldb/Target/PathMappingList.h"
19
20namespace lldb_private {
21
22class OptionValuePathMappings : public OptionValue {
23public:
24  OptionValuePathMappings(bool notify_changes)
25      : OptionValue(), m_path_mappings(), m_notify_changes(notify_changes) {}
26
27  ~OptionValuePathMappings() override {}
28
29  //---------------------------------------------------------------------
30  // Virtual subclass pure virtual overrides
31  //---------------------------------------------------------------------
32
33  OptionValue::Type GetType() const override { return eTypePathMap; }
34
35  void DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
36                 uint32_t dump_mask) override;
37
38  Status
39  SetValueFromString(llvm::StringRef value,
40                     VarSetOperationType op = eVarSetOperationAssign) override;
41  Status
42  SetValueFromString(const char *,
43                     VarSetOperationType = eVarSetOperationAssign) = delete;
44
45  bool Clear() override {
46    m_path_mappings.Clear(m_notify_changes);
47    m_value_was_set = false;
48    return true;
49  }
50
51  lldb::OptionValueSP DeepCopy() const override;
52
53  bool IsAggregateValue() const override { return true; }
54
55  //---------------------------------------------------------------------
56  // Subclass specific functions
57  //---------------------------------------------------------------------
58
59  PathMappingList &GetCurrentValue() { return m_path_mappings; }
60
61  const PathMappingList &GetCurrentValue() const { return m_path_mappings; }
62
63protected:
64  PathMappingList m_path_mappings;
65  bool m_notify_changes;
66};
67
68} // namespace lldb_private
69
70#endif // liblldb_OptionValuePathMappings_h_
71