Oolite 1.91.0.7646-241128-10e222e
|
import "OOPListSchemaVerifier.h"
import "OOLoggingExtended.h"
import "OOCollectionExtractors.h"
import "OOMaths.h"
#include <limits.h>
Go to the source code of this file.
Classes | |
struct | BackLinkChain |
category | OOPListSchemaVerifier(OOPrivate) |
category | NSString(OOPListSchemaVerifierHelpers) |
Macros | |
#define | PLIST_VERIFIER_DEBUG_DUMP_ENABLED 1 |
#define | DebugDumpIndent() |
#define | DebugDumpOutdent() |
#define | DebugDumpPushIndent() |
#define | DebugDumpPopIndent() |
#define | DebugDump(...) |
#define | VERIFY_PROTO(T) |
#define | VERIFY_CASE(T) |
#define | REQUIRE_TYPE(CLASSNAME, NAMESTRING) |
Typedefs | |
typedef struct BackLinkChain | BackLinkChain |
Enumerations | |
enum | { kMaximumLengthForStringInErrorMessage = 100 } |
enum | { kStartOfPrivateErrorCodes = kPListErrorLastErrorCode , kPListErrorFailedAndErrorHasBeenReported } |
enum | SchemaType { kTypeUnknown , kTypeString , kTypeArray , kTypeDictionary , kTypeInteger , kTypePositiveInteger , kTypeFloat , kTypePositiveFloat , kTypeOneOf , kTypeEnumeration , kTypeBoolean , kTypeFuzzyBoolean , kTypeVector , kTypeQuaternion , kTypeDelegatedType } |
Functions | |
OOINLINE BackLinkChain | BackLink (BackLinkChain *link, id element) |
OOINLINE BackLinkChain | BackLinkIndex (BackLinkChain *link, NSUInteger index) |
OOINLINE BackLinkChain | BackLinkRoot (void) |
static SchemaType | StringToSchemaType (NSString *string, NSError **outError) |
static NSString * | ApplyStringFilter (NSString *string, id filterSpec, BackLinkChain keyPath, NSError **outError) |
static BOOL | ApplyStringTest (NSString *string, id test, SEL testSelector, NSString *testDescription, BackLinkChain keyPath, NSError **outError) |
static NSArray * | KeyPathToArray (BackLinkChain keyPath) |
static NSString * | KeyPathToString (BackLinkChain keyPath) |
static NSString * | StringForErrorReport (NSString *string) |
static NSString * | ArrayForErrorReport (NSArray *array) |
static NSString * | SetForErrorReport (NSSet *set) |
static NSString * | StringOrArrayForErrorReport (id value, NSString *arrayPrefix) |
static NSError * | Error (OOPListSchemaVerifierErrorCode errorCode, BackLinkChain *keyPath, NSString *format,...) |
static NSError * | ErrorWithProperty (OOPListSchemaVerifierErrorCode errorCode, BackLinkChain *keyPath, NSString *propKey, id propValue, NSString *format,...) |
static NSError * | ErrorWithDictionary (OOPListSchemaVerifierErrorCode errorCode, BackLinkChain *keyPath, NSDictionary *dict, NSString *format,...) |
static NSError * | ErrorWithDictionaryAndArguments (OOPListSchemaVerifierErrorCode errorCode, BackLinkChain *keyPath, NSDictionary *dict, NSString *format, va_list arguments) |
static NSError * | ErrorTypeMismatch (Class expectedClass, NSString *expectedClassName, id actualObject, BackLinkChain keyPath) |
static NSError * | ErrorFailureAlreadyReported (void) |
static BOOL | IsFailureAlreadyReportedError (NSError *error) |
VERIFY_PROTO (String) | |
VERIFY_PROTO (Array) | |
VERIFY_PROTO (Dictionary) | |
VERIFY_PROTO (Integer) | |
VERIFY_PROTO (PositiveInteger) | |
VERIFY_PROTO (Float) | |
VERIFY_PROTO (PositiveFloat) | |
VERIFY_PROTO (OneOf) | |
VERIFY_PROTO (Enumeration) | |
VERIFY_PROTO (Boolean) | |
VERIFY_PROTO (FuzzyBoolean) | |
VERIFY_PROTO (Vector) | |
VERIFY_PROTO (Quaternion) | |
VERIFY_PROTO (DelegatedType) | |
static NSError * | Verify_String (OOPListSchemaVerifier *verifier, id value, NSDictionary *params, id rootPList, NSString *name, BackLinkChain keyPath, BOOL tentative, BOOL *outStop) |
static NSError * | Verify_Array (OOPListSchemaVerifier *verifier, id value, NSDictionary *params, id rootPList, NSString *name, BackLinkChain keyPath, BOOL tentative, BOOL *outStop) |
static NSError * | Verify_Dictionary (OOPListSchemaVerifier *verifier, id value, NSDictionary *params, id rootPList, NSString *name, BackLinkChain keyPath, BOOL tentative, BOOL *outStop) |
static NSError * | Verify_Integer (OOPListSchemaVerifier *verifier, id value, NSDictionary *params, id rootPList, NSString *name, BackLinkChain keyPath, BOOL tentative, BOOL *outStop) |
static NSError * | Verify_PositiveInteger (OOPListSchemaVerifier *verifier, id value, NSDictionary *params, id rootPList, NSString *name, BackLinkChain keyPath, BOOL tentative, BOOL *outStop) |
static NSError * | Verify_Float (OOPListSchemaVerifier *verifier, id value, NSDictionary *params, id rootPList, NSString *name, BackLinkChain keyPath, BOOL tentative, BOOL *outStop) |
static NSError * | Verify_PositiveFloat (OOPListSchemaVerifier *verifier, id value, NSDictionary *params, id rootPList, NSString *name, BackLinkChain keyPath, BOOL tentative, BOOL *outStop) |
static NSError * | Verify_OneOf (OOPListSchemaVerifier *verifier, id value, NSDictionary *params, id rootPList, NSString *name, BackLinkChain keyPath, BOOL tentative, BOOL *outStop) |
static NSError * | Verify_Enumeration (OOPListSchemaVerifier *verifier, id value, NSDictionary *params, id rootPList, NSString *name, BackLinkChain keyPath, BOOL tentative, BOOL *outStop) |
static NSError * | Verify_Boolean (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 * | Verify_Vector (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_DelegatedType (OOPListSchemaVerifier *verifier, id value, NSDictionary *params, id rootPList, NSString *name, BackLinkChain keyPath, BOOL tentative, BOOL *outStop) |
Variables | |
static BOOL | sDebugDump = NO |
NSString *const | kOOPListSchemaVerifierErrorDomain = @"org.aegidian.oolite.OOPListSchemaVerifier.ErrorDomain" |
NSString *const | kPListKeyPathErrorKey = @"org.aegidian.oolite.OOPListSchemaVerifier plist key path" |
NSString *const | kSchemaKeyPathErrorKey = @"org.aegidian.oolite.OOPListSchemaVerifier schema key path" |
NSString *const | kExpectedClassErrorKey = @"org.aegidian.oolite.OOPListSchemaVerifier expected class" |
NSString *const | kExpectedClassNameErrorKey = @"org.aegidian.oolite.OOPListSchemaVerifier expected class name" |
NSString *const | kUnknownKeyErrorKey = @"org.aegidian.oolite.OOPListSchemaVerifier unknown key" |
NSString *const | kMissingRequiredKeysErrorKey = @"org.aegidian.oolite.OOPListSchemaVerifier missing required keys" |
NSString *const | kMissingSubStringErrorKey = @"org.aegidian.oolite.OOPListSchemaVerifier missing substring" |
NSString *const | kUnnownFilterErrorKey = @"org.aegidian.oolite.OOPListSchemaVerifier unknown filter" |
NSString *const | kErrorsByOptionErrorKey = @"org.aegidian.oolite.OOPListSchemaVerifier errors by option" |
NSString *const | kUnknownTypeErrorKey = @"org.aegidian.oolite.OOPListSchemaVerifier unknown type" |
NSString *const | kUndefinedMacroErrorKey = @"org.aegidian.oolite.OOPListSchemaVerifier undefined macro" |
#define DebugDump | ( | ... | ) |
Definition at line 64 of file OOPListSchemaVerifier.m.
Referenced by Verify_Array(), Verify_Boolean(), Verify_DelegatedType(), Verify_Dictionary(), Verify_Enumeration(), Verify_Float(), Verify_FuzzyBoolean(), Verify_Integer(), Verify_OneOf(), Verify_PositiveFloat(), Verify_PositiveInteger(), Verify_Quaternion(), Verify_String(), and Verify_Vector().
#define DebugDumpIndent | ( | ) |
#define DebugDumpOutdent | ( | ) |
#define DebugDumpPopIndent | ( | ) |
Definition at line 63 of file OOPListSchemaVerifier.m.
#define DebugDumpPushIndent | ( | ) |
Definition at line 62 of file OOPListSchemaVerifier.m.
#define PLIST_VERIFIER_DEBUG_DUMP_ENABLED 1 |
Definition at line 38 of file OOPListSchemaVerifier.m.
#define REQUIRE_TYPE | ( | CLASSNAME, | |
NAMESTRING ) |
Definition at line 831 of file OOPListSchemaVerifier.m.
Referenced by Verify_Array(), Verify_Dictionary(), Verify_Enumeration(), and Verify_String().
#define VERIFY_CASE | ( | T | ) |
#define VERIFY_PROTO | ( | T | ) |
Definition at line 196 of file OOPListSchemaVerifier.m.
typedef struct BackLinkChain BackLinkChain |
Definition at line 111 of file OOPListSchemaVerifier.m.
anonymous enum |
Enumerator | |
---|---|
kMaximumLengthForStringInErrorMessage |
Definition at line 41 of file OOPListSchemaVerifier.m.
anonymous enum |
Enumerator | |
---|---|
kStartOfPrivateErrorCodes | |
kPListErrorFailedAndErrorHasBeenReported |
Definition at line 49 of file OOPListSchemaVerifier.m.
enum SchemaType |
Definition at line 91 of file OOPListSchemaVerifier.m.
|
static |
Definition at line 596 of file OOPListSchemaVerifier.m.
References Error(), ErrorWithProperty(), kPListErrorSchemaUnknownFilter, kUnnownFilterErrorKey, and nil.
Referenced by Verify_Enumeration(), and Verify_String().
|
static |
Definition at line 679 of file OOPListSchemaVerifier.m.
References Error(), kPListErrorInternal, kPListErrorSchemaBadComparator, and nil.
Referenced by Verify_String().
|
static |
Definition at line 769 of file OOPListSchemaVerifier.m.
References count, kMaximumLengthForStringInErrorMessage, and nil.
Referenced by SetForErrorReport(), and Verify_Enumeration().
OOINLINE BackLinkChain BackLink | ( | BackLinkChain * | link, |
id | element ) |
Definition at line 118 of file OOPListSchemaVerifier.m.
References BackLinkChain::element, and BackLinkChain::link.
Referenced by Verify_Dictionary().
OOINLINE BackLinkChain BackLinkIndex | ( | BackLinkChain * | link, |
NSUInteger | index ) |
Definition at line 124 of file OOPListSchemaVerifier.m.
References BackLinkChain::link.
Referenced by Verify_Array().
OOINLINE BackLinkChain BackLinkRoot | ( | void | ) |
Definition at line 130 of file OOPListSchemaVerifier.m.
|
static |
Definition at line 1408 of file OOPListSchemaVerifier.m.
References ErrorWithDictionaryAndArguments(), and nil.
Referenced by ApplyStringFilter(), ApplyStringTest(), Verify_Array(), Verify_Dictionary(), Verify_Enumeration(), Verify_Float(), Verify_Integer(), Verify_OneOf(), Verify_PositiveFloat(), Verify_PositiveInteger(), and Verify_String().
|
static |
Definition at line 1497 of file OOPListSchemaVerifier.m.
Referenced by Verify_Array(), and Verify_Dictionary().
|
static |
Definition at line 1472 of file OOPListSchemaVerifier.m.
References ErrorWithDictionary(), kPListErrorTypeMismatch, and nil.
Referenced by Verify_Boolean(), Verify_Float(), Verify_FuzzyBoolean(), Verify_Integer(), Verify_PositiveFloat(), Verify_PositiveInteger(), Verify_Quaternion(), and Verify_Vector().
|
static |
Definition at line 1439 of file OOPListSchemaVerifier.m.
References ErrorWithDictionaryAndArguments(), and nil.
Referenced by ErrorTypeMismatch().
|
static |
Definition at line 1452 of file OOPListSchemaVerifier.m.
References nil.
Referenced by Error(), ErrorWithDictionary(), and ErrorWithProperty().
|
static |
Definition at line 1421 of file OOPListSchemaVerifier.m.
References ErrorWithDictionaryAndArguments(), and nil.
Referenced by ApplyStringFilter(), StringToSchemaType(), Verify_Dictionary(), Verify_OneOf(), and Verify_String().
|
static |
Definition at line 1503 of file OOPListSchemaVerifier.m.
References kPListErrorFailedAndErrorHasBeenReported.
|
static |
Definition at line 724 of file OOPListSchemaVerifier.m.
References BackLinkChain::element, BackLinkChain::link, and nil.
|
static |
Definition at line 739 of file OOPListSchemaVerifier.m.
References OOPListSchemaVerifier::descriptionForKeyPath:.
|
static |
Definition at line 802 of file OOPListSchemaVerifier.m.
References ArrayForErrorReport().
Referenced by Verify_Dictionary().
|
static |
Definition at line 745 of file OOPListSchemaVerifier.m.
References kMaximumLengthForStringInErrorMessage, and nil.
Referenced by Verify_Dictionary(), Verify_Enumeration(), and Verify_String().
|
static |
Definition at line 808 of file OOPListSchemaVerifier.m.
References nil.
Referenced by Verify_String().
|
static |
Definition at line 552 of file OOPListSchemaVerifier.m.
References ErrorWithProperty(), kPListErrorSchemaUnknownType, kTypeUnknown, kUnknownTypeErrorKey, and nil.
|
static |
Definition at line 904 of file OOPListSchemaVerifier.m.
References BackLinkIndex(), count, DebugDump, Error(), ErrorFailureAlreadyReported(), kPListErrorMaximumConstraintNotMet, kPListErrorMinimumConstraintNotMet, nil, and REQUIRE_TYPE.
|
static |
Definition at line 1284 of file OOPListSchemaVerifier.m.
References DebugDump, ErrorTypeMismatch(), nil, and OOBooleanFromObject().
|
static |
Definition at line 1325 of file OOPListSchemaVerifier.m.
References DebugDump, OOPListSchemaVerifier::delegateVerifierWithPropertyList:named:testProperty:atPath:againstType:error:, and nil.
|
static |
Definition at line 961 of file OOPListSchemaVerifier.m.
References BackLink(), count, DebugDump, DebugDumpIndent, DebugDumpOutdent, OOPListSchemaVerifier::delegateVerifierWithPropertyList:named:failedForProperty:withError:expectedType:, Error(), ErrorFailureAlreadyReported(), ErrorWithProperty(), kMissingRequiredKeysErrorKey, kPListErrorDictionaryMissingRequiredKeys, kPListErrorDictionaryUnknownKey, kPListErrorMaximumConstraintNotMet, kPListErrorMinimumConstraintNotMet, kUnknownKeyErrorKey, nil, REQUIRE_TYPE, SetForErrorReport(), and StringForErrorReport().
|
static |
Definition at line 1256 of file OOPListSchemaVerifier.m.
References ApplyStringFilter(), ArrayForErrorReport(), DebugDump, Error(), kPListErrorEnumerationBadValue, kPListErrorSchemaNoEnumerationValues, nil, REQUIRE_TYPE, and StringForErrorReport().
|
static |
Definition at line 1137 of file OOPListSchemaVerifier.m.
References DebugDump, Error(), ErrorTypeMismatch(), kPListErrorMaximumConstraintNotMet, kPListErrorMinimumConstraintNotMet, nil, and OODoubleFromObject().
|
static |
Definition at line 1294 of file OOPListSchemaVerifier.m.
References DebugDump, ErrorTypeMismatch(), nil, OOBooleanFromObject(), and OODoubleFromObject().
|
static |
Definition at line 1073 of file OOPListSchemaVerifier.m.
References DebugDump, Error(), ErrorTypeMismatch(), kPListErrorMaximumConstraintNotMet, kPListErrorMinimumConstraintNotMet, nil, and OOLongLongFromObject().
|
static |
Definition at line 1206 of file OOPListSchemaVerifier.m.
References DebugDump, Error(), ErrorWithProperty(), kErrorsByOptionErrorKey, kPListErrorOneOfNoMatch, kPListErrorSchemaNoOneOfOptions, and nil.
|
static |
Definition at line 1169 of file OOPListSchemaVerifier.m.
References DebugDump, Error(), ErrorTypeMismatch(), kPListErrorMaximumConstraintNotMet, kPListErrorMinimumConstraintNotMet, kPListErrorNumberIsNegative, nil, and OODoubleFromObject().
|
static |
Definition at line 1105 of file OOPListSchemaVerifier.m.
References DebugDump, Error(), ErrorTypeMismatch(), kPListErrorMaximumConstraintNotMet, kPListErrorMinimumConstraintNotMet, nil, and OOUnsignedLongLongFromObject().
VERIFY_PROTO | ( | Array | ) |
VERIFY_PROTO | ( | Boolean | ) |
VERIFY_PROTO | ( | DelegatedType | ) |
VERIFY_PROTO | ( | Dictionary | ) |
VERIFY_PROTO | ( | Enumeration | ) |
VERIFY_PROTO | ( | Float | ) |
VERIFY_PROTO | ( | FuzzyBoolean | ) |
VERIFY_PROTO | ( | Integer | ) |
VERIFY_PROTO | ( | OneOf | ) |
VERIFY_PROTO | ( | PositiveFloat | ) |
VERIFY_PROTO | ( | PositiveInteger | ) |
VERIFY_PROTO | ( | Quaternion | ) |
VERIFY_PROTO | ( | String | ) |
VERIFY_PROTO | ( | Vector | ) |
|
static |
Definition at line 1315 of file OOPListSchemaVerifier.m.
References DebugDump, ErrorTypeMismatch(), kIdentityQuaternion, kZeroQuaternion, nil, and OOQuaternionFromObject().
|
static |
Definition at line 838 of file OOPListSchemaVerifier.m.
References ApplyStringFilter(), ApplyStringTest(), DebugDump, Error(), ErrorWithProperty(), kMissingSubStringErrorKey, kPListErrorMaximumConstraintNotMet, kPListErrorMinimumConstraintNotMet, kPListErrorStringPrefixMissing, kPListErrorStringSubstringMissing, kPListErrorStringSuffixMissing, nil, REQUIRE_TYPE, StringForErrorReport(), and StringOrArrayForErrorReport().
|
static |
Definition at line 1305 of file OOPListSchemaVerifier.m.
References DebugDump, ErrorTypeMismatch(), kBasisXVector, kZeroVector, nil, and OOVectorFromObject().
NSString* const kErrorsByOptionErrorKey = @"org.aegidian.oolite.OOPListSchemaVerifier errors by option" |
Definition at line 85 of file OOPListSchemaVerifier.m.
Referenced by Verify_OneOf().
NSString* const kExpectedClassErrorKey = @"org.aegidian.oolite.OOPListSchemaVerifier expected class" |
Definition at line 79 of file OOPListSchemaVerifier.m.
NSString* const kExpectedClassNameErrorKey = @"org.aegidian.oolite.OOPListSchemaVerifier expected class name" |
Definition at line 80 of file OOPListSchemaVerifier.m.
NSString* const kMissingRequiredKeysErrorKey = @"org.aegidian.oolite.OOPListSchemaVerifier missing required keys" |
Definition at line 82 of file OOPListSchemaVerifier.m.
Referenced by Verify_Dictionary().
NSString* const kMissingSubStringErrorKey = @"org.aegidian.oolite.OOPListSchemaVerifier missing substring" |
Definition at line 83 of file OOPListSchemaVerifier.m.
Referenced by Verify_String().
NSString* const kOOPListSchemaVerifierErrorDomain = @"org.aegidian.oolite.OOPListSchemaVerifier.ErrorDomain" |
Definition at line 74 of file OOPListSchemaVerifier.m.
NSString* const kPListKeyPathErrorKey = @"org.aegidian.oolite.OOPListSchemaVerifier plist key path" |
Definition at line 76 of file OOPListSchemaVerifier.m.
NSString* const kSchemaKeyPathErrorKey = @"org.aegidian.oolite.OOPListSchemaVerifier schema key path" |
Definition at line 77 of file OOPListSchemaVerifier.m.
NSString* const kUndefinedMacroErrorKey = @"org.aegidian.oolite.OOPListSchemaVerifier undefined macro" |
Definition at line 88 of file OOPListSchemaVerifier.m.
NSString* const kUnknownKeyErrorKey = @"org.aegidian.oolite.OOPListSchemaVerifier unknown key" |
Definition at line 81 of file OOPListSchemaVerifier.m.
Referenced by Verify_Dictionary().
NSString* const kUnknownTypeErrorKey = @"org.aegidian.oolite.OOPListSchemaVerifier unknown type" |
Definition at line 87 of file OOPListSchemaVerifier.m.
Referenced by StringToSchemaType().
NSString* const kUnnownFilterErrorKey = @"org.aegidian.oolite.OOPListSchemaVerifier unknown filter" |
Definition at line 84 of file OOPListSchemaVerifier.m.
Referenced by ApplyStringFilter().
|
static |
Definition at line 58 of file OOPListSchemaVerifier.m.