45+ (NSArray *)worldScriptsAtPath:(NSString *)path
47 NSFileManager *fmgr =
nil;
48 NSString *filePath =
nil;
50 NSArray *result =
nil;
52 BOOL foundScript = NO;
57 filePath = [
path stringByAppendingPathComponent:@"world-scripts.plist"];
71 filePath = [
path stringByAppendingPathComponent:@"script.js"];
72 if ([fmgr oo_oxzFileExistsAtPath:filePath]) foundScript = YES;
75 filePath = [
path stringByAppendingPathComponent:@"script.es"];
76 if ([fmgr oo_oxzFileExistsAtPath:filePath]) foundScript = YES;
86 result = [
NSArray arrayWithObject:script];
98 filePath = [
path stringByAppendingPathComponent:@"script.plist"];
99 if ([fmgr oo_oxzFileExistsAtPath:filePath])
117 if (result ==
nil && foundScript)
45+ (NSArray *)worldScriptsAtPath:(NSString *)path {
…}
126+ (NSArray *)scriptsFromFileNamed:(NSString *)fileName
128 NSArray *result =
nil;
137 OOLogERR(
@"script.load.notFound",
@"Could not find script file %@.", fileName);
126+ (NSArray *)scriptsFromFileNamed:(NSString *)fileName {
…}
144+ (NSArray *)scriptsFromList:(NSArray *)fileNames
146 NSEnumerator *nameEnum =
nil;
148 NSMutableArray *result =
nil;
149 NSArray *scripts =
nil;
153 for (nameEnum = [fileNames objectEnumerator]; (
name = [
nameEnum nextObject]); )
156 if (scripts !=
nil) [
result addObjectsFromArray:scripts];
144+ (NSArray *)scriptsFromList:(NSArray *)fileNames {
…}
163+ (NSArray *)scriptsFromFileAtPath:(NSString *)filePath
166 if (![[NSFileManager defaultManager] oo_oxzFileExistsAtPath:filePath])
return nil;
168 NSString *extension = [[
filePath pathExtension] lowercaseString];
170 if ([extension isEqualToString:
@"js"] || [extension isEqualToString:
@"es"])
172 NSArray *result =
nil;
174 if (script !=
nil) result = [
NSArray arrayWithObject:script];
177 else if ([extension isEqualToString:
@"plist"])
187 OOLogERR(
@"script.load.badName",
@"Don't know how to load a script from %@.", filePath);
163+ (NSArray *)scriptsFromFileAtPath:(NSString *)filePath {
…}
192+ (id)jsScriptFromFileNamed:(NSString *)fileName properties:(NSDictionary *)properties
194 NSString *extension =
nil;
195 NSString *path =
nil;
197 if ([fileName length] == 0)
return nil;
199 extension = [[
fileName pathExtension] lowercaseString];
200 if ([extension isEqualToString:
@"js"] || [extension isEqualToString:
@"es"])
205 OOLogERR(
@"script.load.notFound",
@"Could not find script file %@.", fileName);
210 else if ([extension isEqualToString:
@"plist"])
212 OOLogERR(
@"script.load.badName",
@"Can't load script named %@ - legacy scripts are not supported in this context.", fileName);
216 OOLogERR(
@"script.load.badName",
@"Don't know how to load a script from %@.", fileName);
192+ (id)jsScriptFromFileNamed:(NSString *)fileName properties:(NSDictionary *)properties {
…}
221+ (id)jsAIScriptFromFileNamed:(NSString *)fileName properties:(NSDictionary *)properties
223 NSString *extension =
nil;
224 NSString *path =
nil;
226 if ([fileName length] == 0)
return nil;
228 extension = [[
fileName pathExtension] lowercaseString];
229 if ([extension isEqualToString:
@"js"] || [extension isEqualToString:
@"es"])
234 OOLogERR(
@"script.load.notFound",
@"Could not find script file %@.", fileName);
239 else if ([extension isEqualToString:
@"plist"])
241 OOLogERR(
@"script.load.badName",
@"Can't load script named %@ - legacy scripts are not supported in this context.", fileName);
245 OOLogERR(
@"script.load.badName",
@"Don't know how to load a script from %@.", fileName);
221+ (id)jsAIScriptFromFileNamed:(NSString *)fileName properties:(NSDictionary *)properties {
…}
void OOStandardsDeprecated(NSString *message)
BOOL OOEnforceStandards(void)
#define OOLogERR(class, format,...)
#define OOLogOutdentIf(class)
#define OOLog(class, format,...)
#define OOLogIndentIf(class)
NSString *const kOOLogSubclassResponsibility
NSArray * OOArrayFromFile(NSString *path)
static NSString *const kOOLogLoadScriptPList
static NSString *const kOOLogLoadScriptNone
static NSString *const kOOLogLoadScriptOK
static NSString *const kOOLogLoadScriptParseError
static NSString *const kOOLogLoadScriptJavaScript
id scriptWithPath:properties:(NSString *path,[properties] NSDictionary *properties)
NSArray * scriptsInPListFile:(NSString *filePath)
NSArray * scriptsFromList:(NSArray *fileNames)
NSString * scriptDescription()
NSString * descriptionComponents()
NSArray * scriptsFromFileNamed:(NSString *fileName)
NSArray * scriptsFromFileAtPath:(NSString *filePath)
NSString * pathForFileNamed:inFolder:(NSString *fileName,[inFolder] NSString *folderName)