/* Cydia - iPhone UIKit Front-End for Debian APT
- * Copyright (C) 2008-2014 Jay Freeman (saurik)
+ * Copyright (C) 2008-2015 Jay Freeman (saurik)
*/
/* GNU General Public License, Version 3 {{{ */
#include <unicode/uregex.h>
#include "CyteKit/UCPlatform.h"
-#include "CyteKit/stringWithUTF8Bytes.h"
+#include "CyteKit/stringWith.h"
#define _rgxcall(code, args...) ({ \
UErrorCode status(U_ZERO_ERROR); \
{
}
- RegEx(const char *regex, NSString *data = nil) :
+ RegEx(const char *regex) :
regex_(NULL),
size_(_not(size_t))
{
this->operator =(regex);
+ }
- if (data != nil)
- this->operator ()(data);
+ template <typename Type_>
+ RegEx(const char *regex, const Type_ &data) :
+ RegEx(regex)
+ {
+ this->operator ()(data);
}
void operator =(const char *regex) {
id values[capture_];
for (int i(0); i != capture_; ++i)
values[i] = this->operator [](i + 1);
- return [[[NSString alloc] initWithFormat:format arguments:reinterpret_cast<va_list>(values)] autorelease];
+ return [NSString stringWithFormat:format :capture_ :values];
}
};