summaryrefslogtreecommitdiff
path: root/MobileCydia.mm
diff options
context:
space:
mode:
Diffstat (limited to 'MobileCydia.mm')
-rw-r--r--MobileCydia.mm16
1 files changed, 16 insertions, 0 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index 24d9066..48163b0 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -2217,6 +2217,8 @@ struct PackageNameOrdering :
if (false);
else if (selector == @selector(clear))
return @"clear";
+ else if (selector == @selector(getField:))
+ return @"getField";
else if (selector == @selector(hasTag:))
return @"hasTag";
else if (selector == @selector(install))
@@ -2277,6 +2279,20 @@ struct PackageNameOrdering :
return relations;
} }
+- (NSString *) getField:(NSString *)name {
+@synchronized (database_) {
+ if ([database_ era] != era_ || file_.end())
+ return nil;
+
+ pkgRecords::Parser &parser([database_ records]->Lookup(file_));
+
+ const char *start, *end;
+ if (!parser.Find([name UTF8String], start, end))
+ return (NSString *) [NSNull null];
+
+ return [(NSString *) CYStringCreate(start, end - start) autorelease];
+} }
+
- (void) parse {
if (parsed_ != NULL)
return;