From 2303e8cd3e742f58dc91e8a9660e79d477848232 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 27 Mar 2003 20:16:17 +0000 Subject: [PATCH] supply a default constructor --- stepmania/src/RageUtil.cpp | 12 +++++++++--- stepmania/src/RageUtil.h | 3 ++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/stepmania/src/RageUtil.cpp b/stepmania/src/RageUtil.cpp index 77f6b5ab03..1d4233ed96 100644 --- a/stepmania/src/RageUtil.cpp +++ b/stepmania/src/RageUtil.cpp @@ -667,17 +667,23 @@ void Regex::Compile() ASSERT(backrefs+1 < 128); } +void Regex::Set(const CString &str) +{ + Release(); + pattern=str; + Compile(); +} + void Regex::Release() { delete (regex_t *)reg; reg = NULL; } -Regex::Regex(const CString &pattern_) +Regex::Regex(const CString &str) { reg = NULL; - pattern=pattern_; - Compile(); + Set(str); } Regex::Regex(const Regex &rhs) diff --git a/stepmania/src/RageUtil.h b/stepmania/src/RageUtil.h index d67e69f27f..16dfc3be5f 100644 --- a/stepmania/src/RageUtil.h +++ b/stepmania/src/RageUtil.h @@ -207,9 +207,10 @@ class Regex { void Compile(); void Release(); public: - Regex(const CString &pat); + Regex(const CString &pat = ""); Regex(const Regex &rhs); ~Regex(); + void Set(const CString &str); bool Compare(const CString &str); bool Compare(const CString &str, vector &matches); };