sundry accessors/cast-ers; RE_Matcher's track their construction values

This commit is contained in:
Vern Paxson 2021-03-18 10:33:10 -07:00
parent 17affdb858
commit d53d2ac755
8 changed files with 50 additions and 3 deletions

View file

@ -197,6 +197,7 @@ public:
// Makes the matcher as specified to date case-insensitive.
void MakeCaseInsensitive();
bool IsCaseInsensitive() const { return is_case_insensitive; }
bool Compile(bool lazy = false);
@ -227,6 +228,10 @@ public:
const char* PatternText() const { return re_exact->PatternText(); }
const char* AnywherePatternText() const { return re_anywhere->PatternText(); }
// Original text used to construct this matcher. Empty unless
// the main ("explicit") constructor was used.
const char* OrigText() const { return orig_text.c_str(); }
unsigned int MemoryAllocation() const
{
return padded_sizeof(*this)
@ -235,8 +240,12 @@ public:
}
protected:
std::string orig_text;
detail::Specific_RE_Matcher* re_anywhere;
detail::Specific_RE_Matcher* re_exact;
bool is_case_insensitive = false;
};
} // namespace zeek