From: Jay Freeman (saurik) Date: Sun, 27 Feb 2011 22:18:34 +0000 (-0800) Subject: Clarify Pcre operator () helpers. X-Git-Tag: v1.1.0%b1~136 X-Git-Url: https://git.saurik.com/cydia.git/commitdiff_plain/3894bd28cb68484b6105a16823901c00433fe4ce?ds=inline Clarify Pcre operator () helpers. --- diff --git a/MobileCydia.mm b/MobileCydia.mm index ab75fc17..731f6aa3 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;