From 36d11fcb440ba86ddb2c1016a781cc1b9ea620e0 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Mon, 16 Nov 2015 19:25:09 -0800 Subject: [PATCH] Provide toCYON for NSOrderedSet (just like NSSet). --- ObjectiveC/Library.mm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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 {{{ */ -- 2.47.2