1 //===-- OptionValueRegex.h --------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_OptionValueRegex_h_
11 #define liblldb_OptionValueRegex_h_
17 // Other libraries and framework includes
19 #include "lldb/Core/RegularExpression.h"
20 #include "lldb/Interpreter/OptionValue.h"
22 namespace lldb_private {
24 class OptionValueRegex : public OptionValue
27 OptionValueRegex (const char *value = NULL) :
38 //---------------------------------------------------------------------
39 // Virtual subclass pure virtual overrides
40 //---------------------------------------------------------------------
42 virtual OptionValue::Type
49 DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask);
52 SetValueFromString (llvm::StringRef value,
53 VarSetOperationType op = eVarSetOperationAssign);
59 m_value_was_set = false;
63 virtual lldb::OptionValueSP
66 //---------------------------------------------------------------------
67 // Subclass specific functions
68 //---------------------------------------------------------------------
69 const RegularExpression *
70 GetCurrentValue() const
72 if (m_regex.IsValid())
78 SetCurrentValue (const char *value)
80 if (value && value[0])
81 m_regex.Compile (value);
89 return m_regex.IsValid();
93 RegularExpression m_regex;
96 } // namespace lldb_private
98 #endif // liblldb_OptionValueRegex_h_