125 :(NSDictionary *)dictionary filePath:(NSString *)filePath
126{
127 NSMutableArray *result =
nil;
128 NSEnumerator *keyEnum =
nil;
130 NSArray *scriptArray =
nil;
131 NSDictionary *metadata =
nil;
132 NSMutableDictionary *cachedScripts =
nil;
134
135 NSUInteger
count = [dictionary count];
136 result = [NSMutableArray arrayWithCapacity:count];
137 cachedScripts = [NSMutableDictionary dictionaryWithCapacity:count];
138
139 metadata = [dictionary objectForKey:kKeyMetadata];
140 if (![metadata isKindOfClass:[NSDictionary
class]]) metadata =
nil;
141
142 for (keyEnum = [dictionary keyEnumerator]; (key = [keyEnum nextObject]); )
143 {
144 scriptArray = [dictionary objectForKey:key];
145 if ([key isKindOfClass:[NSString class]] &&
146 [scriptArray isKindOfClass:[NSArray class]] &&
148 {
150 if (scriptArray !=
nil)
151 {
152 script = [[self alloc] initWithName:key scriptArray:scriptArray metadata:metadata];
154 {
155 [result addObject:script];
156 [cachedScripts setObject:[NSDictionary dictionaryWithObjectsAndKeys:scriptArray, kKeyScript, metadata, kKeyMetadata, nil] forKey:key];
157
158 [script release];
159 }
160 }
161 }
162 }
163
165
166 return [[result copy] autorelease];
167}
NSArray * OOSanitizeLegacyScript(NSArray *script, NSString *context, BOOL allowAIMethods)
static NSString *const kKeyMetadata
void setObject:forKey:inCache:(id inElement,[forKey] NSString *inKey,[inCache] NSString *inCacheKey)
OOCacheManager * sharedCache()