Home | History | Annotate | Download | only in Interpreter
      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/Target/PathMappingList.h"
     18 #include "lldb/Interpreter/OptionValue.h"
     19 
     20 namespace lldb_private {
     21 
     22 class OptionValuePathMappings : public OptionValue
     23 {
     24 public:
     25     OptionValuePathMappings (bool notify_changes) :
     26         OptionValue(),
     27         m_path_mappings (),
     28         m_notify_changes (notify_changes)
     29     {
     30     }
     31 
     32     virtual
     33     ~OptionValuePathMappings()
     34     {
     35     }
     36 
     37     //---------------------------------------------------------------------
     38     // Virtual subclass pure virtual overrides
     39     //---------------------------------------------------------------------
     40 
     41     virtual OptionValue::Type
     42     GetType () const
     43     {
     44         return eTypePathMap;
     45     }
     46 
     47     virtual void
     48     DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask);
     49 
     50     virtual Error
     51     SetValueFromCString (const char *value,
     52                          VarSetOperationType op = eVarSetOperationAssign);
     53 
     54     virtual bool
     55     Clear ()
     56     {
     57         m_path_mappings.Clear(m_notify_changes);
     58         m_value_was_set = false;
     59         return true;
     60     }
     61 
     62     virtual lldb::OptionValueSP
     63     DeepCopy () const;
     64 
     65     virtual bool
     66     IsAggregateValue () const
     67     {
     68         return true;
     69     }
     70 
     71     //---------------------------------------------------------------------
     72     // Subclass specific functions
     73     //---------------------------------------------------------------------
     74 
     75     PathMappingList &
     76     GetCurrentValue()
     77     {
     78         return m_path_mappings;
     79     }
     80 
     81     const PathMappingList &
     82     GetCurrentValue() const
     83     {
     84         return m_path_mappings;
     85     }
     86 
     87 protected:
     88     PathMappingList m_path_mappings;
     89     bool m_notify_changes;
     90 };
     91 
     92 } // namespace lldb_private
     93 
     94 #endif  // liblldb_OptionValuePathMappings_h_
     95