@@ -105,36 +105,6 @@ - (nonnull void *) getArchives {
105105 return self.archives;
106106}
107107
108- # pragma mark - Spelling
109- - (SpellingsDBWrapper *_Nullable)spellingsDBFor:(NSUUID *)zimFileID cachePath:(NSString *)contentPath {
110-
111- zim::Archive *archive = [self archiveBy: zimFileID];
112- if (archive == nil ) {
113- NSLog (@" cannot find ZIM by ID: %@ (%@ )" , zimFileID.UUIDString, contentPath);
114- return nil ;
115- }
116- try {
117- @synchronized (self) {
118- NSLog (@" createSpellingIndex for:%@ , in: %@ " , zimFileID.UUIDString, contentPath);
119- // this should be safe for utf-8, it comes from swift URL.path(percentEncoded=True)
120- std::filesystem::path path = std::filesystem::path ([contentPath cStringUsingEncoding: NSUTF8StringEncoding]);
121- auto db = std::make_unique<kiwix::SpellingsDB>(*archive, path);
122- SpellingsDBWrapper *wrapper = [[SpellingsDBWrapper alloc ] initWithDB: std::move (db)];
123- return wrapper;
124- }
125- } catch (std::exception e) {
126- NSLog (@" create spelling index exception: %s " , e.what());
127- return nil ;
128- } catch (Xapian::DatabaseError e) {
129- NSLog (@" create spelling index exception no database found: %s " , e.get_description().c_str());
130- return nil ;
131- }
132- }
133-
134- - (void ) createSpellingIndex:(NSUUID *)zimFileID cachePath:(NSString *)contentPath {
135- [self spellingsDBFor: zimFileID cachePath: contentPath];
136- }
137-
138108# pragma mark - Metadata
139109
140110+ (ZimFileMetaData *_Nullable)getMetaDataWithFileURL:(NSURL *)url {
@@ -255,10 +225,10 @@ - (NSDictionary *)getContent:(NSUUID *)zimFileID contentPath:(NSString *)content
255225- (NSDictionary *_Nullable) getDirectAccess: (NSUUID *)zimFileID contentPath:(NSString *)contentPath {
256226 try {
257227 zim::Item item = [self itemIn: zimFileID contentPath: contentPath];
258- zim::ItemDataDirectAccessInfo info = item.getDirectAccessInformation ();
228+ zim::Item::DirectAccessInfo info = item.getDirectAccessInformation ();
259229 return @{
260- @" path" : [NSString stringWithUTF8String: info.filename .c_str ()],
261- @" offset" : [NSNumber numberWithUnsignedLong: info.offset ]
230+ @" path" : [NSString stringWithUTF8String: info.first .c_str ()],
231+ @" offset" : [NSNumber numberWithUnsignedLong: info.second ]
262232 };
263233 } catch (std::exception) {
264234 return nil ;
0 commit comments