Oolite 1.91.0.7646-241128-10e222e
Loading...
Searching...
No Matches
OOOXZManager(OOFilterRules) Category Reference

Instance Methods

(BOOL) - applyFilterByNoFilter:
 
(BOOL) - applyFilterByUpdateRequired:
 
(BOOL) - applyFilterByInstallable:
 
(BOOL) - applyFilterByKeyword:keyword:
 
(BOOL) - applyFilterByAuthor:author:
 
(BOOL) - applyFilterByDays:days:
 
(BOOL) - applyFilterByTag:tag:
 
(BOOL) - applyFilterByCategory:category:
 

Detailed Description

Definition at line 170 of file OOOXZManager.m.

Method Documentation

◆ applyFilterByAuthor:author:

- (BOOL) applyFilterByAuthor: (NSDictionary *) manifest
author: (NSString *) author 

Extends class OOOXZManager.

Definition at line 2358 of file OOOXZManager.m.

483 :(NSDictionary *)manifest author:(NSString *)author
484{
485 // trim any eventual leading whitespace from input string
486 author = [author stringByTrimmingLeadingWhitespaceAndNewlineCharacters];
487
488 NSString *mAuth = [manifest oo_stringForKey:kOOManifestAuthor];
489 return ([mAuth rangeOfString:author options:NSCaseInsensitiveSearch].location != NSNotFound);
490}

◆ applyFilterByCategory:category:

- (BOOL) applyFilterByCategory: (NSDictionary *) manifest
category: (NSString *) category 

Extends class OOOXZManager.

Definition at line 2358 of file OOOXZManager.m.

529 :(NSDictionary *)manifest category:(NSString *)category
530{
531 // trim any eventual leading whitespace from input string
532 category = [category stringByTrimmingLeadingWhitespaceAndNewlineCharacters];
533
534 NSString *mCategory = [manifest oo_stringForKey:kOOManifestCategory];
535 return ([mCategory rangeOfString:category options:NSCaseInsensitiveSearch].location != NSNotFound);
536}

◆ applyFilterByDays:days:

- (BOOL) applyFilterByDays: (NSDictionary *) manifest
days: (NSString *) days 

Extends class OOOXZManager.

Definition at line 2358 of file OOOXZManager.m.

493 :(NSDictionary *)manifest days:(NSString *)days
494{
495 NSInteger i = [days integerValue];
496 if (i < 1)
497 {
498 return NO;
499 }
500 else
501 {
502 NSUInteger updated = [manifest oo_unsignedIntegerForKey:kOOManifestUploadDate];
503 NSUInteger now = (NSUInteger)[[NSDate date] timeIntervalSince1970];
504 return (updated + (86400 * i) > now);
505 }
506}

◆ applyFilterByInstallable:

- (BOOL) applyFilterByInstallable: (NSDictionary *) manifest

Extends class OOOXZManager.

Definition at line 2358 of file OOOXZManager.m.

448 :(NSDictionary *)manifest
449{
450 return ([self installableState:manifest] < OXZ_UNINSTALLABLE_ALREADY);
451}
@ OXZ_UNINSTALLABLE_ALREADY

◆ applyFilterByKeyword:keyword:

- (BOOL) applyFilterByKeyword: (NSDictionary *) manifest
keyword: (NSString *) keyword 

Extends class OOOXZManager.

Definition at line 2358 of file OOOXZManager.m.

454 :(NSDictionary *)manifest keyword:(NSString *)keyword
455{
456 NSString *parameter = nil;
457 NSArray *parameters = [NSArray arrayWithObjects:kOOManifestTitle,kOOManifestDescription,kOOManifestCategory,nil];
458
459 // trim any eventual leading whitespace from input string
460 keyword = [keyword stringByTrimmingLeadingWhitespaceAndNewlineCharacters];
461
462 foreach (parameter,parameters)
463 {
464 if ([[manifest oo_stringForKey:parameter] rangeOfString:keyword options:NSCaseInsensitiveSearch].location != NSNotFound)
465 {
466 return YES;
467 }
468 }
469 // tags are slightly different
470 parameters = [manifest oo_arrayForKey:kOOManifestTags];
471 foreach (parameter,parameters)
472 {
473 if ([parameter rangeOfString:keyword options:NSCaseInsensitiveSearch].location != NSNotFound)
474 {
475 return YES;
476 }
477 }
478
479 return NO;
480}
return nil

◆ applyFilterByNoFilter:

- (BOOL) applyFilterByNoFilter: (NSDictionary *) manifest

Extends class OOOXZManager.

Definition at line 2358 of file OOOXZManager.m.

436 :(NSDictionary *)manifest
437{
438 return YES;
439}

◆ applyFilterByTag:tag:

- (BOOL) applyFilterByTag: (NSDictionary *) manifest
tag: (NSString *) tag 

Extends class OOOXZManager.

Definition at line 2358 of file OOOXZManager.m.

509 :(NSDictionary *)manifest tag:(NSString *)tag
510{
511 NSString *parameter = nil;
512 NSArray *parameters = [manifest oo_arrayForKey:kOOManifestTags];
513
514 // trim any eventual leading whitespace from input string
515 tag = [tag stringByTrimmingLeadingWhitespaceAndNewlineCharacters];
516
517 foreach (parameter,parameters)
518 {
519 if ([parameter rangeOfString:tag options:NSCaseInsensitiveSearch].location != NSNotFound)
520 {
521 return YES;
522 }
523 }
524
525 return NO;
526}

◆ applyFilterByUpdateRequired:

- (BOOL) applyFilterByUpdateRequired: (NSDictionary *) manifest

Extends class OOOXZManager.

Definition at line 2358 of file OOOXZManager.m.

442 :(NSDictionary *)manifest
443{
444 return ([self installableState:manifest] == OXZ_INSTALLABLE_UPDATE);
445}
@ OXZ_INSTALLABLE_UPDATE

The documentation for this category was generated from the following file: