]> git.saurik.com Git - cycript.git/commitdiff
Provide toCYON for NSOrderedSet (just like NSSet).
authorJay Freeman (saurik) <saurik@saurik.com>
Tue, 17 Nov 2015 03:25:09 +0000 (19:25 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Tue, 17 Nov 2015 03:25:09 +0000 (19:25 -0800)
ObjectiveC/Library.mm

index ca85258b272c1d8520a44f17f4fea31fa068f66f..dccc3ad3b8a9488f13d6dbd4a382604d8980067c 100644 (file)
@@ -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<void *> &)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 {{{ */