+- (NSString *) state {
+@synchronized (database_) {
+ if ([database_ era] != era_ || file_.end())
+ return nil;
+
+ switch (iterator_->CurrentState) {
+ case pkgCache::State::NotInstalled:
+ return @"NotInstalled";
+ case pkgCache::State::UnPacked:
+ return @"UnPacked";
+ case pkgCache::State::HalfConfigured:
+ return @"HalfConfigured";
+ case pkgCache::State::HalfInstalled:
+ return @"HalfInstalled";
+ case pkgCache::State::ConfigFiles:
+ return @"ConfigFiles";
+ case pkgCache::State::Installed:
+ return @"Installed";
+ case pkgCache::State::TriggersAwaited:
+ return @"TriggersAwaited";
+ case pkgCache::State::TriggersPending:
+ return @"TriggersPending";
+ }
+
+ return (NSString *) [NSNull null];
+} }
+
+- (NSString *) selection {
+@synchronized (database_) {
+ if ([database_ era] != era_ || file_.end())
+ return nil;
+
+ switch (iterator_->SelectedState) {
+ case pkgCache::State::Unknown:
+ return @"Unknown";
+ case pkgCache::State::Install:
+ return @"Install";
+ case pkgCache::State::Hold:
+ return @"Hold";
+ case pkgCache::State::DeInstall:
+ return @"DeInstall";
+ case pkgCache::State::Purge:
+ return @"Purge";
+ }
+
+ return (NSString *) [NSNull null];
+} }
+