Oolite 1.91.0.7604-240417-a536cbe
Loading...
Searching...
No Matches
OOOXPVerifier.h
Go to the documentation of this file.
1/*
2
3OOOXPVerifier.h
4
5Oolite expansion pack verification manager.
6
7NOTE: the overall design is discussed in OXP verifier design.txt.
8
9
10Copyright (C) 2007-2013 Jens Ayton and contributors
11
12Permission is hereby granted, free of charge, to any person obtaining a copy
13of this software and associated documentation files (the "Software"), to deal
14in the Software without restriction, including without limitation the rights
15to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16copies of the Software, and to permit persons to whom the Software is
17furnished to do so, subject to the following conditions:
18
19The above copyright notice and this permission notice shall be included in all
20copies or substantial portions of the Software.
21
22THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28SOFTWARE.
29
30*/
31
32#ifndef OO_OXP_VERIFIER_ENABLED
33 #ifdef NDEBUG
34 #define OO_OXP_VERIFIER_ENABLED 0
35 #else
36 #define OO_OXP_VERIFIER_ENABLED 1
37 #endif
38#endif
39
40#if OO_OXP_VERIFIER_ENABLED
41
42#import "OOCocoa.h"
43
45
46
47@interface OOOXPVerifier: NSObject
48{
49@private
50 NSDictionary *_verifierPList;
51
52 NSString *_basePath;
53 NSString *_displayName;
54
55 NSMutableDictionary *_stagesByName;
56 NSMutableSet *_waitingStages;
57
59}
60
61/* Look for command-line arguments requesting OXP verification. If any are
62 found, run the verification and return YES. Otherwise, return NO.
63
64 At the moment, only one OXP may be verified per run; additional requests
65 are ignored.
66*/
67+ (BOOL)runVerificationIfRequested;
68
69
70/* Stage registration. Currently, stages are registered by OOOXPVerifier
71 itself. Stages may also register other stages - substages, as it were -
72 in their -initWithVerifier: methods, or when -dependencies or
73 -dependents are called. Registration at later points is not permitted.
74*/
75- (void)registerStage:(OOOXPVerifierStage *)stage;
76
77
78// All other methods are for use by verifier stages.
79- (NSString *)oxpPath;
80- (NSString *)oxpDisplayName;
81
82- (id)stageWithName:(NSString *)name;
83
84// Read from verifyOXP.plist
85- (id)configurationValueForKey:(NSString *)key;
86- (NSArray *)configurationArrayForKey:(NSString *)key;
87- (NSDictionary *)configurationDictionaryForKey:(NSString *)key;
88- (NSString *)configurationStringForKey:(NSString *)key;
89- (NSSet *)configurationSetForKey:(NSString *)key;
90
91@end
92
93#endif
NSDictionary * _verifierPList
NSMutableDictionary * _stagesByName
BOOL _openForRegistration
NSString * _displayName
NSMutableSet * _waitingStages
NSString * _basePath