30#if OO_OXP_VERIFIER_ENABLED
37#define PLIST_VERIFIER_DEBUG_DUMP_ENABLED 1
51#if PLIST_VERIFIER_DEBUG_DUMP_ENABLED
54#define DebugDumpIndent() \
59#define DebugDumpOutdent() \
64#define DebugDumpPushIndent() \
69#define DebugDumpPopIndent() \
74#define DebugDump(...) \
77 OOLog(@"verifyOXP.verbose.plistDebugDump", __VA_ARGS__); \
80#define DebugDumpIndent() \
83#define DebugDumpOutdent() \
86#define DebugDumpPushIndent() \
89#define DebugDumpPopIndent() \
92#define DebugDump(...) \
145 BackLinkChain result = { link, [NSNumber numberWithInteger:index] };
157static BOOL
ApplyStringTest(NSString*
string,
id test,
SEL testSelector, NSString* testDescription,
BackLinkChain keyPath, NSError** outError);
174@interface OOPListSchemaVerifier (OOPrivate)
177- (BOOL)delegateVerifierWithPropertyList:(
id)rootPList
178 named:(NSString*)name
179 testProperty:(
id)subPList
181 againstType:(NSString*)typeKey
182 error:(NSError**)outError;
184- (BOOL)delegateVerifierWithPropertyList:(
id)rootPList
185 named:(NSString*)name
186 failedForProperty:(
id)subPList
187 withError:(NSError*)error
188 expectedType:(NSDictionary*)localSchema;
190- (BOOL)verifyPList:(
id)rootPList
191 named:(NSString*)name
192 subProperty:(
id)subProperty
193 againstSchemaType:(
id)subSchema
195 tentative:(BOOL)tentative
196 error:(NSError**)outError
199- (NSDictionary*)resolveSchemaType:(
id)specifier
201 error:(NSError**)outError;
205@interface NSString (OOPListSchemaVerifierHelpers)
207- (BOOL)ooPListVerifierHasSubString:(NSString*)string;
211#define VERIFY_PROTO(T) static NSError* Verify_##T(OOPListSchemaVerifier* verifier, id value, NSDictionary* params, id rootPList, NSString* name, BackLinkChain keyPath, BOOL tentative, BOOL* outStop)
229+ (id)verifierWithSchema:(NSDictionary*)schema
231 return [[[
self alloc] initWithSchema:schema] autorelease];
234- (id)initWithSchema:(NSDictionary*)schema
239 _definitions = [[_schema oo_dictionaryForKey:@"$w2"] retain];
256 [_definitions release];
261- (void)setDelegate:(
id)delegate
274- (BOOL)verifyPropertyList:(
id)plist named:(NSString*)name
291+ (NSString*)descriptionForKeyPath:(NSArray*)keyPath
293 NSMutableString* result =
nil;
299 foreach (component, keyPath) {
300 if ([component isKindOfClass:[NSNumber
class]]) {
301 [
result appendFormat:@"[%@]", component];
302 }
else if ([component isKindOfClass:[NSString
class]]) {
304 [
result appendString:@"."];
305 [
result appendString:component];
321@implementation OOPListSchemaVerifier (OOPrivate)
323- (BOOL)delegateVerifierWithPropertyList:(
id)rootPList
324 named:(NSString*)name
325 testProperty:(
id)subPList
327 againstType:(NSString*)typeKey
328 error:(NSError**)outError
331 NSError* error =
nil;
333 if ([_delegate respondsToSelector:
@selector(verifier:withPropertyList:named:testProperty:atPath:againstType:error:)]) {
336 withPropertyList:rootPList
338 testProperty:subPList
339 atPath:KeyPathToArray(keyPath)
343 @catch (NSException* exception) {
344 OOLog(
@"plistVerifier.delegateException",
@"Property list schema verifier: delegate threw exception (%@) in -verifier:withPropertyList:named:testProperty:atPath:againstType: for type \"%@\
" at %@ in %@ -- treating as failure.", [exception name], typeKey,
KeyPathToString(keyPath), name);
349 if (outError != NULL) {
350 if (!result || error !=
nil) {
357 if (!_badDelegateWarning) {
358 OOLog(
@"plistVerifier.badDelegate",
@"%@",
@"Property list schema verifier: delegate does not handle delegated types.");
359 _badDelegateWarning = YES;
367- (BOOL)delegateVerifierWithPropertyList:(
id)rootPList
368 named:(NSString*)name
369 failedForProperty:(
id)subPList
370 withError:(NSError*)error
371 expectedType:(NSDictionary*)localSchema
375 if ([_delegate respondsToSelector:
@selector(verifier:withPropertyList:named:failedForProperty:withError:expectedType:)]) {
378 withPropertyList:rootPList
380 failedForProperty:subPList
382 expectedType:localSchema];
384 @catch (NSException* exception) {
385 OOLog(
@"plistVerifier.delegateException",
@"Property list schema verifier: delegate threw exception (%@) in -verifier:withPropertyList:named:failedForProperty:atPath:expectedType: at %@ in %@ -- stopping.", [exception name], [error plistKeyPathDescription], name);
389 OOLog(
@"plistVerifier.failed",
@"Verification of property list \"%@\
" failed at %@: %@", name, [error plistKeyPathDescription], [error localizedFailureReason]);
395- (BOOL)verifyPList:(
id)rootPList
396 named:(NSString*)name
397 subProperty:(
id)subProperty
398 againstSchemaType:(
id)subSchema
400 tentative:(BOOL)tentative
401 error:(NSError**)outError
405 NSError* error =
nil;
406 NSDictionary* resolvedSpecifier =
nil;
407 NSAutoreleasePool* pool =
nil;
409 assert(outStop != NULL);
419 if (resolvedSpecifier !=
nil)
422#define VERIFY_CASE(T) \
424 error = Verify_##T(self, subProperty, resolvedSpecifier, rootPList, name, keyPath, tentative, outStop); \
448 @catch (NSException* exception) {
461 }
else if (tentative)
465 if (outError != NULL && error !=
nil) {
466 *outError = [
error retain];
476- (NSDictionary*)resolveSchemaType:(
id)specifier
478 error:(NSError**)outError
481 NSString* complaint =
nil;
483 assert(outError != NULL);
485 if (![specifier isKindOfClass:[NSString
class]] && ![specifier isKindOfClass:[NSDictionary
class]])
489 if ([specifier isKindOfClass:[NSString
class]])
490 specifier = [
NSDictionary dictionaryWithObject:specifier forKey:@"type"];
493 if ([typeVal isKindOfClass:[NSString
class]]) {
494 if ([typeVal hasPrefix:
@"$"]) {
497 if (specifier ==
nil) {
505 }
else if ([typeVal isKindOfClass:[NSDictionary
class]]) {
515 complaint =
@"no type specified";
517 complaint =
@"not string or dictionary";
527 static NSDictionary* typeMap =
nil;
530 if (typeMap ==
nil) {
532 [[NSDictionary dictionaryWithObjectsAndKeys:
533 [NSNumber numberWithUnsignedInt:kTypeString], @"string",
534 [NSNumber numberWithUnsignedInt:kTypeArray], @"array",
535 [NSNumber numberWithUnsignedInt:kTypeDictionary], @"dictionary",
536 [NSNumber numberWithUnsignedInt:kTypeInteger], @"integer",
537 [NSNumber numberWithUnsignedInt:kTypePositiveInteger], @"positiveInteger",
538 [NSNumber numberWithUnsignedInt:kTypeFloat], @"float",
539 [NSNumber numberWithUnsignedInt:kTypePositiveFloat], @"positiveFloat",
540 [NSNumber numberWithUnsignedInt:kTypeOneOf], @"oneOf",
541 [NSNumber numberWithUnsignedInt:kTypeEnumeration], @"enumeration",
542 [NSNumber numberWithUnsignedInt:kTypeBoolean], @"boolean",
543 [NSNumber numberWithUnsignedInt:kTypeFuzzyBoolean], @"fuzzyBoolean",
544 [NSNumber numberWithUnsignedInt:kTypeVector], @"vector",
545 [NSNumber numberWithUnsignedInt:kTypeQuaternion], @"quaternion",
546 [NSNumber numberWithUnsignedInt:kTypeDelegatedType], @"delegatedType",
550 result = [[typeMap objectForKey:string] unsignedIntValue];
552 if ([
string hasPrefix:
@"$"]) {
564 NSEnumerator* filterEnum =
nil;
568 assert(outError != NULL);
570 if (filterSpec ==
nil)
573 if ([filterSpec isKindOfClass:[NSString
class]]) {
574 filterSpec = [NSArray arrayWithObject:filterSpec];
576 if ([filterSpec isKindOfClass:[NSArray
class]]) {
577 for (filterEnum = [filterSpec objectEnumerator]; (filter = [filterEnum nextObject]);) {
578 if ([filter isKindOfClass:[NSString
class]]) {
579 if ([filter isEqual:
@"lowerCase"])
580 string = [string lowercaseString];
581 else if ([filter isEqual:
@"upperCase"])
582 string = [string uppercaseString];
583 else if ([filter isEqual:
@"capitalized"])
584 string = [string capitalizedString];
585 else if ([filter hasPrefix:
@"truncFront:"]) {
586 string = [string substringToIndex:[[filter substringFromIndex:11] intValue]];
587 }
else if ([filter hasPrefix:
@"truncBack:"]) {
588 string = [string substringToIndex:[[filter substringFromIndex:10] intValue]];
589 }
else if ([filter hasPrefix:
@"subStringTo:"]) {
590 range = [string rangeOfString:[filter substringFromIndex:12]];
591 if (range.location != NSNotFound) {
592 string = [string substringToIndex:range.location];
594 }
else if ([filter hasPrefix:
@"subStringFrom:"]) {
595 range = [string rangeOfString:[filter substringFromIndex:14]];
596 if (range.location != NSNotFound) {
597 string = [string substringFromIndex:range.location + range.length];
599 }
else if ([filter hasPrefix:
@"subStringToInclusive:"]) {
600 range = [string rangeOfString:[filter substringFromIndex:21]];
601 if (range.location != NSNotFound) {
602 string = [string substringToIndex:range.location + range.length];
604 }
else if ([filter hasPrefix:
@"subStringFromInclusive:"]) {
605 range = [string rangeOfString:[filter substringFromIndex:23]];
606 if (range.location != NSNotFound) {
607 string = [string substringFromIndex:range.location];
625 BOOL (*testIMP)(id, SEL, NSString*);
626 NSEnumerator* testEnum =
nil;
629 assert(outError != NULL);
634 testIMP = (BOOL (*)(id, SEL, NSString*))[string methodForSelector:testSelector];
635 if (testIMP == NULL) {
636 *outError =
Error(
kPListErrorInternal, &keyPath,
@"OOPListSchemaVerifier internal error: NSString does not respond to test selector %@.", NSStringFromSelector(testSelector));
640 if ([test isKindOfClass:[NSString
class]]) {
641 test = [NSArray arrayWithObject:test];
644 if ([test isKindOfClass:[NSArray
class]]) {
645 for (testEnum = [test objectEnumerator]; (subTest = [testEnum nextObject]);) {
646 if ([subTest isKindOfClass:[NSString
class]]) {
647 if (testIMP(
string, testSelector, subTest))
662 NSMutableArray* result =
nil;
665 result = [NSMutableArray array];
666 for (curr = &keyPath; curr != NULL; curr = curr->
link) {
668 [result insertObject:curr->element atIndex:0];
684 string = [string substringToIndex:kMaximumLengthForStringInErrorMessage];
686 result = [NSMutableString stringWithString:string];
687 [result replaceOccurrencesOfString:@"\t" withString:@" " options:0 range:NSMakeRange(0, [string length])];
688 [result replaceOccurrencesOfString:@"\r\n" withString:@" \\ " options:0 range:NSMakeRange(0, [string length])];
689 [result replaceOccurrencesOfString:@"\n" withString:@" \\ " options:0 range:NSMakeRange(0, [string length])];
690 [result replaceOccurrencesOfString:@"\r" withString:@" \\ " options:0 range:NSMakeRange(0, [string length])];
693 result = [result substringToIndex:kMaximumLengthForStringInErrorMessage - 3];
694 result = [result stringByAppendingString:@"..."];
702 NSString* result =
nil;
703 NSString*
string =
nil;
705 NSAutoreleasePool* pool =
nil;
707 count = [array count];
711 pool = [[NSAutoreleasePool alloc] init];
713 result = [NSString stringWithFormat:@"(%@", [array objectAtIndex:0]];
715 for (i = 1; i !=
count; ++i) {
716 string = [result stringByAppendingFormat:@", %@", [array objectAtIndex:i]];
718 result = [result stringByAppendingString:@", ..."];
724 result = [result stringByAppendingString:@")"];
728 return [result autorelease];
733 return ArrayForErrorReport([[
set allObjects] sortedArrayUsingSelector:
@selector(caseInsensitiveCompare:)]);
738 if ([value isKindOfClass:[NSString
class]]) {
739 return [NSString stringWithFormat:@"\"%@\"", StringForErrorReport(value)];
742 if (arrayPrefix ==
nil)
744 if ([value isKindOfClass:[NSArray
class]]) {
745 return [arrayPrefix stringByAppendingString:ArrayForErrorReport(value)];
747 if ([value isKindOfClass:[NSSet
class]]) {
748 return [arrayPrefix stringByAppendingString:SetForErrorReport(value)];
757#define REQUIRE_TYPE(CLASSNAME, NAMESTRING) \
759 if (![value isKindOfClass:[CLASSNAME class]]) { \
760 return ErrorTypeMismatch([CLASSNAME class], NAMESTRING, value, keyPath); \
766 NSString* filteredString =
nil;
769 NSUInteger lengthConstraint;
770 NSError* error =
nil;
777 filteredString =
ApplyStringFilter(value, [params objectForKey:
@"filter"], keyPath, &error);
778 if (filteredString ==
nil)
782 testValue = [params objectForKey:@"requiredPrefix"];
783 if (testValue !=
nil) {
784 if (!
ApplyStringTest(filteredString, testValue,
@selector(hasPrefix:),
@"prefix", keyPath, &error)) {
791 testValue = [params objectForKey:@"requiredSuffix"];
792 if (testValue !=
nil) {
793 if (!
ApplyStringTest(filteredString, testValue,
@selector(hasSuffix:),
@"suffix", keyPath, &error)) {
800 testValue = [params objectForKey:@"requiredSubString"];
801 if (testValue !=
nil) {
802 if (!
ApplyStringTest(filteredString, testValue,
@selector(ooPListVerifierHasSubString:),
@"substring", keyPath, &error)) {
810 length = [filteredString length];
811 lengthConstraint = [params oo_unsignedIntegerForKey:@"minLength"];
812 if (length < lengthConstraint) {
816 lengthConstraint = [params oo_unsignedIntegerForKey:@"maxLength" defaultValue:NSUIntegerMax];
817 if (lengthConstraint < length) {
828 BOOL OK = YES, stop = NO;
830 id subProperty =
nil;
831 NSUInteger constraint;
838 count = [value count];
839 constraint = [params oo_unsignedIntegerForKey:@"minCount" defaultValue:0];
840 if (
count < constraint) {
844 constraint = [params oo_unsignedIntegerForKey:@"maxCount" defaultValue:NSUIntegerMax];
845 if (constraint <
count) {
850 valueType = [params objectForKey:@"valueType"];
851 if (valueType !=
nil) {
852 for (i = 0; i !=
count; ++i) {
853 subProperty = [value objectAtIndex:i];
855 if (![verifier verifyPList:rootPList
857 subProperty:subProperty
858 againstSchemaType:valueType
866 if ((stop && !tentative) || (tentative && !OK))
871 *outStop = stop && !tentative;
881 NSDictionary* schema =
nil;
884 NSEnumerator* keyEnum =
nil;
886 id subProperty =
nil;
887 BOOL OK = YES, stop = NO, prematureExit = NO;
889 NSMutableSet* requiredKeys =
nil;
890 NSArray* requiredKeyList =
nil;
891 NSUInteger
count, constraint;
898 count = [value count];
899 constraint = [params oo_unsignedIntegerForKey:@"minCount" defaultValue:0];
900 if (
count < constraint) {
903 constraint = [params oo_unsignedIntegerForKey:@"maxCount" defaultValue:NSUIntegerMax];
904 if (constraint <
count) {
909 schema = [params oo_dictionaryForKey:@"schema"];
910 valueType = [params objectForKey:@"valueType"];
911 allowOthers = [params oo_boolForKey:@"allowOthers" defaultValue:YES];
912 requiredKeyList = [params oo_arrayForKey:@"requiredKeys"];
915 if (schema ==
nil && valueType ==
nil && requiredKeyList ==
nil && allowOthers)
918 if (requiredKeyList !=
nil) {
919 requiredKeys = [NSMutableSet setWithArray:requiredKeyList];
925 for (keyEnum = [value keyEnumerator]; (key = [keyEnum nextObject]) && !stop;) {
926 subProperty = [(NSDictionary*)value objectForKey:key];
927 typeSpec = [schema objectForKey:key];
929 typeSpec = valueType;
934 if (typeSpec !=
nil) {
935 if (![verifier verifyPList:rootPList
937 subProperty:subProperty
938 againstSchemaType:typeSpec
945 }
else if (!allowOthers && ![requiredKeys containsObject:key] && [schema objectForKey:key] ==
nil) {
960 [requiredKeys removeObject:key];
962 if ((stop && !tentative) || (tentative && !OK)) {
971 if (!prematureExit && [requiredKeys
count] != 0) {
975 *outStop = stop && !tentative;
985 long long numericValue;
986 long long constraint;
990 DebugDump(
@"* integer: %lli", numericValue);
998 constraint = [params oo_longLongForKey:@"minimum" defaultValue:LLONG_MIN];
999 if (numericValue < constraint) {
1003 constraint = [params oo_longLongForKey:@"maximum" defaultValue:LLONG_MAX];
1004 if (constraint < numericValue) {
1013 unsigned long long numericValue;
1014 unsigned long long constraint;
1018 DebugDump(
@"* positive integer: %llu", numericValue);
1022 return ErrorTypeMismatch([NSNumber
class],
@"positive integer", value, keyPath);
1026 constraint = [params oo_unsignedLongLongForKey:@"minimum" defaultValue:0];
1027 if (numericValue < constraint) {
1031 constraint = [params oo_unsignedLongLongForKey:@"maximum" defaultValue:ULLONG_MAX];
1032 if (constraint < numericValue) {
1041 double numericValue;
1046 DebugDump(
@"* float: %g", numericValue);
1054 constraint = [params oo_doubleForKey:@"minimum" defaultValue:-INFINITY];
1055 if (numericValue < constraint) {
1059 constraint = [params oo_doubleForKey:@"maximum" defaultValue:INFINITY];
1060 if (constraint < numericValue) {
1069 double numericValue;
1074 DebugDump(
@"* positive float: %g", numericValue);
1081 if (numericValue < 0) {
1086 constraint = [params oo_doubleForKey:@"minimum" defaultValue:0];
1087 if (numericValue < constraint) {
1091 constraint = [params oo_doubleForKey:@"maximum" defaultValue:INFINITY];
1092 if (constraint < numericValue) {
1101 NSArray* options =
nil;
1102 BOOL OK = NO, stop = NO;
1105 NSMutableDictionary* errors =
nil;
1109 options = [params oo_arrayForKey:@"options"];
1110 if (options ==
nil) {
1115 errors = [[NSMutableDictionary alloc] initWithCapacity:[options count]];
1117 foreach (option, options) {
1118 if ([verifier verifyPList:rootPList
1121 againstSchemaType:option
1130 [errors setObject:error forKey:option];
1145 NSArray* values =
nil;
1146 NSString* filteredString =
nil;
1147 NSError* error =
nil;
1153 values = [params oo_arrayForKey:@"values"];
1156 if (values ==
nil) {
1161 filteredString =
ApplyStringFilter(value, [params objectForKey:
@"filter"], keyPath, &error);
1162 if (filteredString ==
nil)
1165 if ([values containsObject:filteredString])
1184 DebugDump(
@"* fuzzy boolean: %@", value);
1220 NSString* key =
nil;
1222 NSError* error =
nil;
1224 DebugDump(
@"* delegated type: %@", [params objectForKey:
@"key"]);
1226 baseType = [params objectForKey:@"baseType"];
1227 if (baseType !=
nil) {
1228 if (![verifier verifyPList:rootPList
1231 againstSchemaType:baseType
1241 key = [params objectForKey:@"key"];
1251@implementation NSString (OOPListSchemaVerifierHelpers)
1253- (BOOL)ooPListVerifierHasSubString:(NSString*)string
1255 return [
self rangeOfString:string].location != NSNotFound;
1260@implementation NSError (OOPListSchemaVerifierConveniences)
1264 return [[
self userInfo] oo_arrayForKey:kPListKeyPathErrorKey];
1274 return [[
self userInfo] oo_setForKey:kMissingRequiredKeysErrorKey];
1279 return [[
self userInfo] objectForKey:kExpectedClassErrorKey];
1284 NSString* result = [[
self userInfo] objectForKey:kExpectedClassNameErrorKey];
1294 NSError* result =
nil;
1297 va_start(args, format);
1306 NSError* result =
nil;
1308 NSDictionary* dict =
nil;
1310 if (propKey !=
nil && propValue !=
nil) {
1311 dict = [NSDictionary dictionaryWithObject:propValue forKey:propKey];
1313 va_start(args, format);
1322 NSError* result =
nil;
1325 va_start(args, format);
1334 NSString* message =
nil;
1335 NSMutableDictionary* userInfo =
nil;
1337 message = [[NSString alloc] initWithFormat:format arguments:arguments];
1339 userInfo = [NSMutableDictionary dictionaryWithDictionary:dict];
1340 [userInfo setObject:message forKey:NSLocalizedFailureReasonErrorKey];
1341 if (keyPath != NULL) {
1342 [userInfo setObject:KeyPathToArray(*keyPath) forKey:kPListKeyPathErrorKey];
1347 return [NSError errorWithDomain:kOOPListSchemaVerifierErrorDomain code:errorCode userInfo:userInfo];
1352 NSDictionary* dict =
nil;
1353 NSString* className =
nil;
1355 if (expectedClassName ==
nil)
1356 expectedClassName = [expectedClass description];
1358 dict = [NSDictionary dictionaryWithObjectsAndKeys:
1359 expectedClassName, kExpectedClassNameErrorKey,
1360 expectedClass, kExpectedClassErrorKey,
1363 if (actualObject ==
nil)
1364 className =
@"nothing";
1365 else if ([actualObject isKindOfClass:[NSString
class]])
1366 className =
@"string";
1367 else if ([actualObject isKindOfClass:[NSNumber
class]])
1368 className =
@"number";
1369 else if ([actualObject isKindOfClass:[NSArray
class]])
1370 className =
@"array";
1371 else if ([actualObject isKindOfClass:[NSDictionary
class]])
1372 className =
@"dictionary";
1373 else if ([actualObject isKindOfClass:[NSData
class]])
1374 className =
@"data";
1375 else if ([actualObject isKindOfClass:[NSDate
class]])
1376 className =
@"date";
1378 className = [[actualObject class] description];
1385 return [NSError errorWithDomain:kOOPListSchemaVerifierErrorDomain code:kPListErrorFailedAndErrorHasBeenReported userInfo:nil];
#define OOLog(class, format,...)
void OOLogSetDisplayMessagesInClass(NSString *inClass, BOOL inFlag)
NSString *const kMissingRequiredKeysErrorKey
NSString *const kExpectedClassErrorKey
NSString *const kUndefinedMacroErrorKey
NSString *const kSchemaKeyPathErrorKey
NSString *const kErrorsByOptionErrorKey
NSString *const kExpectedClassNameErrorKey
OOPListSchemaVerifierErrorCode
@ kPListErrorDictionaryMissingRequiredKeys
@ kPListErrorSchemaNoEnumerationValues
@ kPListErrorNumberIsNegative
@ kPListErrorEnumerationBadValue
@ kPListErrorSchemaBadTypeSpecifier
@ kPListErrorSchemaNoOneOfOptions
@ kPListErrorTypeMismatch
@ kPListErrorStringSubstringMissing
@ kPListErrorSchemaUnknownType
@ kPListErrorMaximumConstraintNotMet
@ kPListErrorDictionaryUnknownKey
@ kPListErrorMinimumConstraintNotMet
@ kPListErrorLastErrorCode
@ kPListDelegatedTypeError
@ kPListErrorStringSuffixMissing
@ kPListErrorOneOfNoMatch
@ kPListErrorSchemaUndefiniedMacroReference
@ kPListErrorSchemaBadComparator
@ kPListErrorSchemaUnknownFilter
@ kPListErrorStringPrefixMissing
NSString *const kUnnownFilterErrorKey
NSString *const kPListKeyPathErrorKey
NSString *const kUnknownTypeErrorKey
NSString *const kOOPListSchemaVerifierErrorDomain
NSString *const kMissingSubStringErrorKey
NSString *const kUnknownKeyErrorKey
static NSError * ErrorWithDictionaryAndArguments(OOPListSchemaVerifierErrorCode errorCode, BackLinkChain *keyPath, NSDictionary *dict, NSString *format, va_list arguments)
static NSString * SetForErrorReport(NSSet *set)
NSString *const kUndefinedMacroErrorKey
@ kMaximumLengthForStringInErrorMessage
static NSString * KeyPathToString(BackLinkChain keyPath)
static NSError * ErrorFailureAlreadyReported(void)
static NSError * Verify_OneOf(OOPListSchemaVerifier *verifier, id value, NSDictionary *params, id rootPList, NSString *name, BackLinkChain keyPath, BOOL tentative, BOOL *outStop)
static SchemaType StringToSchemaType(NSString *string, NSError **outError)
static NSError * Verify_Boolean(OOPListSchemaVerifier *verifier, id value, NSDictionary *params, id rootPList, NSString *name, BackLinkChain keyPath, BOOL tentative, BOOL *outStop)
static NSString * StringForErrorReport(NSString *string)
@ kPListErrorFailedAndErrorHasBeenReported
@ kStartOfPrivateErrorCodes
OOINLINE BackLinkChain BackLink(BackLinkChain *link, id element)
static NSError * Verify_Integer(OOPListSchemaVerifier *verifier, id value, NSDictionary *params, id rootPList, NSString *name, BackLinkChain keyPath, BOOL tentative, BOOL *outStop)
static NSError * Verify_Quaternion(OOPListSchemaVerifier *verifier, id value, NSDictionary *params, id rootPList, NSString *name, BackLinkChain keyPath, BOOL tentative, BOOL *outStop)
static NSError * Verify_String(OOPListSchemaVerifier *verifier, id value, NSDictionary *params, id rootPList, NSString *name, BackLinkChain keyPath, BOOL tentative, BOOL *outStop)
static NSString * ArrayForErrorReport(NSArray *array)
static NSError * Verify_Array(OOPListSchemaVerifier *verifier, id value, NSDictionary *params, id rootPList, NSString *name, BackLinkChain keyPath, BOOL tentative, BOOL *outStop)
static NSArray * KeyPathToArray(BackLinkChain keyPath)
static NSError * Verify_PositiveFloat(OOPListSchemaVerifier *verifier, id value, NSDictionary *params, id rootPList, NSString *name, BackLinkChain keyPath, BOOL tentative, BOOL *outStop)
#define DebugDumpPopIndent()
static BOOL ApplyStringTest(NSString *string, id test, SEL testSelector, NSString *testDescription, BackLinkChain keyPath, NSError **outError)
#define DebugDumpIndent()
OOINLINE BackLinkChain BackLinkRoot(void)
static NSError * Error(OOPListSchemaVerifierErrorCode errorCode, BackLinkChain *keyPath, NSString *format,...)
static NSError * ErrorWithDictionary(OOPListSchemaVerifierErrorCode errorCode, BackLinkChain *keyPath, NSDictionary *dict, NSString *format,...)
static NSError * Verify_Enumeration(OOPListSchemaVerifier *verifier, id value, NSDictionary *params, id rootPList, NSString *name, BackLinkChain keyPath, BOOL tentative, BOOL *outStop)
static NSError * Verify_Vector(OOPListSchemaVerifier *verifier, id value, NSDictionary *params, id rootPList, NSString *name, BackLinkChain keyPath, BOOL tentative, BOOL *outStop)
static NSString * StringOrArrayForErrorReport(id value, NSString *arrayPrefix)
static NSError * Verify_PositiveInteger(OOPListSchemaVerifier *verifier, id value, NSDictionary *params, id rootPList, NSString *name, BackLinkChain keyPath, BOOL tentative, BOOL *outStop)
static NSError * Verify_FuzzyBoolean(OOPListSchemaVerifier *verifier, id value, NSDictionary *params, id rootPList, NSString *name, BackLinkChain keyPath, BOOL tentative, BOOL *outStop)
static NSError * ErrorWithProperty(OOPListSchemaVerifierErrorCode errorCode, BackLinkChain *keyPath, NSString *propKey, id propValue, NSString *format,...)
static NSError * Verify_Float(OOPListSchemaVerifier *verifier, id value, NSDictionary *params, id rootPList, NSString *name, BackLinkChain keyPath, BOOL tentative, BOOL *outStop)
#define DebugDumpPushIndent()
static NSError * ErrorTypeMismatch(Class expectedClass, NSString *expectedClassName, id actualObject, BackLinkChain keyPath)
static BOOL IsFailureAlreadyReportedError(NSError *error)
static NSError * Verify_Dictionary(OOPListSchemaVerifier *verifier, id value, NSDictionary *params, id rootPList, NSString *name, BackLinkChain keyPath, BOOL tentative, BOOL *outStop)
OOINLINE BackLinkChain BackLinkIndex(BackLinkChain *link, NSUInteger index)
static NSError * Verify_DelegatedType(OOPListSchemaVerifier *verifier, id value, NSDictionary *params, id rootPList, NSString *name, BackLinkChain keyPath, BOOL tentative, BOOL *outStop)
#define DebugDumpOutdent()
#define REQUIRE_TYPE(CLASSNAME, NAMESTRING)
static NSString * ApplyStringFilter(NSString *string, id filterSpec, BackLinkChain keyPath, NSError **outError)
OOINLINE bool quaternion_equal(Quaternion a, Quaternion b) INLINE_CONST_FUNC
const Quaternion kIdentityQuaternion
const Quaternion kZeroQuaternion
OOINLINE bool vector_equal(Vector a, Vector b) INLINE_CONST_FUNC
const Vector kBasisXVector
NSString * expectedClassName()
NSSet * missingRequiredKeys()
NSString * plistKeyPathDescription()
BOOL verifyPList:named:subProperty:againstSchemaType:atPath:tentative:error:stop:(id rootPList,[named] NSString *name,[subProperty] id subProperty,[againstSchemaType] id subSchema,[atPath] BackLinkChain keyPath,[tentative] BOOL tentative,[error] NSError **outError,[stop] BOOL *outStop)
uint32_t _badDelegateWarning
NSString * descriptionForKeyPath:(NSArray *keyPath)
BOOL delegateVerifierWithPropertyList:named:testProperty:atPath:againstType:error:(id rootPList,[named] NSString *name,[testProperty] id subPList,[atPath] BackLinkChain keyPath,[againstType] NSString *typeKey,[error] NSError **outError)
NSDictionary * resolveSchemaType:atPath:error:(id specifier,[atPath] BackLinkChain keyPath,[error] NSError **outError)
NSDictionary * _definitions
BOOL delegateVerifierWithPropertyList:named:failedForProperty:withError:expectedType:(id rootPList,[named] NSString *name,[failedForProperty] id subPList,[withError] NSError *error,[expectedType] NSDictionary *localSchema)