7 |
|
#ifndef _Matcher_hpp_ |
8 |
|
#define _Matcher_hpp_ |
9 |
|
|
10 |
+ |
#ifdef MENES_PRAGMA_ONCE |
11 |
+ |
#pragma once |
12 |
+ |
#endif |
13 |
+ |
|
14 |
|
#include "Iffy.hpp" |
15 |
|
|
16 |
|
#include <pcre.h> |
25 |
|
Matcher(const ext::String& expression) : expression(NULL) { (*this)(expression); } |
26 |
|
~Matcher() { if (expression != NULL) pcre_free(expression); } |
27 |
|
bool match(const ext::String& stuff); |
28 |
< |
unsigned size(void) const { return substrings.GetSize(); } |
28 |
> |
size_t size(void) const { return substrings.GetSize(); } |
29 |
|
Matcher& operator()(const ext::String& expression); |
30 |
< |
const ext::String& operator[](unsigned index) const { return substrings[index]; } |
30 |
> |
const ext::String& operator[](size_t index) const { return substrings[index]; } |
31 |
|
operator ext::String() const { return substrings[0]; } |
32 |
|
bool operator==(const ext::String& stuff) { return match(stuff); } |
33 |
|
bool operator!=(const ext::String& stuff) { return !match(stuff); } |