From: Jay Freeman (saurik) Date: Tue, 17 Nov 2015 03:25:09 +0000 (-0800) Subject: Provide toCYON for NSOrderedSet (just like NSSet). X-Git-Tag: v0.9.590~314 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/36d11fcb440ba86ddb2c1016a781cc1b9ea620e0 Provide toCYON for NSOrderedSet (just like NSSet). --- diff --git a/ObjectiveC/Library.mm b/ObjectiveC/Library.mm index ca85258..dccc3ad 100644 --- a/ObjectiveC/Library.mm +++ b/ObjectiveC/Library.mm @@ -1083,6 +1083,21 @@ NSObject *CYCopyNSObject(CYPool &pool, JSContextRef context, JSValueRef value) { return true; } +@end +/* }}} */ +/* Bridge: NSOrderedSet {{{ */ +@implementation NSOrderedSet (Cycript) + +- (NSString *) cy$toCYON:(bool)objective inSet:(std::set &)objects { + _oassert(objects.insert(self).second); + + NSMutableString *json([[[NSMutableString alloc] init] autorelease]); + [json appendString:@"[NSOrderedSet orderedSetWithArray:"]; + [json appendString:CYCastNSCYON([self array], true, objects)]; + [json appendString:@"]]"]; + return json; +} + @end /* }}} */ /* Bridge: NSProxy {{{ */