motion-yapper 0.0.3 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +3 -1
- data/lib/yapper.rb +3 -3
- data/lib/yapper/db.rb +61 -4
- data/lib/yapper/document/persistence.rb +4 -0
- data/lib/yapper/document/selection.rb +13 -0
- data/lib/yapper/version.rb +1 -1
- data/motion-yapper.gemspec +1 -1
- data/spec/integration/search_spec.rb +111 -0
- data/vendor/Podfile.lock +11 -7
- data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.bridgesupport +16 -2
- data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.h +10 -7
- data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.m +20 -2
- metadata +19 -297
- data/vendor/Pods/.build/libPods-CocoaLumberjack.a +0 -0
- data/vendor/Pods/.build/libPods-NSData+MD5Digest.a +0 -0
- data/vendor/Pods/.build/libPods-YapDatabase.a +0 -0
- data/vendor/Pods/.build/libPods.a +0 -0
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDASLLogger.h +0 -41
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDAbstractDatabaseLogger.h +0 -102
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDContextFilterLogFormatter.h +0 -63
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDDispatchQueueLogFormatter.h +0 -128
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDFileLogger.h +0 -369
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDLog+LOGV.h +0 -99
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDLog.h +0 -634
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDMultiFormatter.h +0 -30
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDTTYLogger.h +0 -181
- data/vendor/Pods/BuildHeaders/NSData+MD5Digest/NSData+MD5Digest.h +0 -18
- data/vendor/Pods/BuildHeaders/YapDatabase/NSDictionary+YapDatabase.h +0 -8
- data/vendor/Pods/BuildHeaders/YapDatabase/YapCache.h +0 -91
- data/vendor/Pods/BuildHeaders/YapDatabase/YapCollectionKey.h +0 -23
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabase.h +0 -547
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseConnection.h +0 -449
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseConnectionState.h +0 -29
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseDefaults.h +0 -37
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseExtension.h +0 -15
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseExtensionConnection.h +0 -11
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseExtensionPrivate.h +0 -444
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseExtensionTransaction.h +0 -11
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredView.h +0 -81
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewConnection.h +0 -12
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewPrivate.h +0 -17
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewTransaction.h +0 -39
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewTypes.h +0 -32
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearch.h +0 -89
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearchConnection.h +0 -32
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearchPrivate.h +0 -77
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearchSnippetOptions.h +0 -79
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearchTransaction.h +0 -68
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseLogging.h +0 -158
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseManager.h +0 -17
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabasePrivate.h +0 -446
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseQuery.h +0 -42
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationship.h +0 -35
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipConnection.h +0 -29
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipEdge.h +0 -163
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipEdgePrivate.h +0 -79
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipNode.h +0 -99
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipOptions.h +0 -59
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipPrivate.h +0 -125
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipTransaction.h +0 -384
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndex.h +0 -149
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexConnection.h +0 -33
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexPrivate.h +0 -83
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexSetup.h +0 -33
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexSetupPrivate.h +0 -18
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexTransaction.h +0 -58
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseStatement.h +0 -13
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseString.h +0 -121
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseTransaction.h +0 -651
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseView.h +0 -127
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewChange.h +0 -272
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewChangePrivate.h +0 -94
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewConnection.h +0 -116
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewMappings.h +0 -842
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewMappingsPrivate.h +0 -72
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewOptions.h +0 -63
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewPage.h +0 -36
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewPageMetadata.h +0 -27
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewPrivate.h +0 -170
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewRangeOptions.h +0 -330
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewRangeOptionsPrivate.h +0 -17
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewTransaction.h +0 -498
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewTypes.h +0 -99
- data/vendor/Pods/BuildHeaders/YapDatabase/YapMemoryTable.h +0 -74
- data/vendor/Pods/BuildHeaders/YapDatabase/YapNull.h +0 -17
- data/vendor/Pods/BuildHeaders/YapDatabase/YapSet.h +0 -41
- data/vendor/Pods/BuildHeaders/YapDatabase/YapTouch.h +0 -15
- data/vendor/Pods/CocoaLumberjack/LICENSE.txt +0 -18
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDASLLogger.h +0 -41
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDASLLogger.m +0 -100
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDAbstractDatabaseLogger.h +0 -102
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDAbstractDatabaseLogger.m +0 -727
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDFileLogger.h +0 -369
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDFileLogger.m +0 -1539
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog+LOGV.h +0 -99
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog.h +0 -634
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog.m +0 -1208
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDTTYLogger.h +0 -181
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDTTYLogger.m +0 -1520
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DDContextFilterLogFormatter.h +0 -63
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DDContextFilterLogFormatter.m +0 -191
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DDDispatchQueueLogFormatter.h +0 -128
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DDDispatchQueueLogFormatter.m +0 -253
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DDMultiFormatter.h +0 -30
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DDMultiFormatter.m +0 -127
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/README.txt +0 -7
- data/vendor/Pods/CocoaLumberjack/README.markdown +0 -74
- data/vendor/Pods/Headers/CocoaLumberjack/DDASLLogger.h +0 -41
- data/vendor/Pods/Headers/CocoaLumberjack/DDAbstractDatabaseLogger.h +0 -102
- data/vendor/Pods/Headers/CocoaLumberjack/DDContextFilterLogFormatter.h +0 -63
- data/vendor/Pods/Headers/CocoaLumberjack/DDDispatchQueueLogFormatter.h +0 -128
- data/vendor/Pods/Headers/CocoaLumberjack/DDFileLogger.h +0 -369
- data/vendor/Pods/Headers/CocoaLumberjack/DDLog+LOGV.h +0 -99
- data/vendor/Pods/Headers/CocoaLumberjack/DDLog.h +0 -634
- data/vendor/Pods/Headers/CocoaLumberjack/DDMultiFormatter.h +0 -30
- data/vendor/Pods/Headers/CocoaLumberjack/DDTTYLogger.h +0 -181
- data/vendor/Pods/Headers/NSData+MD5Digest/NSData+MD5Digest.h +0 -18
- data/vendor/Pods/Headers/YapDatabase/YapCollectionKey.h +0 -23
- data/vendor/Pods/Headers/YapDatabase/YapDatabase.h +0 -547
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseConnection.h +0 -449
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseExtension.h +0 -15
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseExtensionConnection.h +0 -11
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseExtensionTransaction.h +0 -11
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredView.h +0 -81
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewConnection.h +0 -12
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewTransaction.h +0 -39
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewTypes.h +0 -32
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearch.h +0 -89
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearchConnection.h +0 -32
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearchSnippetOptions.h +0 -79
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearchTransaction.h +0 -68
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseQuery.h +0 -42
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationship.h +0 -35
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipConnection.h +0 -29
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipEdge.h +0 -163
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipNode.h +0 -99
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipOptions.h +0 -59
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipTransaction.h +0 -384
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndex.h +0 -149
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndexConnection.h +0 -33
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndexSetup.h +0 -33
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndexTransaction.h +0 -58
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseTransaction.h +0 -651
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseView.h +0 -127
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewChange.h +0 -272
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewConnection.h +0 -116
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewMappings.h +0 -842
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewOptions.h +0 -63
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewRangeOptions.h +0 -330
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewTransaction.h +0 -498
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewTypes.h +0 -99
- data/vendor/Pods/Headers/YapDatabase/YapSet.h +0 -41
- data/vendor/Pods/Headers/____Pods-CocoaLumberjack-prefix.h +0 -7
- data/vendor/Pods/Headers/____Pods-NSData+MD5Digest-prefix.h +0 -5
- data/vendor/Pods/Headers/____Pods-YapDatabase-prefix.h +0 -5
- data/vendor/Pods/Headers/____Pods-environment.h +0 -38
- data/vendor/Pods/Manifest.lock +0 -22
- data/vendor/Pods/NSData+MD5Digest/NSData+MD5Digest/NSData+MD5Digest.h +0 -18
- data/vendor/Pods/NSData+MD5Digest/NSData+MD5Digest/NSData+MD5Digest.m +0 -39
- data/vendor/Pods/NSData+MD5Digest/README.md +0 -11
- data/vendor/Pods/Pods-CocoaLumberjack-Private.xcconfig +0 -5
- data/vendor/Pods/Pods-CocoaLumberjack-dummy.m +0 -5
- data/vendor/Pods/Pods-CocoaLumberjack-prefix.pch +0 -7
- data/vendor/Pods/Pods-CocoaLumberjack.xcconfig +0 -0
- data/vendor/Pods/Pods-NSData+MD5Digest-Private.xcconfig +0 -5
- data/vendor/Pods/Pods-NSData+MD5Digest-dummy.m +0 -5
- data/vendor/Pods/Pods-NSData+MD5Digest-prefix.pch +0 -5
- data/vendor/Pods/Pods-NSData+MD5Digest.xcconfig +0 -0
- data/vendor/Pods/Pods-YapDatabase-Private.xcconfig +0 -5
- data/vendor/Pods/Pods-YapDatabase-dummy.m +0 -5
- data/vendor/Pods/Pods-YapDatabase-prefix.pch +0 -5
- data/vendor/Pods/Pods-YapDatabase.xcconfig +0 -1
- data/vendor/Pods/Pods-acknowledgements.markdown +0 -59
- data/vendor/Pods/Pods-acknowledgements.plist +0 -97
- data/vendor/Pods/Pods-dummy.m +0 -5
- data/vendor/Pods/Pods-environment.h +0 -38
- data/vendor/Pods/Pods-resources.sh +0 -68
- data/vendor/Pods/Pods.xcconfig +0 -5
- data/vendor/Pods/Pods.xcodeproj/project.pbxproj +0 -4807
- data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/Pods-CocoaLumberjack.xcscheme +0 -59
- data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/Pods-NSData+MD5Digest.xcscheme +0 -59
- data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/Pods-YapDatabase.xcscheme +0 -59
- data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/Pods.xcscheme +0 -59
- data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/xcschememanagement.plist +0 -31
- data/vendor/Pods/YapDatabase/LICENSE.txt +0 -18
- data/vendor/Pods/YapDatabase/README.md +0 -32
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/Internal/YapDatabaseFilteredViewPrivate.h +0 -17
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredView.h +0 -81
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredView.m +0 -159
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewConnection.h +0 -12
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewConnection.m +0 -41
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewTransaction.h +0 -39
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewTransaction.m +0 -1235
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewTypes.h +0 -32
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/Internal/YapDatabaseFullTextSearchPrivate.h +0 -77
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearch.h +0 -89
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearch.m +0 -146
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchConnection.h +0 -32
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchConnection.m +0 -298
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchSnippetOptions.h +0 -79
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchSnippetOptions.m +0 -95
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchTransaction.h +0 -68
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchTransaction.m +0 -1403
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/Internal/YapDatabaseExtensionPrivate.h +0 -444
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtension.h +0 -15
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtension.m +0 -83
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionConnection.h +0 -11
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionConnection.m +0 -46
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionTransaction.h +0 -11
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionTransaction.m +0 -204
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/Internal/YapDatabaseRelationshipEdgePrivate.h +0 -79
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/Internal/YapDatabaseRelationshipPrivate.h +0 -125
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationship.h +0 -35
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationship.m +0 -129
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipConnection.h +0 -29
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipConnection.m +0 -802
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipEdge.h +0 -163
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipEdge.m +0 -408
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipNode.h +0 -99
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipOptions.h +0 -59
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipOptions.m +0 -29
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipTransaction.h +0 -384
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipTransaction.m +0 -5254
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/Internal/YapDatabaseSecondaryIndexPrivate.h +0 -83
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/Internal/YapDatabaseSecondaryIndexSetupPrivate.h +0 -18
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndex.h +0 -149
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndex.m +0 -161
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexConnection.h +0 -33
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexConnection.m +0 -331
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexSetup.h +0 -33
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexSetup.m +0 -245
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexTransaction.h +0 -58
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexTransaction.m +0 -1269
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewChangePrivate.h +0 -94
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewMappingsPrivate.h +0 -72
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPage.h +0 -36
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPage.mm +0 -296
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPageMetadata.h +0 -27
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPageMetadata.m +0 -28
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPrivate.h +0 -170
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewRangeOptionsPrivate.h +0 -17
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewChange.h +0 -272
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewChange.m +0 -2500
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewMappings.h +0 -842
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewMappings.m +0 -1714
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewRangeOptions.h +0 -330
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewRangeOptions.m +0 -141
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseView.h +0 -127
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseView.m +0 -194
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewConnection.h +0 -116
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewConnection.m +0 -888
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewOptions.h +0 -63
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewOptions.m +0 -27
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTransaction.h +0 -498
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTransaction.m +0 -4986
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTypes.h +0 -99
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/NSDictionary+YapDatabase.h +0 -8
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/NSDictionary+YapDatabase.m +0 -19
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapCache.h +0 -91
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapCache.m +0 -465
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseConnectionState.h +0 -29
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseConnectionState.m +0 -48
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseDefaults.h +0 -37
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseDefaults.m +0 -83
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseLogging.h +0 -158
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseLogging.m +0 -73
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseManager.h +0 -17
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseManager.m +0 -56
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabasePrivate.h +0 -446
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseStatement.h +0 -13
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseStatement.m +0 -26
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseString.h +0 -121
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapMemoryTable.h +0 -74
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapMemoryTable.m +0 -603
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapNull.h +0 -17
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapNull.m +0 -35
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapTouch.h +0 -15
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapTouch.m +0 -31
- data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapCollectionKey.h +0 -23
- data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapCollectionKey.m +0 -199
- data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapDatabaseQuery.h +0 -42
- data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapDatabaseQuery.m +0 -96
- data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapSet.h +0 -41
- data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapSet.m +0 -82
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabase.h +0 -547
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabase.m +0 -2013
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseConnection.h +0 -449
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseConnection.m +0 -4046
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseTransaction.h +0 -651
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseTransaction.m +0 -5602
- data/vendor/Pods/build-iPhoneSimulator/Pods.bridgesupport +0 -3172
- data/vendor/Pods/build-iPhoneSimulator/libPods.a +0 -0
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
#import <Foundation/Foundation.h>
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Welcome to YapDatabase!
|
|
5
|
-
*
|
|
6
|
-
* https://github.com/yaptv/YapDatabase
|
|
7
|
-
*
|
|
8
|
-
* The project wiki has a wealth of documentation if you have any questions.
|
|
9
|
-
* https://github.com/yaptv/YapDatabase/wiki
|
|
10
|
-
*
|
|
11
|
-
* YapDatabaseView is an extension designed to work with YapDatabase.
|
|
12
|
-
* It gives you a persistent sorted "view" of a configurable subset of your data.
|
|
13
|
-
*
|
|
14
|
-
* For the full documentation on Views, please see the related wiki article:
|
|
15
|
-
* https://github.com/yaptv/YapDatabase/wiki/Views
|
|
16
|
-
**/
|
|
17
|
-
|
|
18
|
-
@interface YapDatabaseViewOptions : NSObject <NSCopying>
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* A view can either be persistent (saved to sqlite), or non-persistent (kept in memory only).
|
|
22
|
-
*
|
|
23
|
-
* A persistent view saves its content to sqlite database tables.
|
|
24
|
-
* Thus a persistent view can be restored on subsequent app launches with re-population.
|
|
25
|
-
*
|
|
26
|
-
* A non-persistent view is stored in memory.
|
|
27
|
-
* From the outside, it works exactly like a persistent view in every way.
|
|
28
|
-
* You won't be able to tell the difference unless you look at the sqlite database.
|
|
29
|
-
*
|
|
30
|
-
* It's recommended that you use a persistent view for any views that your app needs on a regular basis.
|
|
31
|
-
* For example, if your app's main screen has a tableView powered by a view, that should likely be persistent.
|
|
32
|
-
*
|
|
33
|
-
* Non-persistent views are recommended for those situations where you need a view only temporarily.
|
|
34
|
-
* Or where the configuration of the view is highly dependent upon parameters that change regularly.
|
|
35
|
-
* In general, situations where it doesn't really make sense to persist the view.
|
|
36
|
-
*
|
|
37
|
-
* The default value is YES.
|
|
38
|
-
**/
|
|
39
|
-
@property (nonatomic, assign, readwrite) BOOL isPersistent;
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* You can configure the view to pre-filter all but a subset of collections.
|
|
43
|
-
*
|
|
44
|
-
* The primary motivation for this is to reduce the overhead when first populating the view.
|
|
45
|
-
* For example, if you're creating a view which only includes objects from a single collection,
|
|
46
|
-
* then you could specify that collection here. So when the view first populates itself,
|
|
47
|
-
* it will enumerate over just the allowedCollections, as opposed to enumerating over all collections.
|
|
48
|
-
* And enumerating a small subset of the entire database during view population can improve speed,
|
|
49
|
-
* especially with larger databases.
|
|
50
|
-
*
|
|
51
|
-
* In addition to reducing the overhead when first populating the view,
|
|
52
|
-
* the allowedCollections will pre-filter while you're making changes to the database.
|
|
53
|
-
* So if you add a new object to the database, and the associated collection isn't in allowedCollections,
|
|
54
|
-
* then the groupingBlock will never be invoked, and the view will act as if the groupingBlock returned nil.
|
|
55
|
-
*
|
|
56
|
-
* For all rows whose collection is in the allowedCollections, the view acts normally.
|
|
57
|
-
* So the groupingBlock would still be invoked as normal.
|
|
58
|
-
*
|
|
59
|
-
* The default value is nil.
|
|
60
|
-
**/
|
|
61
|
-
@property (nonatomic, copy, readwrite) NSSet *allowedCollections;
|
|
62
|
-
|
|
63
|
-
@end
|
|
@@ -1,330 +0,0 @@
|
|
|
1
|
-
#import <Foundation/Foundation.h>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Range offsets are specified from either the beginning or end.
|
|
6
|
-
*
|
|
7
|
-
* @see fixedRangeWithLength:offset:from:
|
|
8
|
-
* @see flexibleRangeWithStartingLength:startingOffset:from:
|
|
9
|
-
**/
|
|
10
|
-
typedef enum {
|
|
11
|
-
YapDatabaseViewBeginning = 0, // index == 0
|
|
12
|
-
YapDatabaseViewEnd = 1, // index == last
|
|
13
|
-
|
|
14
|
-
} YapDatabaseViewPin;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Grow options allow you to specify in which direction flexible ranges can grow.
|
|
18
|
-
*
|
|
19
|
-
* @see growOptions
|
|
20
|
-
**/
|
|
21
|
-
typedef enum {
|
|
22
|
-
YapDatabaseViewGrowPinSide = 1 << 0,
|
|
23
|
-
YapDatabaseViewGrowNonPinSide = 1 << 1,
|
|
24
|
-
|
|
25
|
-
YapDatabaseViewGrowInRangeOnly = 0,
|
|
26
|
-
YapDatabaseViewGrowOnBothSides = (YapDatabaseViewGrowPinSide | YapDatabaseViewGrowNonPinSide)
|
|
27
|
-
|
|
28
|
-
} YapDatabaseViewGrowOptions;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Range options allow you to specify a particular range of a group.
|
|
32
|
-
*
|
|
33
|
-
* For example, if a group contains thousands of items,
|
|
34
|
-
* but you only want to display the most recent 50 items in your tableView,
|
|
35
|
-
* then you can easily use range options to accomplish this.
|
|
36
|
-
*
|
|
37
|
-
* YapDatabaseViewRangeOptions are plugged into YapDatabaseViewMappings.
|
|
38
|
-
*
|
|
39
|
-
* @see YapDatabaseViewMappings setRangeOptions:forGroup:
|
|
40
|
-
**/
|
|
41
|
-
@interface YapDatabaseViewRangeOptions : NSObject <NSCopying>
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* There are 2 types of supported ranges: Fixed & Flexible
|
|
45
|
-
*
|
|
46
|
-
* A fixed range is similar to using a LIMIT & OFFSET in a SQL query.
|
|
47
|
-
* That is, it represents a designated range that doesn't change.
|
|
48
|
-
*
|
|
49
|
-
* You create a fixed range by specifying a desired length
|
|
50
|
-
* and an offset from either the beginning or end.
|
|
51
|
-
*
|
|
52
|
-
* @param length
|
|
53
|
-
* The desired length of the range.
|
|
54
|
-
* The length doesn't need to be valid at this point in time.
|
|
55
|
-
* For example, if the group only has 4 items, you can still specify a length of 20 if that is the desired length.
|
|
56
|
-
* The mappings will automatically use a length of 4 to start, and automatically expand up to 20.
|
|
57
|
-
*
|
|
58
|
-
* @param offset
|
|
59
|
-
* The offset from one either the beginning or end of the group.
|
|
60
|
-
*
|
|
61
|
-
* @param beginningOrEnd
|
|
62
|
-
* Either YapDatabaseViewBeginning or YapDatabaseViewEnd.
|
|
63
|
-
*
|
|
64
|
-
* Using YapDatabaseViewMappings along with a fixed range provides some unique features:
|
|
65
|
-
*
|
|
66
|
-
* - If you specify an offset from the end of the group (YapDatabaseViewEnd),
|
|
67
|
-
* you are essentially "pinning" the range to the end, and it will stay pinned that way regardless of
|
|
68
|
-
* inserted or deleted items elsewhere in the group.
|
|
69
|
-
*
|
|
70
|
-
* For example: If you pin the range to the end, with an offset of zero, and a length of 20,
|
|
71
|
-
* then the range will always specify the last 20 items in the group,
|
|
72
|
-
* even as the group length (as a whole) increases or decreases.
|
|
73
|
-
*
|
|
74
|
-
* - The changeset processing will automatically create the proper row changes to match what you want.
|
|
75
|
-
*
|
|
76
|
-
* For example: You have a fixed range with length 20, pinned to the beginning with an offset of 0,
|
|
77
|
-
* and a new item is inserted at index 0. The changeset processing will automatically give you a row
|
|
78
|
-
* insert at index 0, and a row delete at the end of your range to properly account for the row
|
|
79
|
-
* that got pushed outside your range.
|
|
80
|
-
*
|
|
81
|
-
* Thus you get row animations for free, even when only displaying a subset.
|
|
82
|
-
* And all the math is already done for you.
|
|
83
|
-
**/
|
|
84
|
-
+ (YapDatabaseViewRangeOptions *)fixedRangeWithLength:(NSUInteger)length
|
|
85
|
-
offset:(NSUInteger)offset
|
|
86
|
-
from:(YapDatabaseViewPin)beginningOrEnd;
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* There are 2 types of supported ranges: Fixed & Flexible
|
|
90
|
-
*
|
|
91
|
-
* A flexible range is designed to grow and shrink.
|
|
92
|
-
* To explain this concept, consider Apple's SMS Messages app:
|
|
93
|
-
*
|
|
94
|
-
* When you go into a conversation (tap on a persons name),
|
|
95
|
-
* the messages app starts by displaying the most recent 50 messages (with the most recent at bottom).
|
|
96
|
-
* Although there might be thousands of old messages between you and the other person,
|
|
97
|
-
* only 50 are in the view to begin with.
|
|
98
|
-
* As you send and/or receive messages within the view, the length will grow.
|
|
99
|
-
* And similarly, if you manually delete messages, the length will shrink.
|
|
100
|
-
*
|
|
101
|
-
* Flexible ranges are designed to handle these types of user interfaces.
|
|
102
|
-
* They're also quite customizeable to handle a number of different situations.
|
|
103
|
-
*
|
|
104
|
-
* You create a flexible range by specifying an starting length
|
|
105
|
-
* and an offset from either the beginning or end.
|
|
106
|
-
*
|
|
107
|
-
* @param length
|
|
108
|
-
* The desired starting length of the range.
|
|
109
|
-
* The length doesn't need to be valid at this point in time.
|
|
110
|
-
* For example, if the group only has 4 items, you can still specify a length of 20.
|
|
111
|
-
* The mappings will automatically correct the length as appropriate.
|
|
112
|
-
*
|
|
113
|
-
* @param offset
|
|
114
|
-
* The offset from one either the beginning or end of the group.
|
|
115
|
-
*
|
|
116
|
-
* @param beginningOrEnd
|
|
117
|
-
* Either YapDatabaseViewBeginning or YapDatabaseViewEnd.
|
|
118
|
-
*
|
|
119
|
-
* Using YapDatabaseViewMappings along with a flexible range provides some unique features:
|
|
120
|
-
*
|
|
121
|
-
* - If you specify an offset from the end of the group (YapDatabaseViewEnd),
|
|
122
|
-
* you are essentially "pinning" the range to the end, and it will stay pinned that way regardless of
|
|
123
|
-
* inserted or deleted items elsewhere in the group.
|
|
124
|
-
*
|
|
125
|
-
* For example: If you pin the range to the end, with an offset of zero,
|
|
126
|
-
* then the range length will grow as items are added to the end.
|
|
127
|
-
*
|
|
128
|
-
* - The changeset processing will automatically create the proper row changes to match what you want.
|
|
129
|
-
*
|
|
130
|
-
* Thus you get row animations for free, even when only displaying a subset.
|
|
131
|
-
* And all the math is already done for you.
|
|
132
|
-
**/
|
|
133
|
-
+ (YapDatabaseViewRangeOptions *)flexibleRangeWithLength:(NSUInteger)length
|
|
134
|
-
offset:(NSUInteger)offset
|
|
135
|
-
from:(YapDatabaseViewPin)beginningOrEnd;
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* The current length of the range.
|
|
139
|
-
*
|
|
140
|
-
* When rangeOptions get plugged into mappings, the length is automatically updated to reflect the available length.
|
|
141
|
-
*
|
|
142
|
-
* For a fixed range, the length will always be less than or equal to the original length.
|
|
143
|
-
* For a flexible range, the length will grow and shrink as items get inserted and removed from the original range.
|
|
144
|
-
**/
|
|
145
|
-
@property (nonatomic, assign, readonly) NSUInteger length;
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* The current offset of the range, relative to the pin (beginning or end of the group).
|
|
149
|
-
*
|
|
150
|
-
* For a fixed range, the offset never changes.
|
|
151
|
-
* For a flexible range, the offset will grow and shrink as items get inserted and removed between the range and pin.
|
|
152
|
-
**/
|
|
153
|
-
@property (nonatomic, assign, readonly) NSUInteger offset;
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* The pin value represents the end from which the offset is calculated.
|
|
157
|
-
* For example, assume a group contains 50 items and:
|
|
158
|
-
*
|
|
159
|
-
* - length=10, offset=10, pin=YapDatabaseViewBeginning => the range is [10-19](inclusive) (10 back from 0)
|
|
160
|
-
*
|
|
161
|
-
* - length=10, offset=10, pin=YapDatabaseViewEnd => the range is [30-39](inclusive) (10 back from 49)
|
|
162
|
-
**/
|
|
163
|
-
@property (nonatomic, assign, readonly) YapDatabaseViewPin pin;
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* There are 2 types of supported ranges: Fixed & Flexible
|
|
167
|
-
**/
|
|
168
|
-
@property (nonatomic, readonly) BOOL isFixedRange;
|
|
169
|
-
@property (nonatomic, readonly) BOOL isFlexibleRange;
|
|
170
|
-
|
|
171
|
-
/**
|
|
172
|
-
* For FIXED ranges:
|
|
173
|
-
* - the maxLength is readonly.
|
|
174
|
-
* - it will always equal the length originally specified.
|
|
175
|
-
*
|
|
176
|
-
* For FLEXIBLE ranges:
|
|
177
|
-
* - the maxLength allows you to specify a maximum length in which the range can grow.
|
|
178
|
-
*
|
|
179
|
-
* In particular, if the range overflows the maxLength, then the changeset processing will automatically
|
|
180
|
-
* trim items from the range (on the non-pin-side) to keep the range length within this maxLength.
|
|
181
|
-
*
|
|
182
|
-
* For example, imagine you're displaying log entries in a tableView.
|
|
183
|
-
* The range is pinned to the end, so as new log entries get appended to the database, they automatically get
|
|
184
|
-
* inserted into the tableView. This allows the tableView to grow as the log grows. However, you don't want the
|
|
185
|
-
* tableView growing too big, so you can set the maxLength in order to prevent this. That way, your tableView
|
|
186
|
-
* grows as the logs come in (as expected). But if your tableView starts to get too big,
|
|
187
|
-
* then the oldest log entries in the tableView start to fall off as new entries arrive.
|
|
188
|
-
* This is eqivalent to switching from a flexible range to a fixed range,
|
|
189
|
-
* but happens automatically without you having to write extra code to handle the edge case.
|
|
190
|
-
*
|
|
191
|
-
* By default there is no maxLength, and thus the default maxLength is NSUIntegerMax.
|
|
192
|
-
**/
|
|
193
|
-
@property (nonatomic, readwrite) NSUInteger maxLength;
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* For FIXED ranges:
|
|
197
|
-
* - the minLength is readonly.
|
|
198
|
-
* - it will always equal zero.
|
|
199
|
-
*
|
|
200
|
-
* For FLEXIBLE ranges:
|
|
201
|
-
* - the minLength allows you to specify a minimum length that the range should keep (if possible).
|
|
202
|
-
*
|
|
203
|
-
* In particular, if the range underflows the minLength, then the changeset processing will automatically
|
|
204
|
-
* adjust the offset or expand the range in order to keep entries in the view.
|
|
205
|
-
*
|
|
206
|
-
* This is sometimes useful if items can get deleted from your range.
|
|
207
|
-
*
|
|
208
|
-
* By default there is no minLength, and thus the default minLength is zero.
|
|
209
|
-
**/
|
|
210
|
-
@property (nonatomic, readwrite) NSUInteger minLength;
|
|
211
|
-
|
|
212
|
-
/**
|
|
213
|
-
* GrowOptions ONLY apply to FLEXIBLE ranges.
|
|
214
|
-
*
|
|
215
|
-
* The growOptions allow you to specify in which direction(s) the range may grow.
|
|
216
|
-
* Let's look at a few concrete examples.
|
|
217
|
-
*
|
|
218
|
-
* Example #1
|
|
219
|
-
*
|
|
220
|
-
* We're using a flexible range, with an offset of zero, pinned to the beginning.
|
|
221
|
-
* We're displaying news items, and the most recent items get inserted at index 0.
|
|
222
|
-
* The group currently contains thousands of items, and our range has a starting length of 50.
|
|
223
|
-
* If a new item gets inserted (at the beginning), we want it to get added to our range.
|
|
224
|
-
* So we would set our growOptions to be YapDatabaseViewGrowPinSide (this is the default value).
|
|
225
|
-
*
|
|
226
|
-
* Example #2
|
|
227
|
-
*
|
|
228
|
-
* We're using a flexible range, with an offset of zero, pinned to the end.
|
|
229
|
-
* We're displaying log entries, with the most recent items getting appended to the end.
|
|
230
|
-
* The group currently contains thousands of items, and our range has a starting length of 50.
|
|
231
|
-
* If a new log item gets inserted (at the end), we want it to get added to our range.
|
|
232
|
-
* So we would set our growOptions to be YapDatabaseViewGrowPinSide (this is the default value).
|
|
233
|
-
*
|
|
234
|
-
* Example #3
|
|
235
|
-
*
|
|
236
|
-
* We're making a UI that is somewhat akin to Facebook's news feed.
|
|
237
|
-
* That is, the most recent items come in at the top,
|
|
238
|
-
* but if you scroll to the bottom we automatically download older posts.
|
|
239
|
-
* However, we don't want to limit how far the user can scroll down.
|
|
240
|
-
* That is, if the user is bored, we're going to allow them to scroll down for
|
|
241
|
-
* however long we can fetch old items from the server.
|
|
242
|
-
* But obviously we can't allow the length of our tableView to grow infinitely long.
|
|
243
|
-
* So to accomplish this, we're going to use flexible ranges,
|
|
244
|
-
* and we're going to shift the length as the user scrolls down.
|
|
245
|
-
* To start with, we only have the 30 most recent posts in the database.
|
|
246
|
-
* And we set our flexible range as: length=30, offset=0, pin=YapDatabaseViewBeginning.
|
|
247
|
-
* Additionally we set our growOptions to: YapDatabaseViewGrowOnBothSides.
|
|
248
|
-
* Thus if we download new items, they'll get included in the range.
|
|
249
|
-
* And if we fetch older items, they'll also get included in the range.
|
|
250
|
-
* Now as the the user scrolls down, and we fetch more and more old items,
|
|
251
|
-
* we eventually get to the point were we shift the range.
|
|
252
|
-
* So when the range length gets to some max length that we want to support, we shift to a new flexible range:
|
|
253
|
-
* length=max, offset=0, pin=YapDatabaseViewEnd, growOptions=YapDatabaseViewGrowPinSide, maxLength=max
|
|
254
|
-
* This new range will keep the tableView length capped at max, and continually load older content as it gets fetched.
|
|
255
|
-
* To allow the user to scroll back up, we just increment the offset as the go.
|
|
256
|
-
* When they eventually get back up to the top, we reset the flexible range to its original value.
|
|
257
|
-
*
|
|
258
|
-
*
|
|
259
|
-
* To explain the different options, consider the following picture:
|
|
260
|
-
*
|
|
261
|
-
* - - - - -
|
|
262
|
-
* | |x|x|x| | <-- x marks the range
|
|
263
|
-
* - - - - -
|
|
264
|
-
* 0 1 2 3 4
|
|
265
|
-
*
|
|
266
|
-
* groupCount = 5
|
|
267
|
-
* flexibleRange: length=3, offset=1, pin=YapDatabaseViewBeginning, growOptions=YapDatabaseViewGrowPinSide
|
|
268
|
-
*
|
|
269
|
-
* Now an item gets inserted at index 1 as follows:
|
|
270
|
-
*
|
|
271
|
-
* - - - - - -
|
|
272
|
-
* | |?|x|x|x| | <-- is ? added to the flexible range?
|
|
273
|
-
* - - - - - -
|
|
274
|
-
* 0 1 2 3 4 5
|
|
275
|
-
*
|
|
276
|
-
* Does the item get added to the flexible range (with the given config options)?
|
|
277
|
-
* The answer is YES.
|
|
278
|
-
*
|
|
279
|
-
* - - - - - -
|
|
280
|
-
* | |x|x|x|x| | <-- YES (based on pin & growOptions)
|
|
281
|
-
* - - - - - -
|
|
282
|
-
* 0 1 2 3 4 5
|
|
283
|
-
*
|
|
284
|
-
* Because the flexible range is pinned to the beginning, and grows pin side.
|
|
285
|
-
* So if anything gets inserted between what was originally at index 0, and what was originally at index 1,
|
|
286
|
-
* then those items get added to the flexible range.
|
|
287
|
-
*
|
|
288
|
-
* Notice that after the insert, the offset remains set at 1.
|
|
289
|
-
* Notice that the answer would be NO if the flexible range was pinned to the end (with the same growOptions).
|
|
290
|
-
*
|
|
291
|
-
* Now let's see what happens if something gets inserted at the end:
|
|
292
|
-
*
|
|
293
|
-
* - - - - - - -
|
|
294
|
-
* | |x|x|x|x|?| | <-- is ? added to the flexible range?
|
|
295
|
-
* - - - - - - -
|
|
296
|
-
* 0 1 2 3 4 5 6
|
|
297
|
-
*
|
|
298
|
-
* Does the item get added to the flexible range (with the given config options)?
|
|
299
|
-
* The answer is NO.
|
|
300
|
-
*
|
|
301
|
-
* - - - - - - -
|
|
302
|
-
* | |x|x|x|x| | | <-- NO (based on pin & growOptions)
|
|
303
|
-
* - - - - - - -
|
|
304
|
-
* 0 1 2 3 4 5 6
|
|
305
|
-
*
|
|
306
|
-
* Because the flexible range is pinned to the beginning, and grows pin side.
|
|
307
|
-
*
|
|
308
|
-
* Notice that after the insert, the offset remains set at 1.
|
|
309
|
-
* Notice that the answer would be YES if the flexible range was pinned to the end (with the same growOptions).
|
|
310
|
-
*
|
|
311
|
-
* - - - - - - - - - - - - - - - -
|
|
312
|
-
* |?| |x|x|x|x| | | => NEVER => | | |x|x|x|x| | |
|
|
313
|
-
* - - - - - - - - - - - - - - - -
|
|
314
|
-
* 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
|
|
315
|
-
*
|
|
316
|
-
* - - - - - - - - - - - - - - - - - -
|
|
317
|
-
* | | |x|?|x|x|x| | | => ALWAYS => | | |x|x|x|x|x| | |
|
|
318
|
-
* - - - - - - - - - - - - - - - - - -
|
|
319
|
-
* 0 1 2 3 4 5 6 7 8 0 1 2 3 4 5 6 7 8
|
|
320
|
-
**/
|
|
321
|
-
@property (nonatomic, readwrite) YapDatabaseViewGrowOptions growOptions;
|
|
322
|
-
|
|
323
|
-
/**
|
|
324
|
-
* Various copy options.
|
|
325
|
-
**/
|
|
326
|
-
- (id)copyWithNewLength:(NSUInteger)newLength;
|
|
327
|
-
- (id)copyWithNewOffset:(NSUInteger)newOffset;
|
|
328
|
-
- (id)copyWithNewLength:(NSUInteger)newLength newOffset:(NSUInteger)newOffset;
|
|
329
|
-
|
|
330
|
-
@end
|
|
@@ -1,498 +0,0 @@
|
|
|
1
|
-
#import <Foundation/Foundation.h>
|
|
2
|
-
|
|
3
|
-
#import "YapDatabaseExtensionTransaction.h"
|
|
4
|
-
#import "YapDatabaseViewTypes.h"
|
|
5
|
-
#import "YapDatabaseViewMappings.h"
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Welcome to YapDatabase!
|
|
9
|
-
*
|
|
10
|
-
* The project page has a wealth of documentation if you have any questions.
|
|
11
|
-
* https://github.com/yaptv/YapDatabase
|
|
12
|
-
*
|
|
13
|
-
* If you're new to the project you may want to check out the wiki
|
|
14
|
-
* https://github.com/yaptv/YapDatabase/wiki
|
|
15
|
-
*
|
|
16
|
-
* YapDatabaseView is an extension designed to work with YapDatabase.
|
|
17
|
-
* It gives you a persistent sorted "view" of a configurable subset of your data.
|
|
18
|
-
*
|
|
19
|
-
* For more information, please see the wiki article about Views:
|
|
20
|
-
* https://github.com/yaptv/YapDatabase/wiki/Views
|
|
21
|
-
*
|
|
22
|
-
* You may also wish to consult the documentation in YapDatabaseView.h for information on setting up a view.
|
|
23
|
-
*
|
|
24
|
-
* You access this class within a regular transaction.
|
|
25
|
-
* For example:
|
|
26
|
-
*
|
|
27
|
-
* [databaseConnection readWithBlock:^(YapDatabaseReadTransaction *transaction){
|
|
28
|
-
*
|
|
29
|
-
* topUsaSale = [[transaction ext:@"myView"] objectAtIndex:0 inGroup:@"usa"]
|
|
30
|
-
* }];
|
|
31
|
-
*
|
|
32
|
-
* Keep in mind that the YapDatabaseViewTransaction object is linked to the YapDatabaseReadTransaction object.
|
|
33
|
-
* So don't try to use it outside the transaction block (cause it won't work).
|
|
34
|
-
**/
|
|
35
|
-
@interface YapDatabaseViewTransaction : YapDatabaseExtensionTransaction
|
|
36
|
-
|
|
37
|
-
#pragma mark Groups
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Returns the number of groups the view manages.
|
|
41
|
-
* Each group has one or more keys in it.
|
|
42
|
-
**/
|
|
43
|
-
- (NSUInteger)numberOfGroups;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Returns the names of all groups in an unsorted array.
|
|
47
|
-
* Each group has one or more keys in it.
|
|
48
|
-
*
|
|
49
|
-
* @see YapDatabaseView - groupingBlock
|
|
50
|
-
**/
|
|
51
|
-
- (NSArray *)allGroups;
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Returns YES if there are any keys in the given group.
|
|
55
|
-
* This is equivalent to ([viewTransaction numberOfKeysInGroup:group] > 0)
|
|
56
|
-
**/
|
|
57
|
-
- (BOOL)hasGroup:(NSString *)group;
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Returns the total number of keys in the given group.
|
|
61
|
-
* If the group doesn't exist, returns zero.
|
|
62
|
-
**/
|
|
63
|
-
- (NSUInteger)numberOfKeysInGroup:(NSString *)group;
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Returns the total number of keys in every single group.
|
|
67
|
-
**/
|
|
68
|
-
- (NSUInteger)numberOfKeysInAllGroups;
|
|
69
|
-
|
|
70
|
-
#pragma mark Fetching
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Returns the key & collection at the given index within the given group.
|
|
74
|
-
* Returns nil if the group doesn't exist, or if the index is out of bounds.
|
|
75
|
-
**/
|
|
76
|
-
- (BOOL)getKey:(NSString **)keyPtr
|
|
77
|
-
collection:(NSString **)collectionPtr
|
|
78
|
-
atIndex:(NSUInteger)index
|
|
79
|
-
inGroup:(NSString *)group;
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Shortcut for: [view getKey:&key collection:&collection atIndex:0 inGroup:group]
|
|
83
|
-
**/
|
|
84
|
-
- (BOOL)getFirstKey:(NSString **)keyPtr collection:(NSString **)collectionPtr inGroup:(NSString *)group;
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Shortcut for: [view getKey:&key collection:&collection atIndex:(numberOfKeysInGroup-1) inGroup:group]
|
|
88
|
-
**/
|
|
89
|
-
- (BOOL)getLastKey:(NSString **)keyPtr collection:(NSString **)collectionPtr inGroup:(NSString *)group;
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Shortcut for fetching just the collection at the given index.
|
|
93
|
-
**/
|
|
94
|
-
- (NSString *)collectionAtIndex:(NSUInteger)index inGroup:(NSString *)group;
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Shortcut for fetching just the key at the given index.
|
|
98
|
-
* Convenient if you already know what collection the key is in.
|
|
99
|
-
**/
|
|
100
|
-
- (NSString *)keyAtIndex:(NSUInteger)index inGroup:(NSString *)group;
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* If the given {collection, key} are included in the view, then returns the associated group.
|
|
104
|
-
* If the {collection, key} isn't in the view, then returns nil.
|
|
105
|
-
**/
|
|
106
|
-
- (NSString *)groupForKey:(NSString *)key inCollection:(NSString *)collection;
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Fetches both the group and the index within the group for the given {collection, key}.
|
|
110
|
-
*
|
|
111
|
-
* Returns YES if the {collection, key} is included in the view.
|
|
112
|
-
* Otherwise returns NO, and sets the parameters to nil & zero.
|
|
113
|
-
**/
|
|
114
|
-
- (BOOL)getGroup:(NSString **)groupPtr
|
|
115
|
-
index:(NSUInteger *)indexPtr
|
|
116
|
-
forKey:(NSString *)key
|
|
117
|
-
inCollection:(NSString *)collection;
|
|
118
|
-
|
|
119
|
-
#pragma mark Finding
|
|
120
|
-
|
|
121
|
-
typedef id YapDatabaseViewFindBlock; // One of the YapDatabaseViewFindX types below.
|
|
122
|
-
|
|
123
|
-
typedef NSComparisonResult (^YapDatabaseViewFindWithKeyBlock) \
|
|
124
|
-
(NSString *collection, NSString *key);
|
|
125
|
-
typedef NSComparisonResult (^YapDatabaseViewFindWithObjectBlock) \
|
|
126
|
-
(NSString *collection, NSString *key, id object);
|
|
127
|
-
typedef NSComparisonResult (^YapDatabaseViewFindWithMetadataBlock) \
|
|
128
|
-
(NSString *collection, NSString *key, id metadata);
|
|
129
|
-
typedef NSComparisonResult (^YapDatabaseViewFindWithRowBlock) \
|
|
130
|
-
(NSString *collection, NSString *key, id object, id metadata);
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* This method uses a binary search algorithm to find a range of items within the view that match the given criteria.
|
|
134
|
-
* For example:
|
|
135
|
-
*
|
|
136
|
-
* You have a view which sorts items by timestamp (oldest to newest)
|
|
137
|
-
* You could then use this method to quickly find all items whose timestamp falls on a certain day.
|
|
138
|
-
* Or, more generally, within a certain timespan.
|
|
139
|
-
*
|
|
140
|
-
* NSDate *beginningOfMonday = ... // Monday at 12:00 AM
|
|
141
|
-
* NSDate *beginningOfTuesday = ... // Tuesday at 12:00 AM
|
|
142
|
-
*
|
|
143
|
-
* YapDatabaseViewBlockType blockType = YapDatabaseViewBlockTypeWithObject;
|
|
144
|
-
* YapDatabaseViewFindWithObjectBlock block = ^(NSString *key, id object){
|
|
145
|
-
*
|
|
146
|
-
* Purchase *purchase = (Purchase *)object;
|
|
147
|
-
*
|
|
148
|
-
* if ([purchase.timestamp compare:beginningOfMonday] == NSOrderedAscending) // earlier than start range
|
|
149
|
-
* return NSOrderedAscending;
|
|
150
|
-
*
|
|
151
|
-
* if ([purchase.timestamp compare:beginningOfTuesday] == NSOrderedAscending) // earlier than end range
|
|
152
|
-
* return NSOrderedSame;
|
|
153
|
-
*
|
|
154
|
-
* return NSOrderedDescending; // greater than end range (or exactly midnight on tuesday)
|
|
155
|
-
* };
|
|
156
|
-
*
|
|
157
|
-
* The return values from the YapDatabaseViewFindBlock have the following meaning:
|
|
158
|
-
*
|
|
159
|
-
* - NSOrderedAscending : The given row (block parameters) is less than the range I'm looking for.
|
|
160
|
-
* That is, the row would have a smaller index within the view than would the range I seek.
|
|
161
|
-
*
|
|
162
|
-
* - NSOrderedDecending : The given row (block parameters) is greater than the range I'm looking for.
|
|
163
|
-
* That is, the row would have a greater index within the view than would the range I seek.
|
|
164
|
-
*
|
|
165
|
-
* - NSOrderedSame : The given row (block parameters) is within the range I'm looking for.
|
|
166
|
-
*
|
|
167
|
-
* Keep in mind 2 things:
|
|
168
|
-
*
|
|
169
|
-
* #1 : This method can only be used if you need to find items according to their sort order.
|
|
170
|
-
* That is, according to how the items are sorted via the view's sortingBlock.
|
|
171
|
-
* Attempting to use this method in any other manner makes no sense.
|
|
172
|
-
*
|
|
173
|
-
* #2 : The findBlock that you pass needs to be setup in the same manner as the view's sortingBlock.
|
|
174
|
-
* That is, the following rules must be followed, or the results will be incorrect:
|
|
175
|
-
*
|
|
176
|
-
* For example, say you have a view like this, looking for the following range of 3 items:
|
|
177
|
-
* myView = @[ A, B, C, D, E, F, G ]
|
|
178
|
-
* ^^^^^^^
|
|
179
|
-
* sortingBlock(A, B) => NSOrderedAscending
|
|
180
|
-
* findBlock(A) => NSOrderedAscending
|
|
181
|
-
*
|
|
182
|
-
* sortingBlock(E, D) => NSOrderedDescending
|
|
183
|
-
* findBlock(E) => NSOrderedDescending
|
|
184
|
-
*
|
|
185
|
-
* findBlock(B) => NSOrderedSame
|
|
186
|
-
* findBlock(C) => NSOrderedSame
|
|
187
|
-
* findBlock(D) => NSOrderedSame
|
|
188
|
-
*
|
|
189
|
-
* In other words, you can't sort one way in the sortingBlock, and "sort" another way in the findBlock.
|
|
190
|
-
* Another way to think about it is in terms of how the Apple docs define the NSOrdered enums:
|
|
191
|
-
*
|
|
192
|
-
* NSOrderedAscending : The left operand is smaller than the right operand.
|
|
193
|
-
* NSOrderedDescending : The left operand is greater than the right operand.
|
|
194
|
-
*
|
|
195
|
-
* For the findBlock, the "left operand" is the row that is passed,
|
|
196
|
-
* and the "right operand" is the desired range.
|
|
197
|
-
*
|
|
198
|
-
* And NSOrderedSame means: "the passed row is within the range I'm looking for".
|
|
199
|
-
*
|
|
200
|
-
* Implementation Note:
|
|
201
|
-
* This method uses a binary search to find an item for which the block returns NSOrderedSame.
|
|
202
|
-
* It then uses information from the first binary search (known min/max) to perform two subsequent binary searches.
|
|
203
|
-
* One to find the start of the range, and another to find the end of the range.
|
|
204
|
-
* Thus:
|
|
205
|
-
* - the implementation is efficient
|
|
206
|
-
* - the block won't be invoked for every item within the range
|
|
207
|
-
*
|
|
208
|
-
* @param group
|
|
209
|
-
* The group within the view to search.
|
|
210
|
-
*
|
|
211
|
-
* @param block
|
|
212
|
-
* One of the YapDatabaseViewFindWithXBlock types.
|
|
213
|
-
*
|
|
214
|
-
* @param blockType
|
|
215
|
-
* The proper YapDatabaseViewBlockTypeWithX type that matches the given block.
|
|
216
|
-
*
|
|
217
|
-
* @return
|
|
218
|
-
* If found, the range that matches the items within the desired range.
|
|
219
|
-
* That is, is these items were passed to the given block, the block would return NSOrderedSame.
|
|
220
|
-
* If not found, returns NSMakeRange(NSNotFound, 0).
|
|
221
|
-
**/
|
|
222
|
-
- (NSRange)findRangeInGroup:(NSString *)group
|
|
223
|
-
usingBlock:(YapDatabaseViewFindBlock)block
|
|
224
|
-
blockType:(YapDatabaseViewBlockType)blockType;
|
|
225
|
-
|
|
226
|
-
#pragma mark Enumerating
|
|
227
|
-
|
|
228
|
-
/**
|
|
229
|
-
* Enumerates the keys in the given group.
|
|
230
|
-
**/
|
|
231
|
-
- (void)enumerateKeysInGroup:(NSString *)group
|
|
232
|
-
usingBlock:(void (^)(NSString *collection, NSString *key, NSUInteger index, BOOL *stop))block;
|
|
233
|
-
|
|
234
|
-
/**
|
|
235
|
-
* Enumerates the keys in the given group.
|
|
236
|
-
* Reverse enumeration is supported by passing NSEnumerationReverse. (No other enumeration options are supported.)
|
|
237
|
-
**/
|
|
238
|
-
- (void)enumerateKeysInGroup:(NSString *)group
|
|
239
|
-
withOptions:(NSEnumerationOptions)options
|
|
240
|
-
usingBlock:(void (^)(NSString *collection, NSString *key, NSUInteger index, BOOL *stop))block;
|
|
241
|
-
|
|
242
|
-
/**
|
|
243
|
-
* Enumerates the keys in the range of the given group.
|
|
244
|
-
* Reverse enumeration is supported by passing NSEnumerationReverse. (No other enumeration options are supported.)
|
|
245
|
-
**/
|
|
246
|
-
- (void)enumerateKeysInGroup:(NSString *)group
|
|
247
|
-
withOptions:(NSEnumerationOptions)options
|
|
248
|
-
range:(NSRange)range
|
|
249
|
-
usingBlock:(void (^)(NSString *collection, NSString *key, NSUInteger index, BOOL *stop))block;
|
|
250
|
-
|
|
251
|
-
@end
|
|
252
|
-
|
|
253
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
254
|
-
#pragma mark -
|
|
255
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
256
|
-
|
|
257
|
-
@interface YapDatabaseViewTransaction (ReadWrite)
|
|
258
|
-
|
|
259
|
-
/**
|
|
260
|
-
* "Touching" a object allows you to mark an item in the view as "updated",
|
|
261
|
-
* even if the object itself wasn't directly updated.
|
|
262
|
-
*
|
|
263
|
-
* This is most often useful when a view is being used by a tableView,
|
|
264
|
-
* but the tableView cells are also dependent upon another object in the database.
|
|
265
|
-
*
|
|
266
|
-
* For example:
|
|
267
|
-
*
|
|
268
|
-
* You have a view which includes the departments in the company, sorted by name.
|
|
269
|
-
* But as part of the cell that's displayed for the department,
|
|
270
|
-
* you also display the number of employees in the department.
|
|
271
|
-
* The employee count comes from elsewhere.
|
|
272
|
-
* That is, the employee count isn't a property of the department object itself.
|
|
273
|
-
* Perhaps you get the count from another view,
|
|
274
|
-
* or perhaps the count is simply the number of keys in a particular collection.
|
|
275
|
-
* Either way, when you add or remove an employee, you want to ensure that the view marks the
|
|
276
|
-
* affected department as updated so that the corresponding cell will properly redraw itself.
|
|
277
|
-
*
|
|
278
|
-
* So the idea is to mark certain items as "updated" (in terms of this view) so that
|
|
279
|
-
* the changeset for the view will properly reflect a change to the corresponding index.
|
|
280
|
-
* But you don't actually need to update the item on disk.
|
|
281
|
-
* This is exactly what "touch" does.
|
|
282
|
-
*
|
|
283
|
-
* Touching an item has very minimal overhead.
|
|
284
|
-
* It doesn't cause the groupingBlock or sortingBlock to be invoked,
|
|
285
|
-
* and it doesn't cause any writes to the database.
|
|
286
|
-
*
|
|
287
|
-
* You can touch
|
|
288
|
-
* - just the object
|
|
289
|
-
* - just the metadata
|
|
290
|
-
* - or both object and metadata (the row)
|
|
291
|
-
*
|
|
292
|
-
* If you mark just the object as changed,
|
|
293
|
-
* and neither the groupingBlock nor sortingBlock depend upon the object,
|
|
294
|
-
* then the view doesn't reflect any change.
|
|
295
|
-
*
|
|
296
|
-
* If you mark just the metadata as changed,
|
|
297
|
-
* and neither the groupingBlock nor sortingBlock depend upon the metadata,
|
|
298
|
-
* then the view doesn't relect any change.
|
|
299
|
-
*
|
|
300
|
-
* In all other cases, the view will properly reflect a corresponding change in the notification that's posted.
|
|
301
|
-
**/
|
|
302
|
-
|
|
303
|
-
- (void)touchRowForKey:(NSString *)key inCollection:(NSString *)collection;
|
|
304
|
-
- (void)touchObjectForKey:(NSString *)key inCollection:(NSString *)collection;
|
|
305
|
-
- (void)touchMetadataForKey:(NSString *)key inCollection:(NSString *)collection;
|
|
306
|
-
|
|
307
|
-
/**
|
|
308
|
-
* This method allows you to change the groupingBlock and/or sortingBlock on-the-fly.
|
|
309
|
-
*
|
|
310
|
-
* Note: You must pass a different versionTag, or this method does nothing.
|
|
311
|
-
**/
|
|
312
|
-
- (void)setGroupingBlock:(YapDatabaseViewGroupingBlock)groupingBlock
|
|
313
|
-
groupingBlockType:(YapDatabaseViewBlockType)groupingBlockType
|
|
314
|
-
sortingBlock:(YapDatabaseViewSortingBlock)sortingBlock
|
|
315
|
-
sortingBlockType:(YapDatabaseViewBlockType)sortingBlockType
|
|
316
|
-
versionTag:(NSString *)versionTag;
|
|
317
|
-
|
|
318
|
-
@end
|
|
319
|
-
|
|
320
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
321
|
-
#pragma mark -
|
|
322
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
323
|
-
|
|
324
|
-
/**
|
|
325
|
-
* YapDatabaseView deals with ordered arrays of collection/key tuples.
|
|
326
|
-
* So, strictly speaking, it only knows about collection/key tuples, groups, and indexes.
|
|
327
|
-
*
|
|
328
|
-
* But it's really convenient to have methods that put it all together to fetch an object in a single method.
|
|
329
|
-
**/
|
|
330
|
-
@interface YapDatabaseViewTransaction (Convenience)
|
|
331
|
-
|
|
332
|
-
/**
|
|
333
|
-
* Equivalent to invoking:
|
|
334
|
-
*
|
|
335
|
-
* NSString *collection, *key;
|
|
336
|
-
* if ([[transaction ext:@"myView"] getKey:&key collection:&collection atIndex:index inGroup:group]) {
|
|
337
|
-
* object = [transaction objectForKey:key inCollection:collection];
|
|
338
|
-
* }
|
|
339
|
-
**/
|
|
340
|
-
- (id)objectAtIndex:(NSUInteger)keyIndex inGroup:(NSString *)group;
|
|
341
|
-
|
|
342
|
-
/**
|
|
343
|
-
* Equivalent to invoking:
|
|
344
|
-
*
|
|
345
|
-
* NSString *collection, *key;
|
|
346
|
-
* if ([[transaction ext:@"myView"] getFirstKey:&key collection:&collection inGroup:group]) {
|
|
347
|
-
* object = [transaction objectForKey:key inCollection:collection];
|
|
348
|
-
* }
|
|
349
|
-
**/
|
|
350
|
-
- (id)firstObjectInGroup:(NSString *)group;
|
|
351
|
-
|
|
352
|
-
/**
|
|
353
|
-
* Equivalent to invoking:
|
|
354
|
-
*
|
|
355
|
-
* NSString *collection, *key;
|
|
356
|
-
* if ([[transaction ext:@"myView"] getLastKey:&key collection:&collection inGroup:group]) {
|
|
357
|
-
* object = [transaction objectForKey:key inCollection:collection];
|
|
358
|
-
* }
|
|
359
|
-
**/
|
|
360
|
-
- (id)lastObjectInGroup:(NSString *)group;
|
|
361
|
-
|
|
362
|
-
/**
|
|
363
|
-
* The following methods are equivalent to invoking the enumerateKeysInGroup:... methods,
|
|
364
|
-
* and then fetching the metadata within your own block.
|
|
365
|
-
**/
|
|
366
|
-
|
|
367
|
-
- (void)enumerateKeysAndMetadataInGroup:(NSString *)group
|
|
368
|
-
usingBlock:
|
|
369
|
-
(void (^)(NSString *collection, NSString *key, id metadata, NSUInteger index, BOOL *stop))block;
|
|
370
|
-
|
|
371
|
-
- (void)enumerateKeysAndMetadataInGroup:(NSString *)group
|
|
372
|
-
withOptions:(NSEnumerationOptions)options
|
|
373
|
-
usingBlock:
|
|
374
|
-
(void (^)(NSString *collection, NSString *key, id metadata, NSUInteger index, BOOL *stop))block;
|
|
375
|
-
|
|
376
|
-
- (void)enumerateKeysAndMetadataInGroup:(NSString *)group
|
|
377
|
-
withOptions:(NSEnumerationOptions)options
|
|
378
|
-
range:(NSRange)range
|
|
379
|
-
usingBlock:
|
|
380
|
-
(void (^)(NSString *collection, NSString *key, id metadata, NSUInteger index, BOOL *stop))block;
|
|
381
|
-
|
|
382
|
-
/**
|
|
383
|
-
* The following methods are equivalent to invoking the enumerateKeysInGroup:... methods,
|
|
384
|
-
* and then fetching the object within your own block.
|
|
385
|
-
**/
|
|
386
|
-
|
|
387
|
-
- (void)enumerateKeysAndObjectsInGroup:(NSString *)group
|
|
388
|
-
usingBlock:
|
|
389
|
-
(void (^)(NSString *collection, NSString *key, id object, NSUInteger index, BOOL *stop))block;
|
|
390
|
-
|
|
391
|
-
- (void)enumerateKeysAndObjectsInGroup:(NSString *)group
|
|
392
|
-
withOptions:(NSEnumerationOptions)options
|
|
393
|
-
usingBlock:
|
|
394
|
-
(void (^)(NSString *collection, NSString *key, id object, NSUInteger index, BOOL *stop))block;
|
|
395
|
-
|
|
396
|
-
- (void)enumerateKeysAndObjectsInGroup:(NSString *)group
|
|
397
|
-
withOptions:(NSEnumerationOptions)options
|
|
398
|
-
range:(NSRange)range
|
|
399
|
-
usingBlock:
|
|
400
|
-
(void (^)(NSString *collection, NSString *key, id object, NSUInteger index, BOOL *stop))block;
|
|
401
|
-
|
|
402
|
-
/**
|
|
403
|
-
* The following methods are equivalent to invoking the enumerateKeysInGroup:... methods,
|
|
404
|
-
* and then fetching the object and metadata within your own block.
|
|
405
|
-
**/
|
|
406
|
-
|
|
407
|
-
- (void)enumerateRowsInGroup:(NSString *)group
|
|
408
|
-
usingBlock:
|
|
409
|
-
(void (^)(NSString *collection, NSString *key, id object, id metadata, NSUInteger index, BOOL *stop))block;
|
|
410
|
-
|
|
411
|
-
- (void)enumerateRowsInGroup:(NSString *)group
|
|
412
|
-
withOptions:(NSEnumerationOptions)options
|
|
413
|
-
usingBlock:
|
|
414
|
-
(void (^)(NSString *collection, NSString *key, id object, id metadata, NSUInteger index, BOOL *stop))block;
|
|
415
|
-
|
|
416
|
-
- (void)enumerateRowsInGroup:(NSString *)group
|
|
417
|
-
withOptions:(NSEnumerationOptions)options
|
|
418
|
-
range:(NSRange)range
|
|
419
|
-
usingBlock:
|
|
420
|
-
(void (^)(NSString *collection, NSString *key, id object, id metadata, NSUInteger index, BOOL *stop))block;
|
|
421
|
-
|
|
422
|
-
@end
|
|
423
|
-
|
|
424
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
425
|
-
#pragma mark -
|
|
426
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
427
|
-
|
|
428
|
-
@interface YapDatabaseViewTransaction (Mappings)
|
|
429
|
-
|
|
430
|
-
/**
|
|
431
|
-
* Gets the key & collection at the given indexPath, assuming the given mappings are being used.
|
|
432
|
-
* Returns NO if the indexPath is invalid, or the mappings aren't initialized.
|
|
433
|
-
* Otherwise returns YES, and sets the key & collection ptr (both optional).
|
|
434
|
-
**/
|
|
435
|
-
- (BOOL)getKey:(NSString **)keyPtr
|
|
436
|
-
collection:(NSString **)collectionPtr
|
|
437
|
-
atIndexPath:(NSIndexPath *)indexPath
|
|
438
|
-
withMappings:(YapDatabaseViewMappings *)mappings;
|
|
439
|
-
|
|
440
|
-
/**
|
|
441
|
-
* Gets the key & collection at the given row & section, assuming the given mappings are being used.
|
|
442
|
-
* Returns NO if the row or section is invalid, or the mappings aren't initialized.
|
|
443
|
-
* Otherwise returns YES, and sets the key & collection ptr (both optional).
|
|
444
|
-
**/
|
|
445
|
-
- (BOOL)getKey:(NSString **)keyPtr
|
|
446
|
-
collection:(NSString **)collectionPtr
|
|
447
|
-
forRow:(NSUInteger)row
|
|
448
|
-
inSection:(NSUInteger)section
|
|
449
|
-
withMappings:(YapDatabaseViewMappings *)mappings;
|
|
450
|
-
|
|
451
|
-
/**
|
|
452
|
-
* Gets the object at the given indexPath, assuming the given mappings are being used.
|
|
453
|
-
*
|
|
454
|
-
* Equivalent to invoking:
|
|
455
|
-
*
|
|
456
|
-
* NSString *collection, *key;
|
|
457
|
-
* if ([[transaction ext:@"myView"] getKey:&key collection:&collection atIndexPath:indexPath withMappings:mappings]) {
|
|
458
|
-
* object = [transaction objectForKey:key inCollection:collection];
|
|
459
|
-
* }
|
|
460
|
-
**/
|
|
461
|
-
- (id)objectAtIndexPath:(NSIndexPath *)indexPath withMappings:(YapDatabaseViewMappings *)mappings;
|
|
462
|
-
|
|
463
|
-
/**
|
|
464
|
-
* Gets the object at the given indexPath, assuming the given mappings are being used.
|
|
465
|
-
*
|
|
466
|
-
* Equivalent to invoking:
|
|
467
|
-
*
|
|
468
|
-
* NSString *collection, *key;
|
|
469
|
-
* if ([[transaction ext:@"view"] getKey:&key
|
|
470
|
-
* collection:&collection
|
|
471
|
-
* forRow:row
|
|
472
|
-
* inSection:section
|
|
473
|
-
* withMappings:mappings]) {
|
|
474
|
-
* object = [transaction objectForKey:key inCollection:collection];
|
|
475
|
-
* }
|
|
476
|
-
**/
|
|
477
|
-
- (id)objectAtRow:(NSUInteger)row inSection:(NSUInteger)section withMappings:(YapDatabaseViewMappings *)mappings;
|
|
478
|
-
|
|
479
|
-
/**
|
|
480
|
-
* Fetches the indexPath for the given {collection, key} tuple, assuming the given mappings are being used.
|
|
481
|
-
* Returns nil if the {collection, key} tuple isn't included in the view + mappings.
|
|
482
|
-
**/
|
|
483
|
-
- (NSIndexPath *)indexPathForKey:(NSString *)key
|
|
484
|
-
inCollection:(NSString *)collection
|
|
485
|
-
withMappings:(YapDatabaseViewMappings *)mappings;
|
|
486
|
-
|
|
487
|
-
/**
|
|
488
|
-
* Fetches the row & section for the given {collection, key} tuple, assuming the given mappings are being used.
|
|
489
|
-
* Returns NO if the {collection, key} tuple isn't included in the view + mappings.
|
|
490
|
-
* Otherwise returns YES, and sets the row & section (both optional).
|
|
491
|
-
**/
|
|
492
|
-
- (BOOL)getRow:(NSUInteger *)rowPtr
|
|
493
|
-
section:(NSUInteger *)sectionPtr
|
|
494
|
-
forKey:(NSString *)key
|
|
495
|
-
inCollection:(NSString *)collection
|
|
496
|
-
withMappings:(YapDatabaseViewMappings *)mappings;
|
|
497
|
-
|
|
498
|
-
@end
|