motion-yapper 0.0.1 → 0.0.2
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 +2 -2
- data/.travis.yml +2 -0
- data/Gemfile +1 -0
- data/README.md +1 -1
- data/Rakefile +1 -1
- data/lib/motion-yapper.rb +1 -0
- data/lib/yapper.rb +3 -5
- data/lib/yapper/config.rb +2 -0
- data/lib/yapper/db.rb +105 -40
- data/lib/yapper/document.rb +7 -4
- data/lib/yapper/document/callbacks.rb +0 -7
- data/lib/yapper/document/{persistance.rb → persistence.rb} +27 -21
- data/lib/yapper/document/relation.rb +29 -22
- data/lib/yapper/document/selection.rb +122 -54
- data/lib/yapper/extensions.rb +12 -24
- data/lib/yapper/settings.rb +43 -0
- data/lib/yapper/timestamps.rb +2 -0
- data/lib/yapper/version.rb +1 -1
- data/{yapper.gemspec → motion-yapper.gemspec} +0 -0
- data/spec/integration/{where_spec.rb → criteria_spec.rb} +78 -10
- data/spec/integration/db_spec.rb +70 -0
- data/spec/integration/defaults_spec.rb +37 -0
- data/spec/integration/extensions_spec.rb +14 -0
- data/spec/integration/{persistance_spec.rb → persistence_spec.rb} +0 -0
- data/spec/integration/relation_spec.rb +4 -4
- data/vendor/Podfile.lock +9 -11
- 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 +4 -4
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDAbstractDatabaseLogger.h +14 -14
- data/vendor/Pods/{CocoaLumberjack/Lumberjack/Extensions/ContextFilterLogFormatter.h → BuildHeaders/CocoaLumberjack/DDContextFilterLogFormatter.h} +6 -8
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/{DispatchQueueLogFormatter.h → DDDispatchQueueLogFormatter.h} +18 -6
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDFileLogger.h +67 -32
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDLog+LOGV.h +99 -0
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDLog.h +98 -65
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDMultiFormatter.h +30 -0
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDTTYLogger.h +39 -25
- data/vendor/Pods/BuildHeaders/YapDatabase/NSDictionary+YapDatabase.h +8 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapCache.h +1 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapCollectionKey.h +3 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabase.h +4 -4
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseConnection.h +21 -19
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseDefaults.h +1 -1
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseExtensionPrivate.h +35 -31
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredView.h +8 -35
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewPrivate.h +0 -2
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewTransaction.h +17 -17
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewTypes.h +32 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearchPrivate.h +8 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabasePrivate.h +43 -21
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationship.h +35 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipConnection.h +29 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipEdge.h +163 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipEdgePrivate.h +79 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipNode.h +99 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipOptions.h +59 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipPrivate.h +125 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipTransaction.h +384 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndex.h +49 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexPrivate.h +10 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexSetupPrivate.h +18 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseTransaction.h +131 -21
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseView.h +48 -107
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewChange.h +2 -2
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewConnection.h +1 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewMappings.h +17 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewOptions.h +10 -3
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewPrivate.h +18 -1
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewTransaction.h +75 -24
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewTypes.h +99 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDASLLogger.h +4 -4
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDASLLogger.m +51 -50
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDAbstractDatabaseLogger.h +14 -14
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDAbstractDatabaseLogger.m +546 -546
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDFileLogger.h +67 -32
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDFileLogger.m +1093 -907
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog+LOGV.h +99 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog.h +98 -65
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog.m +873 -748
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDTTYLogger.h +39 -25
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDTTYLogger.m +1284 -1243
- data/vendor/Pods/{BuildHeaders/CocoaLumberjack/ContextFilterLogFormatter.h → CocoaLumberjack/Lumberjack/Extensions/DDContextFilterLogFormatter.h} +6 -8
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/{ContextFilterLogFormatter.m → DDContextFilterLogFormatter.m} +70 -70
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/{DispatchQueueLogFormatter.h → DDDispatchQueueLogFormatter.h} +18 -6
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DDDispatchQueueLogFormatter.m +253 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DDMultiFormatter.h +30 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DDMultiFormatter.m +127 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/README.txt +1 -1
- data/vendor/Pods/CocoaLumberjack/README.markdown +52 -15
- data/vendor/Pods/Headers/CocoaLumberjack/DDASLLogger.h +4 -4
- data/vendor/Pods/Headers/CocoaLumberjack/DDAbstractDatabaseLogger.h +14 -14
- data/vendor/Pods/Headers/CocoaLumberjack/{ContextFilterLogFormatter.h → DDContextFilterLogFormatter.h} +6 -8
- data/vendor/Pods/Headers/CocoaLumberjack/{DispatchQueueLogFormatter.h → DDDispatchQueueLogFormatter.h} +18 -6
- data/vendor/Pods/Headers/CocoaLumberjack/DDFileLogger.h +67 -32
- data/vendor/Pods/Headers/CocoaLumberjack/DDLog+LOGV.h +99 -0
- data/vendor/Pods/Headers/CocoaLumberjack/DDLog.h +98 -65
- data/vendor/Pods/Headers/CocoaLumberjack/DDMultiFormatter.h +30 -0
- data/vendor/Pods/Headers/CocoaLumberjack/DDTTYLogger.h +39 -25
- data/vendor/Pods/Headers/YapDatabase/YapCollectionKey.h +3 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabase.h +4 -4
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseConnection.h +21 -19
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredView.h +8 -35
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewTransaction.h +17 -17
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewTypes.h +32 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationship.h +35 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipConnection.h +29 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipEdge.h +163 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipNode.h +99 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipOptions.h +59 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipTransaction.h +384 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndex.h +49 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseTransaction.h +131 -21
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseView.h +48 -107
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewChange.h +2 -2
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewConnection.h +1 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewMappings.h +17 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewOptions.h +10 -3
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewTransaction.h +75 -24
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewTypes.h +99 -0
- data/vendor/Pods/Headers/____Pods-CocoaLumberjack-prefix.h +2 -0
- data/vendor/Pods/Headers/____Pods-environment.h +15 -15
- data/vendor/Pods/Manifest.lock +9 -11
- data/vendor/Pods/Pods-CocoaLumberjack-Private.xcconfig +1 -1
- data/vendor/Pods/Pods-CocoaLumberjack-prefix.pch +2 -0
- data/vendor/Pods/Pods-NSData+MD5Digest-Private.xcconfig +1 -1
- data/vendor/Pods/Pods-YapDatabase-Private.xcconfig +1 -1
- data/vendor/Pods/{Pods-Acknowledgements.markdown → Pods-acknowledgements.markdown} +0 -37
- data/vendor/Pods/{Pods-Acknowledgements.plist → Pods-acknowledgements.plist} +0 -45
- data/vendor/Pods/Pods-environment.h +15 -15
- data/vendor/Pods/Pods.xcconfig +3 -3
- data/vendor/Pods/Pods.xcodeproj/project.pbxproj +2426 -3155
- data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/Pods-CocoaLumberjack.xcscheme +59 -0
- data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/Pods-NSData+MD5Digest.xcscheme +59 -0
- data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/Pods-YapDatabase.xcscheme +59 -0
- data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/Pods.xcscheme +59 -0
- data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/xcschememanagement.plist +31 -0
- data/vendor/Pods/YapDatabase/README.md +3 -1
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/Internal/YapDatabaseFilteredViewPrivate.h +0 -2
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredView.h +8 -35
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredView.m +25 -41
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewTransaction.h +17 -17
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewTransaction.m +403 -134
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewTypes.h +32 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/Internal/YapDatabaseFullTextSearchPrivate.h +8 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchConnection.m +8 -8
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchTransaction.m +113 -62
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/Internal/YapDatabaseExtensionPrivate.h +35 -31
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtension.m +25 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionConnection.m +1 -1
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionTransaction.m +25 -1
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/Internal/YapDatabaseRelationshipEdgePrivate.h +79 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/Internal/YapDatabaseRelationshipPrivate.h +125 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationship.h +35 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationship.m +129 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipConnection.h +29 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipConnection.m +802 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipEdge.h +163 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipEdge.m +408 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipNode.h +99 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipOptions.h +59 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipOptions.m +29 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipTransaction.h +384 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipTransaction.m +5254 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/Internal/YapDatabaseSecondaryIndexPrivate.h +10 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/Internal/YapDatabaseSecondaryIndexSetupPrivate.h +18 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndex.h +49 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndex.m +12 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexConnection.m +9 -8
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexSetup.m +62 -1
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexTransaction.m +148 -45
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPrivate.h +18 -1
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewChange.h +2 -2
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewChange.m +15 -9
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewMappings.h +17 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewMappings.m +211 -64
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseView.h +48 -107
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseView.m +10 -7
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewConnection.h +1 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewConnection.m +13 -22
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewOptions.h +10 -3
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTransaction.h +75 -24
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTransaction.m +725 -244
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTypes.h +99 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/NSDictionary+YapDatabase.h +8 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/NSDictionary+YapDatabase.m +19 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapCache.h +1 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapCache.m +12 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseDefaults.h +1 -1
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseDefaults.m +3 -3
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabasePrivate.h +43 -21
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapNull.m +4 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapCollectionKey.h +3 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapCollectionKey.m +5 -0
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabase.h +4 -4
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabase.m +84 -93
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseConnection.h +21 -19
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseConnection.m +381 -209
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseTransaction.h +131 -21
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseTransaction.m +587 -267
- data/vendor/Pods/{Pods.bridgesupport → build-iPhoneSimulator/Pods.bridgesupport} +633 -2557
- data/vendor/Pods/build-iPhoneSimulator/libPods.a +0 -0
- data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.bridgesupport +2 -1
- data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.h +2 -1
- data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.m +4 -2
- metadata +80 -108
- data/Gemfile.lock +0 -63
- data/lib/yapper/attachment.rb +0 -48
- data/lib/yapper/document/attachment.rb +0 -26
- data/lib/yapper/sync.rb +0 -134
- data/lib/yapper/sync/data.rb +0 -12
- data/lib/yapper/sync/event.rb +0 -194
- data/lib/yapper/sync/queue.rb +0 -164
- data/spec/integration/all_spec.rb +0 -40
- data/spec/integration/sync_spec.rb +0 -42
- data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPClient.h +0 -641
- data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPClient.m +0 -1396
- data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.h +0 -133
- data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.m +0 -327
- data/vendor/Pods/AFNetworking/AFNetworking/AFImageRequestOperation.h +0 -113
- data/vendor/Pods/AFNetworking/AFNetworking/AFImageRequestOperation.m +0 -321
- data/vendor/Pods/AFNetworking/AFNetworking/AFJSONRequestOperation.h +0 -71
- data/vendor/Pods/AFNetworking/AFNetworking/AFJSONRequestOperation.m +0 -150
- data/vendor/Pods/AFNetworking/AFNetworking/AFNetworkActivityIndicatorManager.h +0 -75
- data/vendor/Pods/AFNetworking/AFNetworking/AFNetworkActivityIndicatorManager.m +0 -157
- data/vendor/Pods/AFNetworking/AFNetworking/AFNetworking.h +0 -43
- data/vendor/Pods/AFNetworking/AFNetworking/AFPropertyListRequestOperation.h +0 -68
- data/vendor/Pods/AFNetworking/AFNetworking/AFPropertyListRequestOperation.m +0 -143
- data/vendor/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.h +0 -370
- data/vendor/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.m +0 -848
- data/vendor/Pods/AFNetworking/AFNetworking/AFXMLRequestOperation.h +0 -89
- data/vendor/Pods/AFNetworking/AFNetworking/AFXMLRequestOperation.m +0 -167
- data/vendor/Pods/AFNetworking/AFNetworking/UIImageView+AFNetworking.h +0 -78
- data/vendor/Pods/AFNetworking/AFNetworking/UIImageView+AFNetworking.m +0 -191
- data/vendor/Pods/AFNetworking/LICENSE +0 -19
- data/vendor/Pods/AFNetworking/README.md +0 -208
- data/vendor/Pods/BuildHeaders/AFNetworking/AFHTTPClient.h +0 -641
- data/vendor/Pods/BuildHeaders/AFNetworking/AFHTTPRequestOperation.h +0 -133
- data/vendor/Pods/BuildHeaders/AFNetworking/AFImageRequestOperation.h +0 -113
- data/vendor/Pods/BuildHeaders/AFNetworking/AFJSONRequestOperation.h +0 -71
- data/vendor/Pods/BuildHeaders/AFNetworking/AFNetworkActivityIndicatorManager.h +0 -75
- data/vendor/Pods/BuildHeaders/AFNetworking/AFNetworking.h +0 -43
- data/vendor/Pods/BuildHeaders/AFNetworking/AFPropertyListRequestOperation.h +0 -68
- data/vendor/Pods/BuildHeaders/AFNetworking/AFURLConnectionOperation.h +0 -370
- data/vendor/Pods/BuildHeaders/AFNetworking/AFXMLRequestOperation.h +0 -89
- data/vendor/Pods/BuildHeaders/AFNetworking/UIImageView+AFNetworking.h +0 -78
- data/vendor/Pods/BuildHeaders/Reachability/Reachability.h +0 -109
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DispatchQueueLogFormatter.m +0 -251
- data/vendor/Pods/Headers/AFNetworking/AFHTTPClient.h +0 -641
- data/vendor/Pods/Headers/AFNetworking/AFHTTPRequestOperation.h +0 -133
- data/vendor/Pods/Headers/AFNetworking/AFImageRequestOperation.h +0 -113
- data/vendor/Pods/Headers/AFNetworking/AFJSONRequestOperation.h +0 -71
- data/vendor/Pods/Headers/AFNetworking/AFNetworkActivityIndicatorManager.h +0 -75
- data/vendor/Pods/Headers/AFNetworking/AFNetworking.h +0 -43
- data/vendor/Pods/Headers/AFNetworking/AFPropertyListRequestOperation.h +0 -68
- data/vendor/Pods/Headers/AFNetworking/AFURLConnectionOperation.h +0 -370
- data/vendor/Pods/Headers/AFNetworking/AFXMLRequestOperation.h +0 -89
- data/vendor/Pods/Headers/AFNetworking/UIImageView+AFNetworking.h +0 -78
- data/vendor/Pods/Headers/Reachability/Reachability.h +0 -109
- data/vendor/Pods/Headers/YapDatabase/YapCache.h +0 -90
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseConnectionState.h +0 -29
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseDefaults.h +0 -37
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseExtensionPrivate.h +0 -440
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewPrivate.h +0 -19
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearchPrivate.h +0 -69
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseLogging.h +0 -158
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseManager.h +0 -17
- data/vendor/Pods/Headers/YapDatabase/YapDatabasePrivate.h +0 -424
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndexPrivate.h +0 -73
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseStatement.h +0 -13
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseString.h +0 -121
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewChangePrivate.h +0 -94
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewMappingsPrivate.h +0 -72
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewPage.h +0 -36
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewPageMetadata.h +0 -27
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewPrivate.h +0 -153
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewRangeOptionsPrivate.h +0 -17
- data/vendor/Pods/Headers/YapDatabase/YapMemoryTable.h +0 -74
- data/vendor/Pods/Headers/YapDatabase/YapNull.h +0 -17
- data/vendor/Pods/Headers/YapDatabase/YapTouch.h +0 -15
- data/vendor/Pods/Headers/____Pods-AFNetworking-prefix.h +0 -17
- data/vendor/Pods/Headers/____Pods-Reachability-prefix.h +0 -5
- data/vendor/Pods/Pods-AFNetworking-Private.xcconfig +0 -5
- data/vendor/Pods/Pods-AFNetworking-dummy.m +0 -5
- data/vendor/Pods/Pods-AFNetworking-prefix.pch +0 -17
- data/vendor/Pods/Pods-AFNetworking.xcconfig +0 -1
- data/vendor/Pods/Pods-Reachability-Private.xcconfig +0 -5
- data/vendor/Pods/Pods-Reachability-dummy.m +0 -5
- data/vendor/Pods/Pods-Reachability-prefix.pch +0 -5
- data/vendor/Pods/Pods-Reachability.xcconfig +0 -1
- data/vendor/Pods/Reachability/LICENCE.txt +0 -24
- data/vendor/Pods/Reachability/README.md +0 -65
- data/vendor/Pods/Reachability/Reachability.h +0 -109
- data/vendor/Pods/Reachability/Reachability.m +0 -527
|
@@ -23,6 +23,9 @@
|
|
|
23
23
|
**/
|
|
24
24
|
#define YAP_DATABASE_VIEW_CLASS_VERSION 3
|
|
25
25
|
|
|
26
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
27
|
+
#pragma mark -
|
|
28
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
26
29
|
|
|
27
30
|
@interface YapDatabaseView () {
|
|
28
31
|
@public
|
|
@@ -32,7 +35,7 @@
|
|
|
32
35
|
YapDatabaseViewBlockType groupingBlockType;
|
|
33
36
|
YapDatabaseViewBlockType sortingBlockType;
|
|
34
37
|
|
|
35
|
-
|
|
38
|
+
NSString *versionTag;
|
|
36
39
|
|
|
37
40
|
YapDatabaseViewOptions *options;
|
|
38
41
|
}
|
|
@@ -103,6 +106,8 @@
|
|
|
103
106
|
YapMemoryTableTransaction *pageTableTransaction;
|
|
104
107
|
YapMemoryTableTransaction *pageMetadataTableTransaction;
|
|
105
108
|
|
|
109
|
+
BOOL isRepopulate;
|
|
110
|
+
|
|
106
111
|
@protected
|
|
107
112
|
|
|
108
113
|
__unsafe_unretained YapDatabaseViewConnection *viewConnection;
|
|
@@ -116,6 +121,7 @@
|
|
|
116
121
|
|
|
117
122
|
// The following are declared for view subclasses (such as YapDatabaseFilteredView)
|
|
118
123
|
|
|
124
|
+
- (void)dropTablesForOldClassVersion:(int)oldClassVersion;
|
|
119
125
|
- (BOOL)createTables;
|
|
120
126
|
|
|
121
127
|
- (NSString *)registeredName;
|
|
@@ -151,3 +157,14 @@
|
|
|
151
157
|
usingBlock:(void (^)(int64_t rowid, NSUInteger index, BOOL *stop))block;
|
|
152
158
|
|
|
153
159
|
@end
|
|
160
|
+
|
|
161
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
162
|
+
#pragma mark -
|
|
163
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
164
|
+
|
|
165
|
+
@protocol YapDatabaseViewDependency <NSObject>
|
|
166
|
+
@optional
|
|
167
|
+
|
|
168
|
+
- (void)viewDidRepopulate:(NSString *)registeredName;
|
|
169
|
+
|
|
170
|
+
@end
|
|
@@ -86,8 +86,8 @@ typedef enum {
|
|
|
86
86
|
*
|
|
87
87
|
* YapDatabaseViewChangedMetadata means the metadata was changed.
|
|
88
88
|
* This might have happend implicitly if the user invoked setObject:forKey:inCollection: (implicitly setting
|
|
89
|
-
* the
|
|
90
|
-
*
|
|
89
|
+
* the metadata to nil). Or explicitly if the user invoked setObject:forKey:inCollection:withMetadata: or
|
|
90
|
+
* replaceMetadata:forKey:inCollection:.
|
|
91
91
|
*
|
|
92
92
|
* YapDatabaseViewChangedDependency means the row was flagged due to a cell drawing dependency configuration.
|
|
93
93
|
* See YapDatabaseViewMappings: setCellDrawingDependencyForNeighboringCellWithOffset:forGroup:
|
|
@@ -369,8 +369,9 @@
|
|
|
369
369
|
NSMutableArray *sectionChanges = [NSMutableArray arrayWithCapacity:1];
|
|
370
370
|
NSMutableArray *rowChanges = [NSMutableArray arrayWithCapacity:[changes count]];
|
|
371
371
|
|
|
372
|
-
NSSet *
|
|
373
|
-
|
|
372
|
+
NSSet *originalGroups = [NSSet setWithArray:[originalMappings allGroups]];
|
|
373
|
+
NSSet *finalGroups = [NSSet setWithArray:[finalMappings allGroups]];
|
|
374
|
+
|
|
374
375
|
NSMutableDictionary *counts = [originalMappings counts];
|
|
375
376
|
NSDictionary *dependencies = [originalMappings dependencies];
|
|
376
377
|
|
|
@@ -383,7 +384,7 @@
|
|
|
383
384
|
|
|
384
385
|
if (immutableSectionChange->type == YapDatabaseViewChangeDelete)
|
|
385
386
|
{
|
|
386
|
-
if ([
|
|
387
|
+
if ([originalGroups containsObject:immutableSectionChange->group])
|
|
387
388
|
{
|
|
388
389
|
YapDatabaseViewSectionChange *sectionChange = [immutableSectionChange copy];
|
|
389
390
|
[sectionChanges addObject:sectionChange];
|
|
@@ -449,7 +450,7 @@
|
|
|
449
450
|
}
|
|
450
451
|
else if (immutableSectionChange->type == YapDatabaseViewChangeInsert)
|
|
451
452
|
{
|
|
452
|
-
if ([
|
|
453
|
+
if ([finalGroups containsObject:immutableSectionChange->group])
|
|
453
454
|
{
|
|
454
455
|
YapDatabaseViewSectionChange *sectionChange = [immutableSectionChange copy];
|
|
455
456
|
[sectionChanges addObject:sectionChange];
|
|
@@ -464,10 +465,10 @@
|
|
|
464
465
|
NSUInteger groupCount = 0;
|
|
465
466
|
NSUInteger groupIndex = 0;
|
|
466
467
|
BOOL wasDelete = 0;
|
|
467
|
-
|
|
468
|
+
|
|
468
469
|
if (immutableRowChange->type == YapDatabaseViewChangeDelete)
|
|
469
470
|
{
|
|
470
|
-
if ([
|
|
471
|
+
if ([originalGroups containsObject:immutableRowChange->originalGroup])
|
|
471
472
|
{
|
|
472
473
|
YapDatabaseViewRowChange *rowChange = [immutableRowChange copy];
|
|
473
474
|
[rowChanges addObject:rowChange];
|
|
@@ -484,7 +485,7 @@
|
|
|
484
485
|
}
|
|
485
486
|
else if (immutableRowChange->type == YapDatabaseViewChangeInsert)
|
|
486
487
|
{
|
|
487
|
-
if ([
|
|
488
|
+
if ([finalGroups containsObject:immutableRowChange->finalGroup])
|
|
488
489
|
{
|
|
489
490
|
YapDatabaseViewRowChange *rowChange = [immutableRowChange copy];
|
|
490
491
|
[rowChanges addObject:rowChange];
|
|
@@ -499,7 +500,7 @@
|
|
|
499
500
|
}
|
|
500
501
|
else if (immutableRowChange->type == YapDatabaseViewChangeUpdate)
|
|
501
502
|
{
|
|
502
|
-
if ([
|
|
503
|
+
if ([finalGroups containsObject:immutableRowChange->originalGroup])
|
|
503
504
|
{
|
|
504
505
|
YapDatabaseViewRowChange *rowChange = [immutableRowChange copy];
|
|
505
506
|
[rowChanges addObject:rowChange];
|
|
@@ -813,6 +814,7 @@
|
|
|
813
814
|
firstChangeForKey->type = YapDatabaseViewChangeMove;
|
|
814
815
|
firstChangeForKey->finalIndex = lastChangeForKey->finalIndex;
|
|
815
816
|
firstChangeForKey->finalGroup = lastChangeForKey->finalGroup;
|
|
817
|
+
firstChangeForKey->opFinalIndex = lastChangeForKey->opFinalIndex; // for postProcessing
|
|
816
818
|
|
|
817
819
|
[changes removeObjectsAtIndexes:indexSet];
|
|
818
820
|
i++;
|
|
@@ -833,6 +835,7 @@
|
|
|
833
835
|
firstChangeForKey->type = YapDatabaseViewChangeMove;
|
|
834
836
|
firstChangeForKey->finalIndex = lastChangeForKey->finalIndex;
|
|
835
837
|
firstChangeForKey->finalGroup = lastChangeForKey->finalGroup;
|
|
838
|
+
firstChangeForKey->opFinalIndex = lastChangeForKey->opFinalIndex; // for postProcessing
|
|
836
839
|
|
|
837
840
|
[changes removeObjectsAtIndexes:indexSet];
|
|
838
841
|
i++;
|
|
@@ -848,7 +851,6 @@
|
|
|
848
851
|
|
|
849
852
|
[changes removeObjectsAtIndexes:indexSet];
|
|
850
853
|
[changes removeObjectAtIndex:i];
|
|
851
|
-
|
|
852
854
|
}
|
|
853
855
|
else if (lastChangeForKey->type == YapDatabaseViewChangeInsert)
|
|
854
856
|
{
|
|
@@ -901,10 +903,13 @@
|
|
|
901
903
|
// then the tableView/collectionView will offset the update's index
|
|
902
904
|
// based on insertions & deletions at smaller indexes,
|
|
903
905
|
// and may ultimately update the wrong cell.
|
|
906
|
+
//
|
|
907
|
+
// The final location comes from the last update
|
|
904
908
|
|
|
905
909
|
firstChangeForKey->type = YapDatabaseViewChangeMove;
|
|
906
910
|
firstChangeForKey->finalIndex = lastChangeForKey->finalIndex;
|
|
907
911
|
firstChangeForKey->finalGroup = lastChangeForKey->finalGroup;
|
|
912
|
+
firstChangeForKey->opFinalIndex = lastChangeForKey->opFinalIndex; // for postProcessing
|
|
908
913
|
|
|
909
914
|
[changes removeObjectsAtIndexes:indexSet];
|
|
910
915
|
i++;
|
|
@@ -947,6 +952,7 @@
|
|
|
947
952
|
firstChangeForKey->type = YapDatabaseViewChangeMove;
|
|
948
953
|
firstChangeForKey->finalIndex = lastChangeForKey->finalIndex;
|
|
949
954
|
firstChangeForKey->finalGroup = lastChangeForKey->finalGroup;
|
|
955
|
+
firstChangeForKey->opFinalIndex = lastChangeForKey->opFinalIndex; // for postProcessing
|
|
950
956
|
|
|
951
957
|
[changes removeObjectsAtIndexes:indexSet];
|
|
952
958
|
i++;
|
data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewMappings.h
CHANGED
|
@@ -173,6 +173,8 @@ struct YapDatabaseViewRangePosition {
|
|
|
173
173
|
};
|
|
174
174
|
typedef struct YapDatabaseViewRangePosition YapDatabaseViewRangePosition;
|
|
175
175
|
|
|
176
|
+
typedef BOOL (^YapDatabaseViewMappingGroupFilter)(NSString *group, YapDatabaseReadTransaction *transaction);
|
|
177
|
+
typedef NSComparisonResult (^YapDatabaseViewMappingGroupSort)(NSString *group1, NSString *group2, YapDatabaseReadTransaction *transaction);
|
|
176
178
|
|
|
177
179
|
@interface YapDatabaseViewMappings : NSObject <NSCopying>
|
|
178
180
|
|
|
@@ -203,6 +205,21 @@ typedef struct YapDatabaseViewRangePosition YapDatabaseViewRangePosition;
|
|
|
203
205
|
- (id)initWithGroups:(NSArray *)allGroups
|
|
204
206
|
view:(NSString *)registeredViewName;
|
|
205
207
|
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Initializes a new mappings object that uses a filterBlock and a sortBlock to dynamically construct sections from view.
|
|
211
|
+
* @param filterBlock
|
|
212
|
+
* Block that takes a string and returns a BOOL. returning YES will include the group in the sections of the mapping.
|
|
213
|
+
* @param sortBlock
|
|
214
|
+
* Block used to sort group names for groups that pass the filter.
|
|
215
|
+
* @param registeredViewName
|
|
216
|
+
* This is the name of the view, as you registered it with the database system.
|
|
217
|
+
*
|
|
218
|
+
**/
|
|
219
|
+
- (id)initWithGroupFilterBlock:(YapDatabaseViewMappingGroupFilter)filterBlock
|
|
220
|
+
sortBlock:(YapDatabaseViewMappingGroupSort)sortBlock
|
|
221
|
+
view:(NSString *)registeredViewName;
|
|
222
|
+
|
|
206
223
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
207
224
|
#pragma mark Accessors
|
|
208
225
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewMappings.m
CHANGED
|
@@ -24,15 +24,21 @@
|
|
|
24
24
|
@implementation YapDatabaseViewMappings
|
|
25
25
|
{
|
|
26
26
|
// Immutable init parameters
|
|
27
|
-
NSArray *allGroups;
|
|
28
27
|
NSString *registeredViewName;
|
|
29
|
-
|
|
28
|
+
|
|
29
|
+
NSArray *allGroups;
|
|
30
|
+
|
|
31
|
+
BOOL viewGroupsAreDynamic;
|
|
32
|
+
YapDatabaseViewMappingGroupFilter groupFilterBlock;
|
|
33
|
+
YapDatabaseViewMappingGroupSort groupSort;
|
|
34
|
+
|
|
30
35
|
// Mappings and cached counts
|
|
31
36
|
NSMutableArray *visibleGroups;
|
|
32
37
|
NSMutableDictionary *counts;
|
|
33
38
|
BOOL isUsingConsolidatedGroup;
|
|
34
39
|
BOOL autoConsolidationDisabled;
|
|
35
|
-
|
|
40
|
+
BOOL isDynamicSectionForAllGroups;
|
|
41
|
+
|
|
36
42
|
// Configuration
|
|
37
43
|
NSMutableSet *dynamicSections;
|
|
38
44
|
NSMutableSet *reverse;
|
|
@@ -60,38 +66,64 @@
|
|
|
60
66
|
{
|
|
61
67
|
if ((self = [super init]))
|
|
62
68
|
{
|
|
63
|
-
|
|
64
|
-
registeredViewName = [inRegisteredViewName copy];
|
|
65
|
-
|
|
69
|
+
allGroups = [[NSArray alloc] initWithArray:inGroups copyItems:YES];
|
|
66
70
|
NSUInteger allGroupsCount = [allGroups count];
|
|
71
|
+
viewGroupsAreDynamic = NO;
|
|
67
72
|
|
|
68
73
|
visibleGroups = [[NSMutableArray alloc] initWithCapacity:allGroupsCount];
|
|
69
|
-
|
|
70
74
|
dynamicSections = [[NSMutableSet alloc] initWithCapacity:allGroupsCount];
|
|
71
75
|
reverse = [[NSMutableSet alloc] initWithCapacity:allGroupsCount];
|
|
72
76
|
|
|
73
77
|
id sharedKeySet = [NSDictionary sharedKeySetForKeys:allGroups];
|
|
74
|
-
|
|
75
78
|
counts = [NSMutableDictionary dictionaryWithSharedKeySet:sharedKeySet];
|
|
76
|
-
rangeOptions = [NSMutableDictionary
|
|
77
|
-
dependencies = [NSMutableDictionary
|
|
79
|
+
rangeOptions = [NSMutableDictionary dictionaryWithCapacity:allGroupsCount];
|
|
80
|
+
dependencies = [NSMutableDictionary dictionaryWithCapacity:allGroupsCount];
|
|
78
81
|
|
|
79
|
-
|
|
82
|
+
[self _initWithView:inRegisteredViewName];
|
|
83
|
+
|
|
80
84
|
}
|
|
81
85
|
return self;
|
|
82
86
|
}
|
|
83
87
|
|
|
88
|
+
- (id)initWithGroupFilterBlock:(YapDatabaseViewMappingGroupFilter)inFilter sortBlock:(YapDatabaseViewMappingGroupSort)inSort view:(NSString *)inRegisteredViewName{
|
|
89
|
+
if (self = [super init]){
|
|
90
|
+
groupFilterBlock = inFilter;
|
|
91
|
+
groupSort = inSort;
|
|
92
|
+
viewGroupsAreDynamic = YES;
|
|
93
|
+
|
|
94
|
+
//we don't know what our capacity is going to be yet.
|
|
95
|
+
visibleGroups = [NSMutableArray new];
|
|
96
|
+
dynamicSections = [NSMutableSet new];
|
|
97
|
+
reverse = [NSMutableSet new];
|
|
98
|
+
rangeOptions = [NSMutableDictionary new];
|
|
99
|
+
dependencies = [NSMutableDictionary new];
|
|
100
|
+
|
|
101
|
+
[self _initWithView:inRegisteredViewName];
|
|
102
|
+
}
|
|
103
|
+
return self;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
- (void)_initWithView:(NSString *)inRegisteredViewName{
|
|
107
|
+
registeredViewName = [inRegisteredViewName copy];
|
|
108
|
+
snapshotOfLastUpdate = UINT64_MAX;
|
|
109
|
+
}
|
|
110
|
+
|
|
84
111
|
- (id)copyWithZone:(NSZone *)zone
|
|
85
112
|
{
|
|
86
113
|
YapDatabaseViewMappings *copy = [[YapDatabaseViewMappings alloc] init];
|
|
87
114
|
copy->allGroups = allGroups;
|
|
88
115
|
copy->registeredViewName = registeredViewName;
|
|
116
|
+
|
|
117
|
+
copy->viewGroupsAreDynamic = viewGroupsAreDynamic;
|
|
118
|
+
copy->groupFilterBlock = groupFilterBlock;
|
|
119
|
+
copy->groupSort = groupSort;
|
|
89
120
|
|
|
90
121
|
copy->visibleGroups = [visibleGroups mutableCopy];
|
|
91
122
|
copy->counts = [counts mutableCopy];
|
|
92
123
|
copy->isUsingConsolidatedGroup = isUsingConsolidatedGroup;
|
|
93
124
|
copy->autoConsolidationDisabled = autoConsolidationDisabled;
|
|
94
125
|
|
|
126
|
+
copy->isDynamicSectionForAllGroups = isDynamicSectionForAllGroups;
|
|
95
127
|
copy->dynamicSections = [dynamicSections mutableCopy];
|
|
96
128
|
copy->reverse = [reverse mutableCopy];
|
|
97
129
|
copy->rangeOptions = [rangeOptions mutableCopy];
|
|
@@ -110,20 +142,21 @@
|
|
|
110
142
|
|
|
111
143
|
- (void)setIsDynamicSectionForAllGroups:(BOOL)isDynamic
|
|
112
144
|
{
|
|
113
|
-
|
|
114
|
-
[dynamicSections addObjectsFromArray:allGroups];
|
|
115
|
-
else
|
|
116
|
-
[dynamicSections removeAllObjects];
|
|
145
|
+
isDynamicSectionForAllGroups = isDynamic;
|
|
117
146
|
}
|
|
118
147
|
|
|
119
148
|
- (BOOL)isDynamicSectionForAllGroups
|
|
120
149
|
{
|
|
121
|
-
|
|
150
|
+
return isDynamicSectionForAllGroups;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
- (BOOL)isGroupNameValid:(NSString *)group{
|
|
154
|
+
return viewGroupsAreDynamic || [allGroups containsObject:group];
|
|
122
155
|
}
|
|
123
156
|
|
|
124
157
|
- (void)setIsDynamicSection:(BOOL)isDynamic forGroup:(NSString *)group
|
|
125
158
|
{
|
|
126
|
-
if (![
|
|
159
|
+
if (![self isGroupNameValid:group]) {
|
|
127
160
|
YDBLogWarn(@"%@ - mappings doesn't contain group(%@), only: %@", THIS_METHOD, group, allGroups);
|
|
128
161
|
return;
|
|
129
162
|
}
|
|
@@ -145,8 +178,8 @@
|
|
|
145
178
|
[self removeRangeOptionsForGroup:group];
|
|
146
179
|
return;
|
|
147
180
|
}
|
|
148
|
-
|
|
149
|
-
|
|
181
|
+
|
|
182
|
+
if (![self isGroupNameValid:group]){
|
|
150
183
|
YDBLogWarn(@"%@ - mappings doesn't contain group(%@), only: %@", THIS_METHOD, group, allGroups);
|
|
151
184
|
return;
|
|
152
185
|
}
|
|
@@ -196,7 +229,8 @@
|
|
|
196
229
|
|
|
197
230
|
- (void)setCellDrawingDependencyOffsets:(NSSet *)offsets forGroup:(NSString *)group
|
|
198
231
|
{
|
|
199
|
-
|
|
232
|
+
|
|
233
|
+
if (![self isGroupNameValid:group]){
|
|
200
234
|
YDBLogWarn(@"%@ - mappings doesn't contain group(%@), only: %@", THIS_METHOD, group, allGroups);
|
|
201
235
|
return;
|
|
202
236
|
}
|
|
@@ -249,7 +283,7 @@
|
|
|
249
283
|
|
|
250
284
|
- (void)setIsReversed:(BOOL)isReversed forGroup:(NSString *)group
|
|
251
285
|
{
|
|
252
|
-
|
|
286
|
+
if (![self isGroupNameValid:group]){
|
|
253
287
|
YDBLogWarn(@"%@ - mappings doesn't contain group(%@), only: %@", THIS_METHOD, group, allGroups);
|
|
254
288
|
return;
|
|
255
289
|
}
|
|
@@ -267,24 +301,9 @@
|
|
|
267
301
|
|
|
268
302
|
- (void)setAutoConsolidateGroupsThreshold:(NSUInteger)threshold withName:(NSString *)inConsolidatedGroupName
|
|
269
303
|
{
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
autoConsolidateGroupsThreshold = 0;
|
|
275
|
-
consolidatedGroupName = nil;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
if (inConsolidatedGroupName == nil || threshold == 0)
|
|
279
|
-
{
|
|
280
|
-
autoConsolidateGroupsThreshold = 0;
|
|
281
|
-
consolidatedGroupName = nil;
|
|
282
|
-
}
|
|
283
|
-
else
|
|
284
|
-
{
|
|
285
|
-
autoConsolidateGroupsThreshold = threshold;
|
|
286
|
-
consolidatedGroupName = [inConsolidatedGroupName copy];
|
|
287
|
-
}
|
|
304
|
+
autoConsolidateGroupsThreshold = threshold;
|
|
305
|
+
consolidatedGroupName = [inConsolidatedGroupName copy];
|
|
306
|
+
[self validateAutoConsolidation];
|
|
288
307
|
}
|
|
289
308
|
|
|
290
309
|
- (NSUInteger)autoConsolidateGroupsThreshold
|
|
@@ -343,9 +362,18 @@
|
|
|
343
362
|
@throw [NSException exceptionWithName:@"YapDatabaseException" reason:reason userInfo:userInfo];
|
|
344
363
|
}
|
|
345
364
|
|
|
365
|
+
YapDatabaseViewTransaction *viewTransaction = [transaction ext:registeredViewName];
|
|
366
|
+
if (viewGroupsAreDynamic)
|
|
367
|
+
{
|
|
368
|
+
NSArray *newGroups = [self filterAndSortGroups:[viewTransaction allGroups] withTransaction:transaction];
|
|
369
|
+
if ([self shouldUpdateAllGroupsWithNewGroups:newGroups]) {
|
|
370
|
+
[self updateMappingsWithNewGroups:newGroups];
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
|
|
346
374
|
for (NSString *group in allGroups)
|
|
347
375
|
{
|
|
348
|
-
NSUInteger count = [
|
|
376
|
+
NSUInteger count = [viewTransaction numberOfKeysInGroup:group];
|
|
349
377
|
|
|
350
378
|
[counts setObject:@(count) forKey:group];
|
|
351
379
|
}
|
|
@@ -359,12 +387,66 @@
|
|
|
359
387
|
[self updateVisibility];
|
|
360
388
|
}
|
|
361
389
|
|
|
390
|
+
- (void)updateMappingsWithNewGroups:(NSArray *)newAllGroups
|
|
391
|
+
{
|
|
392
|
+
allGroups = [newAllGroups copy];
|
|
393
|
+
[self validateAutoConsolidation];
|
|
394
|
+
id sharedKeySet = [NSDictionary sharedKeySetForKeys:allGroups];
|
|
395
|
+
counts = [NSMutableDictionary dictionaryWithSharedKeySet:sharedKeySet];
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
- (void)validateAutoConsolidation{
|
|
399
|
+
if ([allGroups containsObject:consolidatedGroupName]){
|
|
400
|
+
YDBLogWarn(@"%@ - consolidatedGroupName cannot match existing groupName", THIS_METHOD);
|
|
401
|
+
consolidatedGroupName = nil;
|
|
402
|
+
autoConsolidateGroupsThreshold = 0;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
if (consolidatedGroupName == nil || autoConsolidateGroupsThreshold == 0){
|
|
406
|
+
consolidatedGroupName = nil;
|
|
407
|
+
autoConsolidateGroupsThreshold = 0;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
- (NSArray *)filterAndSortGroups:(NSArray *)groups withTransaction:(YapDatabaseReadTransaction *)transaction
|
|
412
|
+
{
|
|
413
|
+
NSMutableArray *newAllGroups = [NSMutableArray arrayWithCapacity:[groups count]];
|
|
414
|
+
for (NSString *group in groups)
|
|
415
|
+
{
|
|
416
|
+
if (groupFilterBlock(group, transaction)) {
|
|
417
|
+
[newAllGroups addObject:group];
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
[newAllGroups sortUsingComparator:^NSComparisonResult(id obj1, id obj2) {
|
|
422
|
+
|
|
423
|
+
return groupSort(obj1, obj2, transaction);
|
|
424
|
+
}];
|
|
425
|
+
|
|
426
|
+
return [newAllGroups copy];
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
- (BOOL)shouldUpdateAllGroupsWithNewGroups:(NSArray *)newGroups{
|
|
430
|
+
return ![allGroups isEqualToArray:newGroups];
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
|
|
362
434
|
/**
|
|
363
435
|
* This method is internal.
|
|
364
436
|
* It is only for use by the unit tests in TestViewChangeLogic.
|
|
365
437
|
**/
|
|
366
438
|
- (void)updateWithCounts:(NSDictionary *)newCounts
|
|
367
439
|
{
|
|
440
|
+
if (viewGroupsAreDynamic)
|
|
441
|
+
{
|
|
442
|
+
// The groups passed in the dictionary represent the new allGroups.
|
|
443
|
+
// This simulates as if we ran the groupFilterBlock & groupSortBlock.
|
|
444
|
+
|
|
445
|
+
NSArray *newGroups = [newCounts allKeys];
|
|
446
|
+
if ([self shouldUpdateAllGroupsWithNewGroups:newGroups]) {
|
|
447
|
+
[self updateMappingsWithNewGroups:newGroups];
|
|
448
|
+
}
|
|
449
|
+
}
|
|
368
450
|
for (NSString *group in allGroups)
|
|
369
451
|
{
|
|
370
452
|
NSUInteger count = [[newCounts objectForKey:group] unsignedIntegerValue];
|
|
@@ -441,7 +523,7 @@
|
|
|
441
523
|
else
|
|
442
524
|
count = [[counts objectForKey:group] unsignedIntegerValue];
|
|
443
525
|
|
|
444
|
-
if (count > 0 || ![
|
|
526
|
+
if (count > 0 || ![self isGroupDynamic:group]) {
|
|
445
527
|
[visibleGroups addObject:group];
|
|
446
528
|
}
|
|
447
529
|
|
|
@@ -454,6 +536,13 @@
|
|
|
454
536
|
isUsingConsolidatedGroup = NO;
|
|
455
537
|
}
|
|
456
538
|
|
|
539
|
+
-(BOOL)isGroupDynamic:(NSString *)group{
|
|
540
|
+
if (!isDynamicSectionForAllGroups){
|
|
541
|
+
return [dynamicSections containsObject:group];
|
|
542
|
+
}
|
|
543
|
+
return YES;
|
|
544
|
+
}
|
|
545
|
+
|
|
457
546
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
458
547
|
#pragma mark Internal
|
|
459
548
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
@@ -528,8 +617,13 @@
|
|
|
528
617
|
* Returns the number of items in the given group.
|
|
529
618
|
*
|
|
530
619
|
* This is the cached value from the last time one of the following methods was invoked:
|
|
531
|
-
* - updateWithTransaction:
|
|
532
|
-
*
|
|
620
|
+
* - updateWithTransaction:
|
|
621
|
+
* which should be invoked when the mapping is first created and then will be invoked whenever
|
|
622
|
+
* - (void)getSectionChanges:(NSArray **)sectionChangesPtr
|
|
623
|
+
* rowChanges:(NSArray **)rowChangesPtr
|
|
624
|
+
* forNotifications:(NSArray *)notifications
|
|
625
|
+
* withMappings:(YapDatabaseViewMappings *)mappings
|
|
626
|
+
* is called on the associated registered YapDatabaseView.
|
|
533
627
|
**/
|
|
534
628
|
- (NSUInteger)numberOfItemsInGroup:(NSString *)group
|
|
535
629
|
{
|
|
@@ -1124,6 +1218,8 @@
|
|
|
1124
1218
|
return NO;
|
|
1125
1219
|
}
|
|
1126
1220
|
|
|
1221
|
+
//- (NSUInteger)groupOffsetForGroup:
|
|
1222
|
+
|
|
1127
1223
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
1128
1224
|
#pragma mark Getters + RangeOptions
|
|
1129
1225
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
@@ -1274,6 +1370,33 @@
|
|
|
1274
1370
|
return total;
|
|
1275
1371
|
}
|
|
1276
1372
|
|
|
1373
|
+
/**
|
|
1374
|
+
* When isUsingConsolidatedGroup, this method returns the offset of the given group
|
|
1375
|
+
* within the flattened/consolidated group.
|
|
1376
|
+
**/
|
|
1377
|
+
- (NSUInteger)rowOffsetForGroup:(NSString *)searchGroup
|
|
1378
|
+
{
|
|
1379
|
+
NSUInteger offset = 0;
|
|
1380
|
+
|
|
1381
|
+
for (NSString *group in visibleGroups) // NOT [self visibleGroups]
|
|
1382
|
+
{
|
|
1383
|
+
if ([group isEqualToString:searchGroup])
|
|
1384
|
+
{
|
|
1385
|
+
return offset;
|
|
1386
|
+
}
|
|
1387
|
+
else
|
|
1388
|
+
{
|
|
1389
|
+
YapDatabaseViewRangeOptions *rangeOpts = [rangeOptions objectForKey:group];
|
|
1390
|
+
if (rangeOpts)
|
|
1391
|
+
offset += rangeOpts.length;
|
|
1392
|
+
else
|
|
1393
|
+
offset += [[counts objectForKey:group] unsignedIntegerValue];
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
return 0;
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1277
1400
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
1278
1401
|
#pragma mark Getters + Utilities
|
|
1279
1402
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
@@ -1390,7 +1513,16 @@
|
|
|
1390
1513
|
groupIndex++;
|
|
1391
1514
|
}
|
|
1392
1515
|
|
|
1393
|
-
if (!foundGroup)
|
|
1516
|
+
if (!foundGroup)
|
|
1517
|
+
{
|
|
1518
|
+
// The given group doesn't exist.
|
|
1519
|
+
//
|
|
1520
|
+
// Note: You should NOT be passing the consolidatedGroup to this method.
|
|
1521
|
+
// You need to pass the proper database view group.
|
|
1522
|
+
// If the mappings are consolidated, this method will automatically translate the result for you.
|
|
1523
|
+
|
|
1524
|
+
return nil;
|
|
1525
|
+
}
|
|
1394
1526
|
|
|
1395
1527
|
BOOL isGroupVisible = NO;
|
|
1396
1528
|
NSUInteger visibleGroupIndex = 0;
|
|
@@ -1412,24 +1544,21 @@
|
|
|
1412
1544
|
NSUInteger rows = [self numberOfItemsInGroup:searchGroup];
|
|
1413
1545
|
if (rows > 0)
|
|
1414
1546
|
{
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
#else
|
|
1420
|
-
NSUInteger indexes[] = {visibleGroupIndex, row};
|
|
1421
|
-
return [NSIndexPath indexPathWithIndexes:indexes length:2];
|
|
1422
|
-
#endif
|
|
1423
|
-
}
|
|
1424
|
-
else
|
|
1547
|
+
NSUInteger _row = (row < rows) ? row : rows-1;
|
|
1548
|
+
NSUInteger _section = visibleGroupIndex;
|
|
1549
|
+
|
|
1550
|
+
if (isUsingConsolidatedGroup)
|
|
1425
1551
|
{
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
#else
|
|
1429
|
-
NSUInteger indexes[] = {visibleGroupIndex, (rows-1)};
|
|
1430
|
-
return [NSIndexPath indexPathWithIndexes:indexes length:2];
|
|
1431
|
-
#endif
|
|
1552
|
+
_row += [self rowOffsetForGroup:searchGroup];
|
|
1553
|
+
_section = 0;
|
|
1432
1554
|
}
|
|
1555
|
+
|
|
1556
|
+
#if TARGET_OS_IPHONE
|
|
1557
|
+
return [NSIndexPath indexPathForRow:_row inSection:_section];
|
|
1558
|
+
#else
|
|
1559
|
+
NSUInteger indexes[] = {_section, _row};
|
|
1560
|
+
return [NSIndexPath indexPathWithIndexes:indexes length:2];
|
|
1561
|
+
#endif
|
|
1433
1562
|
}
|
|
1434
1563
|
}
|
|
1435
1564
|
|
|
@@ -1449,10 +1578,19 @@
|
|
|
1449
1578
|
NSUInteger rows = [self numberOfItemsInGroup:nearbyGroup];
|
|
1450
1579
|
if (rows > 0)
|
|
1451
1580
|
{
|
|
1581
|
+
NSUInteger _row = rows-1;
|
|
1582
|
+
NSUInteger _section = section;
|
|
1583
|
+
|
|
1584
|
+
if (isUsingConsolidatedGroup)
|
|
1585
|
+
{
|
|
1586
|
+
_row += [self rowOffsetForGroup:nearbyGroup];
|
|
1587
|
+
_section = 0;
|
|
1588
|
+
}
|
|
1589
|
+
|
|
1452
1590
|
#if TARGET_OS_IPHONE
|
|
1453
|
-
return [NSIndexPath indexPathForRow:
|
|
1591
|
+
return [NSIndexPath indexPathForRow:_row inSection:_section];
|
|
1454
1592
|
#else
|
|
1455
|
-
NSUInteger indexes[] = {
|
|
1593
|
+
NSUInteger indexes[] = {_section, _row};
|
|
1456
1594
|
return [NSIndexPath indexPathWithIndexes:indexes length:2];
|
|
1457
1595
|
#endif
|
|
1458
1596
|
}
|
|
@@ -1473,10 +1611,19 @@
|
|
|
1473
1611
|
NSUInteger rows = [self numberOfItemsInGroup:nearbyGroup];
|
|
1474
1612
|
if (rows > 0)
|
|
1475
1613
|
{
|
|
1614
|
+
NSUInteger _row = 0;
|
|
1615
|
+
NSUInteger _section = section;
|
|
1616
|
+
|
|
1617
|
+
if (isUsingConsolidatedGroup)
|
|
1618
|
+
{
|
|
1619
|
+
_row += [self rowOffsetForGroup:nearbyGroup];
|
|
1620
|
+
_section = 0;
|
|
1621
|
+
}
|
|
1622
|
+
|
|
1476
1623
|
#if TARGET_OS_IPHONE
|
|
1477
|
-
return [NSIndexPath indexPathForRow:
|
|
1624
|
+
return [NSIndexPath indexPathForRow:_row inSection:_section];
|
|
1478
1625
|
#else
|
|
1479
|
-
NSUInteger indexes[] = {
|
|
1626
|
+
NSUInteger indexes[] = {_section, _row};
|
|
1480
1627
|
return [NSIndexPath indexPathWithIndexes:indexes length:2];
|
|
1481
1628
|
#endif
|
|
1482
1629
|
}
|