diff options
Diffstat (limited to 'bindings/objc/src/SwordListKey.mm')
-rw-r--r-- | bindings/objc/src/SwordListKey.mm | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/bindings/objc/src/SwordListKey.mm b/bindings/objc/src/SwordListKey.mm index 07aa8f8..dfe0150 100644 --- a/bindings/objc/src/SwordListKey.mm +++ b/bindings/objc/src/SwordListKey.mm @@ -11,23 +11,23 @@ @implementation SwordListKey + (SwordListKey *)listKeyWithRef:(NSString *)aRef { - return [[[SwordListKey alloc] initWithRef:aRef] autorelease]; + return [[SwordListKey alloc] initWithRef:aRef]; } + (SwordListKey *)listKeyWithRef:(NSString *)aRef v11n:(NSString *)scheme { - return [[[SwordListKey alloc] initWithRef:aRef v11n:scheme] autorelease]; + return [[SwordListKey alloc] initWithRef:aRef v11n:scheme]; } + (SwordListKey *)listKeyWithRef:(NSString *)aRef headings:(BOOL)headings v11n:(NSString *)scheme { - return [[[SwordListKey alloc] initWithRef:aRef headings:headings v11n:scheme] autorelease]; + return [[SwordListKey alloc] initWithRef:aRef headings:headings v11n:scheme]; } + (SwordListKey *)listKeyWithSWListKey:(sword::ListKey *)aLk { - return [[[SwordListKey alloc] initWithSWListKey:aLk] autorelease]; + return [[SwordListKey alloc] initWithSWListKey:aLk]; } + (SwordListKey *)listKeyWithSWListKey:(sword::ListKey *)aLk makeCopy:(BOOL)copy { - return [[[SwordListKey alloc] initWithSWListKey:aLk makeCopy:copy] autorelease]; + return [[SwordListKey alloc] initWithSWListKey:aLk makeCopy:copy]; } - (id)init { @@ -52,49 +52,40 @@ - (SwordListKey *)initWithRef:(NSString *)aRef headings:(BOOL)headings v11n:(NSString *)scheme { sword::VerseKey vk; - vk.Headings((char)headings); + vk.setIntros((char)headings); if(scheme) { vk.setVersificationSystem([scheme UTF8String]); } - sword::ListKey listKey = vk.ParseVerseList([aRef UTF8String], "gen", true); + sword::ListKey listKey = vk.parseVerseList([aRef UTF8String], "gen", true); sword::ListKey *lk = new sword::ListKey(listKey); - return (SwordListKey *) [super initWithSWKey:lk]; -} + lk->setPersist(true); -- (void)finalize { - [super finalize]; -} - -- (void)dealloc { - [super dealloc]; + return (SwordListKey *) [super initWithSWKey:lk]; } - (NSInteger)numberOfVerses { NSInteger ret = 0; - if(sk) { - for(*sk = sword::TOP; !sk->Error(); *sk++) ret++; + for(*sk = sword::TOP; !sk->popError(); *sk++) ret++; } - return ret; } - (void)parse { - } - (void)parseWithHeaders { } - (VerseEnumerator *)verseEnumerator { - return [[[VerseEnumerator alloc] initWithListKey:self] autorelease]; + return [[VerseEnumerator alloc] initWithListKey:self]; } - (BOOL)containsKey:(SwordVerseKey *)aVerseKey { BOOL ret = NO; if(sk) { *sk = [[aVerseKey osisRef] UTF8String]; - ret = !sk->Error(); + ret = !sk->popError(); } return ret; } |