supply a default constructor
This commit is contained in:
@@ -667,17 +667,23 @@ void Regex::Compile()
|
|||||||
ASSERT(backrefs+1 < 128);
|
ASSERT(backrefs+1 < 128);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Regex::Set(const CString &str)
|
||||||
|
{
|
||||||
|
Release();
|
||||||
|
pattern=str;
|
||||||
|
Compile();
|
||||||
|
}
|
||||||
|
|
||||||
void Regex::Release()
|
void Regex::Release()
|
||||||
{
|
{
|
||||||
delete (regex_t *)reg;
|
delete (regex_t *)reg;
|
||||||
reg = NULL;
|
reg = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
Regex::Regex(const CString &pattern_)
|
Regex::Regex(const CString &str)
|
||||||
{
|
{
|
||||||
reg = NULL;
|
reg = NULL;
|
||||||
pattern=pattern_;
|
Set(str);
|
||||||
Compile();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Regex::Regex(const Regex &rhs)
|
Regex::Regex(const Regex &rhs)
|
||||||
|
|||||||
@@ -207,9 +207,10 @@ class Regex {
|
|||||||
void Compile();
|
void Compile();
|
||||||
void Release();
|
void Release();
|
||||||
public:
|
public:
|
||||||
Regex(const CString &pat);
|
Regex(const CString &pat = "");
|
||||||
Regex(const Regex &rhs);
|
Regex(const Regex &rhs);
|
||||||
~Regex();
|
~Regex();
|
||||||
|
void Set(const CString &str);
|
||||||
bool Compare(const CString &str);
|
bool Compare(const CString &str);
|
||||||
bool Compare(const CString &str, vector<CString> &matches);
|
bool Compare(const CString &str, vector<CString> &matches);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user