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_
15 // Other libraries and framework includes
17 #include "lldb/Core/RegularExpression.h"
18 #include "lldb/Interpreter/OptionValue.h"
20 namespace lldb_private {
22 class OptionValueRegex : public OptionValue
25 OptionValueRegex(const char *value = nullptr) :
31 ~OptionValueRegex() override = default;
33 //---------------------------------------------------------------------
34 // Virtual subclass pure virtual overrides
35 //---------------------------------------------------------------------
38 GetType() const override
44 DumpValue(const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask) override;
47 SetValueFromString(llvm::StringRef value,
48 VarSetOperationType op = eVarSetOperationAssign) override;
54 m_value_was_set = false;
59 DeepCopy() const override;
61 //---------------------------------------------------------------------
62 // Subclass specific functions
63 //---------------------------------------------------------------------
64 const RegularExpression *
65 GetCurrentValue() const
67 return (m_regex.IsValid() ? &m_regex : nullptr);
71 SetCurrentValue (const char *value)
73 if (value && value[0])
74 m_regex.Compile (value);
82 return m_regex.IsValid();
86 RegularExpression m_regex;
89 } // namespace lldb_private
91 #endif // liblldb_OptionValueRegex_h_