From 3894bd28cb68484b6105a16823901c00433fe4ce Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sun, 27 Feb 2011 14:18:34 -0800 Subject: Clarify Pcre operator () helpers. --- MobileCydia.mm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'MobileCydia.mm') diff --git a/MobileCydia.mm b/MobileCydia.mm index ab75fc1..731f6aa 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -882,11 +882,15 @@ class Pcre { return [NSString stringWithUTF8Bytes:(data_ + matches_[match * 2]) length:(matches_[match * 2 + 1] - matches_[match * 2])]; } - bool operator ()(NSString *data) { + _finline bool operator ()(NSString *data) { // XXX: length is for characters, not for bytes return operator ()([data UTF8String], [data length]); } + _finline bool operator ()(const char *data) { + return operator ()(data, strlen(data)); + } + bool operator ()(const char *data, size_t size) { data_ = data; return pcre_exec(code_, study_, data, size, 0, 0, matches_, (capture_ + 1) * 3) >= 0; -- cgit v1.2.3