motion-yapper 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -63,6 +63,7 @@
|
|
63
63
|
- (void)removeObjectsForKeys:(NSArray *)keys;
|
64
64
|
|
65
65
|
- (void)enumerateKeysWithBlock:(void (^)(id key, BOOL *stop))block;
|
66
|
+
- (void)enumerateKeysAndObjectsWithBlock:(void (^)(id key, id obj, BOOL *stop))block;
|
66
67
|
|
67
68
|
//
|
68
69
|
// Some debugging stuff that gets compiled out
|
@@ -14,6 +14,9 @@
|
|
14
14
|
@property (nonatomic, strong, readonly) NSString *collection;
|
15
15
|
@property (nonatomic, strong, readonly) NSString *key;
|
16
16
|
|
17
|
+
- (BOOL)isEqualToCollectionKey:(YapCollectionKey *)collectionKey;
|
18
|
+
|
19
|
+
// These methods are overriden and optimized:
|
17
20
|
- (BOOL)isEqual:(id)anObject;
|
18
21
|
- (NSUInteger)hash;
|
19
22
|
|
@@ -330,7 +330,7 @@ extern NSString *const YapDatabaseAllKeysRemovedKey;
|
|
330
330
|
|
331
331
|
#if TARGET_OS_IPHONE
|
332
332
|
/**
|
333
|
-
* Allows you to set the default
|
333
|
+
* Allows you to set the default autoFlushMemoryFlags for all new connections.
|
334
334
|
*
|
335
335
|
* When you create a connection via [database newConnection], that new connection will inherit
|
336
336
|
* its initial configuration via the default values configured for the parent database.
|
@@ -339,12 +339,12 @@ extern NSString *const YapDatabaseAllKeysRemovedKey;
|
|
339
339
|
* Changing the default values only affects future connections that will be created.
|
340
340
|
* It does not affect connections that have already been created.
|
341
341
|
*
|
342
|
-
* The default
|
342
|
+
* The default defaultAutoFlushMemoryFlags is YapDatabaseConnectionFlushMemoryFlags_All.
|
343
343
|
*
|
344
344
|
* For more detailed documentation on these properties, see the YapDatabaseConnection header file.
|
345
|
-
* @see YapDatabaseConnection
|
345
|
+
* @see YapDatabaseConnection autoFlushMemoryFlags
|
346
346
|
**/
|
347
|
-
@property (atomic, assign, readwrite) int
|
347
|
+
@property (atomic, assign, readwrite) int defaultAutoFlushMemoryFlags;
|
348
348
|
#endif
|
349
349
|
|
350
350
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
@@ -29,12 +29,14 @@
|
|
29
29
|
* But for conncurrent access between multiple threads you must use multiple connections.
|
30
30
|
**/
|
31
31
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
32
|
+
enum {
|
33
|
+
YapDatabaseConnectionFlushMemoryFlags_None = 0,
|
34
|
+
YapDatabaseConnectionFlushMemoryFlags_Caches = 1 << 0,
|
35
|
+
YapDatabaseConnectionFlushMemoryFlags_Statements = 1 << 1,
|
36
|
+
YapDatabaseConnectionFlushMemoryFlags_All = (YapDatabaseConnectionFlushMemoryFlags_Caches |
|
37
|
+
YapDatabaseConnectionFlushMemoryFlags_Statements),
|
38
|
+
};
|
39
|
+
typedef int YapDatabaseConnectionFlushMemoryFlags;
|
38
40
|
|
39
41
|
typedef enum {
|
40
42
|
YapDatabasePolicyContainment = 0,
|
@@ -418,30 +420,30 @@ typedef enum {
|
|
418
420
|
* Depending upon how often you use the database connection,
|
419
421
|
* you may want to be more or less aggressive on how much stuff you flush.
|
420
422
|
*
|
421
|
-
*
|
422
|
-
* No-op. Doesn't flush
|
423
|
+
* YapDatabaseConnectionFlushMemoryFlags_None:
|
424
|
+
* No-op. Doesn't flush anything.
|
423
425
|
*
|
424
|
-
*
|
425
|
-
* Flushes the object cache and metadata cache.
|
426
|
+
* YapDatabaseConnectionFlushMemoryFlags_Caches:
|
427
|
+
* Flushes all caches, including the object cache and metadata cache.
|
426
428
|
*
|
427
|
-
*
|
428
|
-
*
|
429
|
+
* YapDatabaseConnectionFlushMemoryFlags_Statements:
|
430
|
+
* Flushes all pre-compiled sqlite statements.
|
429
431
|
*
|
430
|
-
*
|
431
|
-
* Full flush of all caches and
|
432
|
+
* YapDatabaseConnectionFlushMemoryFlags_All:
|
433
|
+
* Full flush of all caches and pre-compiled sqlite statements.
|
432
434
|
**/
|
433
|
-
- (void)
|
435
|
+
- (void)flushMemoryWithFlags:(YapDatabaseConnectionFlushMemoryFlags)flags;
|
434
436
|
|
435
437
|
#if TARGET_OS_IPHONE
|
436
438
|
/**
|
437
439
|
* When a UIApplicationDidReceiveMemoryWarningNotification is received,
|
438
|
-
* the code automatically invokes
|
440
|
+
* the code automatically invokes flushMemoryWithFlags and passes the set flags.
|
439
441
|
*
|
440
|
-
* The default value is
|
442
|
+
* The default value is YapDatabaseConnectionFlushMemoryFlags_All.
|
441
443
|
*
|
442
|
-
* @see
|
444
|
+
* @see flushMemoryWithFlags:
|
443
445
|
**/
|
444
|
-
@property (atomic, assign, readwrite)
|
446
|
+
@property (atomic, assign, readwrite) YapDatabaseConnectionFlushMemoryFlags autoFlushMemoryFlags;
|
445
447
|
#endif
|
446
448
|
|
447
449
|
@end
|
@@ -31,7 +31,7 @@
|
|
31
31
|
@property (nonatomic, assign, readwrite) YapDatabasePolicy metadataPolicy;
|
32
32
|
|
33
33
|
#if TARGET_OS_IPHONE
|
34
|
-
@property (nonatomic, assign, readwrite)
|
34
|
+
@property (nonatomic, assign, readwrite) YapDatabaseConnectionFlushMemoryFlags autoFlushMemoryFlags;
|
35
35
|
#endif
|
36
36
|
|
37
37
|
@end
|
@@ -7,6 +7,7 @@
|
|
7
7
|
#import "YapDatabase.h"
|
8
8
|
#import "YapDatabaseConnection.h"
|
9
9
|
#import "YapDatabaseTransaction.h"
|
10
|
+
#import "YapCollectionKey.h"
|
10
11
|
|
11
12
|
#import "sqlite3.h"
|
12
13
|
|
@@ -136,34 +137,19 @@
|
|
136
137
|
* This method will be invoked in order to flush memory.
|
137
138
|
* Subclasses are encouraged to do something similar to the following:
|
138
139
|
*
|
139
|
-
* if (
|
140
|
+
* if (flags & YapDatabaseConnectionFlushMemoryFlags_Caches)
|
140
141
|
* {
|
141
142
|
* // Dump all caches
|
142
143
|
* }
|
143
144
|
*
|
144
|
-
* if (
|
145
|
+
* if (flags & YapDatabaseConnectionFlushMemoryFlags_Statements)
|
145
146
|
* {
|
146
|
-
* //
|
147
|
-
* //
|
148
|
-
* // For example, any statements that make modifications to the database,
|
149
|
-
* // and any other statements that are likely to be used infrequently.
|
147
|
+
* // Dump all pre-compiled statements
|
150
148
|
*
|
151
149
|
* sqlite_finalize_null(&myStatement);
|
152
150
|
* }
|
153
|
-
*
|
154
|
-
* if (level >= YapDatabaseConnectionFlushMemoryLevelFull)
|
155
|
-
* {
|
156
|
-
* // Release all other prepared statements
|
157
|
-
*
|
158
|
-
* sqlite_finalize_null(&myOtherStatement);
|
159
|
-
*
|
160
|
-
* // And flush any state that may have been prepared via
|
161
|
-
* // the extTransaction's prepareIfNeeded method.
|
162
|
-
*
|
163
|
-
* viewGroups = nil;
|
164
|
-
* }
|
165
151
|
**/
|
166
|
-
- (void)
|
152
|
+
- (void)_flushMemoryWithFlags:(YapDatabaseConnectionFlushMemoryFlags)flags;
|
167
153
|
|
168
154
|
/**
|
169
155
|
* Subclasses MUST implement this method.
|
@@ -325,6 +311,21 @@
|
|
325
311
|
**/
|
326
312
|
- (BOOL)prepareIfNeeded;
|
327
313
|
|
314
|
+
/**
|
315
|
+
* Subclasses may OPTIONALLY implement this method.
|
316
|
+
* This method is only called if within a readwrite transaction.
|
317
|
+
*
|
318
|
+
* Subclasses should ONLY implement this method if they need to make changes to the 'database' table.
|
319
|
+
* That is, the main collection/key/value table that directly stores the user's objects.
|
320
|
+
*
|
321
|
+
* Return NO if the extension does not directly modify the main database table.
|
322
|
+
* Return YES if the extension does modify the main database table,
|
323
|
+
* regardless of whether it made changes during this invocation.
|
324
|
+
*
|
325
|
+
* This method may be invoked several times in a row.
|
326
|
+
**/
|
327
|
+
- (BOOL)flushPendingChangesToMainDatabaseTable;
|
328
|
+
|
328
329
|
/**
|
329
330
|
* Subclasses may OPTIONALLY implement this method.
|
330
331
|
* This method is only called if within a readwrite transaction.
|
@@ -332,7 +333,7 @@
|
|
332
333
|
* Subclasses may implement it to perform any "cleanup" before the changeset is requested.
|
333
334
|
* Remember, the changeset is requested before the commitTransaction method is invoked.
|
334
335
|
**/
|
335
|
-
- (void)
|
336
|
+
- (void)prepareChangeset;
|
336
337
|
|
337
338
|
/**
|
338
339
|
* Subclasses MUST implement this method.
|
@@ -400,6 +401,8 @@
|
|
400
401
|
- (NSData *)dataValueForExtensionKey:(NSString *)key;
|
401
402
|
- (void)setDataValue:(NSData *)value forExtensionKey:(NSString *)key;
|
402
403
|
|
404
|
+
- (void)removeValueForExtensionKey:(NSString *)key;
|
405
|
+
|
403
406
|
@end
|
404
407
|
|
405
408
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
@@ -413,26 +416,27 @@
|
|
413
416
|
@required
|
414
417
|
|
415
418
|
- (void)handleInsertObject:(id)object
|
416
|
-
|
417
|
-
inCollection:(NSString *)collection
|
419
|
+
forCollectionKey:(YapCollectionKey *)collectionKey
|
418
420
|
withMetadata:(id)metadata
|
419
421
|
rowid:(int64_t)rowid;
|
420
422
|
|
421
423
|
- (void)handleUpdateObject:(id)object
|
422
|
-
|
423
|
-
inCollection:(NSString *)collection
|
424
|
+
forCollectionKey:(YapCollectionKey *)collectionKey
|
424
425
|
withMetadata:(id)metadata
|
425
426
|
rowid:(int64_t)rowid;
|
426
427
|
|
427
|
-
- (void)
|
428
|
-
|
429
|
-
|
430
|
-
|
428
|
+
- (void)handleReplaceObject:(id)object
|
429
|
+
forCollectionKey:(YapCollectionKey *)collectionKey
|
430
|
+
withRowid:(int64_t)rowid;
|
431
|
+
|
432
|
+
- (void)handleReplaceMetadata:(id)metadata
|
433
|
+
forCollectionKey:(YapCollectionKey *)collectionKey
|
434
|
+
withRowid:(int64_t)rowid;
|
431
435
|
|
432
|
-
- (void)
|
433
|
-
- (void)
|
436
|
+
- (void)handleTouchObjectForCollectionKey:(YapCollectionKey *)collectionKey withRowid:(int64_t)rowid;
|
437
|
+
- (void)handleTouchMetadataForCollectionKey:(YapCollectionKey *)collectionKey withRowid:(int64_t)rowid;
|
434
438
|
|
435
|
-
- (void)
|
439
|
+
- (void)handleRemoveObjectForCollectionKey:(YapCollectionKey *)collectionKey withRowid:(int64_t)rowid;
|
436
440
|
- (void)handleRemoveObjectsForKeys:(NSArray *)keys inCollection:(NSString *)collection withRowids:(NSArray *)rowids;
|
437
441
|
|
438
442
|
- (void)handleRemoveAllObjectsInAllCollections;
|
@@ -1,26 +1,12 @@
|
|
1
1
|
#import <Foundation/Foundation.h>
|
2
2
|
|
3
3
|
#import "YapDatabaseView.h"
|
4
|
+
|
5
|
+
#import "YapDatabaseFilteredViewTypes.h"
|
4
6
|
#import "YapDatabaseFilteredViewConnection.h"
|
5
7
|
#import "YapDatabaseFilteredViewTransaction.h"
|
6
8
|
|
7
9
|
|
8
|
-
#ifndef YapDatabaseViewFilteringBlockDefined
|
9
|
-
#define YapDatabaseViewFilteringBlockDefined 1
|
10
|
-
|
11
|
-
typedef id YapDatabaseViewFilteringBlock; // One of the YapDatabaseViewGroupingX types below.
|
12
|
-
|
13
|
-
typedef BOOL (^YapDatabaseViewFilteringWithKeyBlock) \
|
14
|
-
(NSString *group, NSString *collection, NSString *key);
|
15
|
-
typedef BOOL (^YapDatabaseViewFilteringWithObjectBlock) \
|
16
|
-
(NSString *group, NSString *collection, NSString *key, id object);
|
17
|
-
typedef BOOL (^YapDatabaseViewFilteringWithMetadataBlock)\
|
18
|
-
(NSString *group, NSString *collection, NSString *key, id metadata);
|
19
|
-
typedef BOOL (^YapDatabaseViewFilteringWithRowBlock) \
|
20
|
-
(NSString *group, NSString *collection, NSString *key, id object, id metadata);
|
21
|
-
|
22
|
-
#endif
|
23
|
-
|
24
10
|
@interface YapDatabaseFilteredView : YapDatabaseView
|
25
11
|
|
26
12
|
/**
|
@@ -40,6 +26,8 @@ typedef BOOL (^YapDatabaseViewFilteringWithRowBlock) \
|
|
40
26
|
* It allows you to filter items from this view that exist in the parent view.
|
41
27
|
* You should pick a block type that requires the minimum number of parameters that you need.
|
42
28
|
*
|
29
|
+
* @see YapDatabaseViewTypes.h for block type definition(s).
|
30
|
+
*
|
43
31
|
* @param filteringBlockType
|
44
32
|
*
|
45
33
|
* This parameter identifies the type of filtering block being used.
|
@@ -48,6 +36,8 @@ typedef BOOL (^YapDatabaseViewFilteringWithRowBlock) \
|
|
48
36
|
* - YapDatabaseViewBlockTypeWithObject
|
49
37
|
* - YapDatabaseViewBlockTypeWithMetadata
|
50
38
|
* - YapDatabaseViewBlockTypeWithRow
|
39
|
+
*
|
40
|
+
* @see YapDatabaseViewTypes.h for block type definition(s).
|
51
41
|
*
|
52
42
|
* @param tag
|
53
43
|
*
|
@@ -70,12 +60,12 @@ typedef BOOL (^YapDatabaseViewFilteringWithRowBlock) \
|
|
70
60
|
- (id)initWithParentViewName:(NSString *)viewName
|
71
61
|
filteringBlock:(YapDatabaseViewFilteringBlock)filteringBlock
|
72
62
|
filteringBlockType:(YapDatabaseViewBlockType)filteringBlockType
|
73
|
-
|
63
|
+
versionTag:(NSString *)versionTag;
|
74
64
|
|
75
65
|
- (id)initWithParentViewName:(NSString *)viewName
|
76
66
|
filteringBlock:(YapDatabaseViewFilteringBlock)filteringBlock
|
77
67
|
filteringBlockType:(YapDatabaseViewBlockType)filteringBlockType
|
78
|
-
|
68
|
+
versionTag:(NSString *)versionTag
|
79
69
|
options:(YapDatabaseViewOptions *)options;
|
80
70
|
|
81
71
|
@property (nonatomic, strong, readonly) NSString *parentViewName;
|
@@ -83,23 +73,6 @@ typedef BOOL (^YapDatabaseViewFilteringWithRowBlock) \
|
|
83
73
|
@property (nonatomic, strong, readonly) YapDatabaseViewFilteringBlock filteringBlock;
|
84
74
|
@property (nonatomic, assign, readonly) YapDatabaseViewBlockType filteringBlockType;
|
85
75
|
|
86
|
-
/**
|
87
|
-
* The tag assists you in updating the filteringBlock.
|
88
|
-
*
|
89
|
-
* Whenever you change the filteringBlock, just specify a tag to associate with the block.
|
90
|
-
* The tag can help you to identify the filtering criteria, or perhaps be used as a versioning scheme.
|
91
|
-
*
|
92
|
-
* Here's how it works:
|
93
|
-
* The very first time you create the filteredView, it will populate itself from the parentView + filteringBlock.
|
94
|
-
* On subsequent app launches, when you re-register the filteredView, it will check the passed tag with
|
95
|
-
* the tag it has stored from the previous app session. If the tags match then the filteredView knows it doesn't
|
96
|
-
* have to do anything. (It's already setup from last app session.) However, if the tags don't match, then
|
97
|
-
* the filteredView will re-populate itself.
|
98
|
-
*
|
99
|
-
* It works the same way if you change the filteringBlock on-the-fly. (See setFilteringBlock:filteringBlockType:tag:)
|
100
|
-
**/
|
101
|
-
@property (nonatomic, copy, readonly) NSString *tag;
|
102
|
-
|
103
76
|
/**
|
104
77
|
* The options allow you to specify things like creating an IN-MEMORY-ONLY VIEW (non persistent).
|
105
78
|
**/
|
@@ -1,24 +1,9 @@
|
|
1
1
|
#import <Foundation/Foundation.h>
|
2
2
|
|
3
3
|
#import "YapDatabaseViewTransaction.h"
|
4
|
+
#import "YapDatabaseFilteredViewTypes.h"
|
4
5
|
#import "YapDatabaseFilteredView.h"
|
5
6
|
|
6
|
-
#ifndef YapDatabaseViewFilteringBlockDefined
|
7
|
-
#define YapDatabaseViewFilteringBlockDefined 1
|
8
|
-
|
9
|
-
typedef id YapDatabaseViewFilteringBlock; // One of the YapDatabaseViewGroupingX types below.
|
10
|
-
|
11
|
-
typedef BOOL (^YapDatabaseViewFilteringWithKeyBlock) \
|
12
|
-
(NSString *group, NSString *collection, NSString *key);
|
13
|
-
typedef BOOL (^YapDatabaseViewFilteringWithObjectBlock) \
|
14
|
-
(NSString *group, NSString *collection, NSString *key, id object);
|
15
|
-
typedef BOOL (^YapDatabaseViewFilteringWithMetadataBlock)\
|
16
|
-
(NSString *group, NSString *collection, NSString *key, id metadata);
|
17
|
-
typedef BOOL (^YapDatabaseViewFilteringWithRowBlock) \
|
18
|
-
(NSString *group, NSString *collection, NSString *key, id object, id metadata);
|
19
|
-
|
20
|
-
#endif
|
21
|
-
|
22
7
|
|
23
8
|
@interface YapDatabaseFilteredViewTransaction : YapDatabaseViewTransaction
|
24
9
|
|
@@ -32,8 +17,23 @@ typedef BOOL (^YapDatabaseViewFilteringWithRowBlock) \
|
|
32
17
|
|
33
18
|
@interface YapDatabaseFilteredViewTransaction (ReadWrite)
|
34
19
|
|
20
|
+
/**
|
21
|
+
* This method allows you to change the filterBlock on-the-fly.
|
22
|
+
*
|
23
|
+
* When you do so, the extension will emit the smallest change-set possible.
|
24
|
+
* That is, it does NOT clear the view and start from scratch.
|
25
|
+
* Rather it performs a quick in-place update.
|
26
|
+
* The end result is a minimal change-set that looks nice for tableView / collectionView animations.
|
27
|
+
*
|
28
|
+
* For example, in Apple's phone app, in the Recents tab, one can switch between "all" and "missed" calls.
|
29
|
+
* Tapping the "missed" button smoothly animates away all non-red rows. It looks great.
|
30
|
+
* You can get the same effect by using a YapDatabaseFilteredView,
|
31
|
+
* and swapping in/out a filterBlock to allow/disallow non-missed calls.
|
32
|
+
*
|
33
|
+
* Note: You must pass a different versionTag, or this method does nothing.
|
34
|
+
**/
|
35
35
|
- (void)setFilteringBlock:(YapDatabaseViewFilteringBlock)filteringBlock
|
36
36
|
filteringBlockType:(YapDatabaseViewBlockType)filteringBlockType
|
37
|
-
|
37
|
+
versionTag:(NSString *)tag;
|
38
38
|
|
39
39
|
@end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
#import <Foundation/Foundation.h>
|
2
|
+
|
3
|
+
|
4
|
+
/**
|
5
|
+
* The filtering block removes items from this view that are in the parent view.
|
6
|
+
*
|
7
|
+
* A YapDatabaseFilteredView will have the same groups and same sort order as the parent,
|
8
|
+
* with the exception of those groups/rows that the filter block returned NO for.
|
9
|
+
*
|
10
|
+
* Here's how it works:
|
11
|
+
* When you initialize a YapDatabaseFilteredView instance, it will enumerate the parentView
|
12
|
+
* and invoke the filter block for every row in every group. So it can quickly copy a parentView as it
|
13
|
+
* doesn't have to perform any sorting.
|
14
|
+
*
|
15
|
+
* After its initialization, the filterView will automatically run for inserted / updated rows
|
16
|
+
* after the parentView has processed them. It then gets the group from parentView,
|
17
|
+
* and invokes the filterBlock again (if needed).
|
18
|
+
*
|
19
|
+
* You should choose a block type that takes the minimum number of required parameters.
|
20
|
+
* The filterView can make various optimizations based on required parameters of the block.
|
21
|
+
**/
|
22
|
+
typedef id YapDatabaseViewFilteringBlock; // One of the YapDatabaseViewGroupingX types below.
|
23
|
+
|
24
|
+
typedef BOOL (^YapDatabaseViewFilteringWithKeyBlock) \
|
25
|
+
(NSString *group, NSString *collection, NSString *key);
|
26
|
+
typedef BOOL (^YapDatabaseViewFilteringWithObjectBlock) \
|
27
|
+
(NSString *group, NSString *collection, NSString *key, id object);
|
28
|
+
typedef BOOL (^YapDatabaseViewFilteringWithMetadataBlock)\
|
29
|
+
(NSString *group, NSString *collection, NSString *key, id metadata);
|
30
|
+
typedef BOOL (^YapDatabaseViewFilteringWithRowBlock) \
|
31
|
+
(NSString *group, NSString *collection, NSString *key, id object, id metadata);
|
32
|
+
|
@@ -8,6 +8,14 @@
|
|
8
8
|
|
9
9
|
#import "sqlite3.h"
|
10
10
|
|
11
|
+
/**
|
12
|
+
* This version number is stored in the yap2 table.
|
13
|
+
* If there is a major re-write to this class, then the version number will be incremented,
|
14
|
+
* and the class can automatically rebuild the tables as needed.
|
15
|
+
**/
|
16
|
+
#define YAP_DATABASE_FTS_CLASS_VERSION 1
|
17
|
+
|
18
|
+
|
11
19
|
@interface YapDatabaseFullTextSearch () {
|
12
20
|
@public
|
13
21
|
|
@@ -8,6 +8,7 @@
|
|
8
8
|
|
9
9
|
#import "YapCache.h"
|
10
10
|
#import "YapMemoryTable.h"
|
11
|
+
#import "YapCollectionKey.h"
|
11
12
|
|
12
13
|
#import "sqlite3.h"
|
13
14
|
|
@@ -25,6 +26,8 @@ NS_INLINE void sqlite_finalize_null(sqlite3_stmt **stmtPtr)
|
|
25
26
|
extern NSString *const YapDatabaseRegisteredExtensionsKey;
|
26
27
|
extern NSString *const YapDatabaseRegisteredTablesKey;
|
27
28
|
extern NSString *const YapDatabaseExtensionsOrderKey;
|
29
|
+
extern NSString *const YapDatabaseExtensionDependenciesKey;
|
30
|
+
extern NSString *const YapDatabaseRemovedRowidsKey;
|
28
31
|
extern NSString *const YapDatabaseNotificationKey;
|
29
32
|
|
30
33
|
@interface YapDatabase () {
|
@@ -41,8 +44,8 @@ extern NSString *const YapDatabaseNotificationKey;
|
|
41
44
|
NSDictionary *registeredExtensions;
|
42
45
|
NSDictionary *registeredTables;
|
43
46
|
|
44
|
-
NSDictionary *extensionDependencies;
|
45
47
|
NSArray *extensionsOrder;
|
48
|
+
NSDictionary *extensionDependencies;
|
46
49
|
|
47
50
|
YapDatabaseConnection *registrationConnection;
|
48
51
|
|
@@ -81,6 +84,7 @@ extern NSString *const YapDatabaseNotificationKey;
|
|
81
84
|
**/
|
82
85
|
- (BOOL)tableExists:(NSString *)tableName using:(sqlite3 *)aDb;
|
83
86
|
- (NSArray *)columnNamesForTable:(NSString *)tableName using:(sqlite3 *)aDb;
|
87
|
+
- (NSDictionary *)columnNamesAndAffinityForTable:(NSString *)tableName using:(sqlite3 *)aDb;
|
84
88
|
|
85
89
|
/**
|
86
90
|
* New connections inherit their default values from this structure.
|
@@ -104,6 +108,7 @@ extern NSString *const YapDatabaseNotificationKey;
|
|
104
108
|
**/
|
105
109
|
- (NSDictionary *)registeredTables;
|
106
110
|
- (NSArray *)extensionsOrder;
|
111
|
+
- (NSDictionary *)extensionDependencies;
|
107
112
|
|
108
113
|
/**
|
109
114
|
* This method is only accessible from within the snapshotQueue.
|
@@ -182,13 +187,15 @@ extern NSString *const YapDatabaseNotificationKey;
|
|
182
187
|
|
183
188
|
sqlite3 *db;
|
184
189
|
|
185
|
-
dispatch_queue_t connectionQueue; //
|
186
|
-
void *IsOnConnectionQueueKey; //
|
190
|
+
dispatch_queue_t connectionQueue; // For YapDatabaseExtensionConnection subclasses
|
191
|
+
void *IsOnConnectionQueueKey; // For YapDatabaseExtensionConnection subclasses
|
187
192
|
|
188
193
|
NSArray *extensionsOrder; // Read-only by YapDatabaseTransaction
|
194
|
+
NSDictionary *extensionDependencies; // Read-only for YapDatabaseExtensionTransaction subclasses
|
189
195
|
|
190
196
|
BOOL hasDiskChanges;
|
191
197
|
|
198
|
+
YapCache *keyCache;
|
192
199
|
YapCache *objectCache;
|
193
200
|
YapCache *metadataCache;
|
194
201
|
|
@@ -204,6 +211,7 @@ extern NSString *const YapDatabaseNotificationKey;
|
|
204
211
|
NSMutableDictionary *metadataChanges;
|
205
212
|
NSMutableSet *removedKeys;
|
206
213
|
NSMutableSet *removedCollections;
|
214
|
+
NSMutableSet *removedRowids;
|
207
215
|
BOOL allKeysRemoved;
|
208
216
|
}
|
209
217
|
|
@@ -215,6 +223,7 @@ extern NSString *const YapDatabaseNotificationKey;
|
|
215
223
|
|
216
224
|
- (sqlite3_stmt *)yapGetDataForKeyStatement; // Against "yap" database, for internal use
|
217
225
|
- (sqlite3_stmt *)yapSetDataForKeyStatement; // Against "yap" database, for internal use
|
226
|
+
- (sqlite3_stmt *)yapRemoveForKeyStatement; // Against "yap" database, for internal use
|
218
227
|
- (sqlite3_stmt *)yapRemoveExtensionStatement; // Against "yap" database, for internal use
|
219
228
|
|
220
229
|
- (sqlite3_stmt *)getCollectionCountStatement;
|
@@ -223,15 +232,15 @@ extern NSString *const YapDatabaseNotificationKey;
|
|
223
232
|
- (sqlite3_stmt *)getCountForRowidStatement;
|
224
233
|
- (sqlite3_stmt *)getRowidForKeyStatement;
|
225
234
|
- (sqlite3_stmt *)getKeyForRowidStatement;
|
226
|
-
- (sqlite3_stmt *)getKeyDataForRowidStatement;
|
227
|
-
- (sqlite3_stmt *)getKeyMetadataForRowidStatement;
|
228
235
|
- (sqlite3_stmt *)getDataForRowidStatement;
|
236
|
+
- (sqlite3_stmt *)getMetadataForRowidStatement;
|
229
237
|
- (sqlite3_stmt *)getAllForRowidStatement;
|
230
238
|
- (sqlite3_stmt *)getDataForKeyStatement;
|
231
239
|
- (sqlite3_stmt *)getMetadataForKeyStatement;
|
232
240
|
- (sqlite3_stmt *)getAllForKeyStatement;
|
233
241
|
- (sqlite3_stmt *)insertForRowidStatement;
|
234
242
|
- (sqlite3_stmt *)updateAllForRowidStatement;
|
243
|
+
- (sqlite3_stmt *)updateObjectForRowidStatement;
|
235
244
|
- (sqlite3_stmt *)updateMetadataForRowidStatement;
|
236
245
|
- (sqlite3_stmt *)removeForRowidStatement;
|
237
246
|
- (sqlite3_stmt *)removeCollectionStatement;
|
@@ -330,33 +339,30 @@ extern NSString *const YapDatabaseNotificationKey;
|
|
330
339
|
- (NSData *)dataValueForKey:(NSString *)key extension:(NSString *)extensionName;
|
331
340
|
- (void)setDataValue:(NSData *)value forKey:(NSString *)key extension:(NSString *)extensionName;
|
332
341
|
|
342
|
+
- (void)removeValueForKey:(NSString *)key extension:(NSString *)extensionName;
|
333
343
|
- (void)removeAllValuesForExtension:(NSString *)extensionName;
|
334
344
|
|
335
345
|
- (NSException *)mutationDuringEnumerationException;
|
336
346
|
|
337
347
|
- (BOOL)getRowid:(int64_t *)rowidPtr forKey:(NSString *)key inCollection:(NSString *)collection;
|
338
348
|
|
339
|
-
- (
|
349
|
+
- (YapCollectionKey *)collectionKeyForRowid:(int64_t)rowid;
|
340
350
|
|
341
|
-
- (BOOL)
|
342
|
-
|
343
|
-
object:(id *)objectPtr
|
344
|
-
forRowid:(int64_t)rowid;
|
351
|
+
- (BOOL)getCollectionKey:(YapCollectionKey **)collectionKeyPtr object:(id *)objectPtr forRowid:(int64_t)rowid;
|
352
|
+
- (BOOL)getCollectionKey:(YapCollectionKey **)collectionKeyPtr metadata:(id *)metadataPtr forRowid:(int64_t)rowid;
|
345
353
|
|
346
|
-
- (BOOL)
|
347
|
-
|
348
|
-
|
349
|
-
|
354
|
+
- (BOOL)getCollectionKey:(YapCollectionKey **)collectionKeyPtr
|
355
|
+
object:(id *)objectPtr
|
356
|
+
metadata:(id *)metadataPtr
|
357
|
+
forRowid:(int64_t)rowid;
|
350
358
|
|
351
|
-
- (BOOL)
|
352
|
-
collection:(NSString **)collectionPtr
|
353
|
-
object:(id *)objectPtr
|
354
|
-
metadata:(id *)metadataPtr
|
355
|
-
forRowid:(int64_t)rowid;
|
356
|
-
|
357
|
-
- (BOOL)hasRowForRowid:(int64_t)rowid;
|
359
|
+
- (BOOL)hasRowid:(int64_t)rowid;
|
358
360
|
|
359
361
|
- (id)objectForKey:(NSString *)key inCollection:(NSString *)collection withRowid:(int64_t)rowid;
|
362
|
+
- (id)objectForCollectionKey:(YapCollectionKey *)cacheKey withRowid:(int64_t)rowid;
|
363
|
+
|
364
|
+
- (id)metadataForKey:(NSString *)key inCollection:(NSString *)collection withRowid:(int64_t)rowid;
|
365
|
+
- (id)metadataForCollectionKey:(YapCollectionKey *)cacheKey withRowid:(int64_t)rowid;
|
360
366
|
|
361
367
|
- (void)_enumerateKeysInCollection:(NSString *)collection
|
362
368
|
usingBlock:(void (^)(int64_t rowid, NSString *key, BOOL *stop))block;
|
@@ -422,3 +428,19 @@ extern NSString *const YapDatabaseNotificationKey;
|
|
422
428
|
withFilter:(BOOL (^)(int64_t rowid, NSString *collection, NSString *key))filter;
|
423
429
|
|
424
430
|
@end
|
431
|
+
|
432
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
433
|
+
#pragma mark -
|
434
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
435
|
+
|
436
|
+
@interface YapDatabaseReadWriteTransaction ()
|
437
|
+
|
438
|
+
- (void)replaceObject:(id)object forKey:(NSString *)key inCollection:(NSString *)collection withRowid:(int64_t)rowid;
|
439
|
+
- (void)replaceMetadata:(id)metadata
|
440
|
+
forKey:(NSString *)key
|
441
|
+
inCollection:(NSString *)collection
|
442
|
+
withRowid:(int64_t)rowid;
|
443
|
+
|
444
|
+
- (void)removeObjectForKey:(NSString *)key inCollection:(NSString *)collection withRowid:(int64_t)rowid;
|
445
|
+
|
446
|
+
@end
|