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
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
#import "YapDatabase.h"
|
|
2
|
-
#import "YapDatabaseConnection.h"
|
|
3
|
-
#import "YapDatabaseTransaction.h"
|
|
4
|
-
|
|
5
|
-
#import "YapDatabaseSecondaryIndex.h"
|
|
6
|
-
#import "YapDatabaseSecondaryIndexConnection.h"
|
|
7
|
-
#import "YapDatabaseSecondaryIndexTransaction.h"
|
|
8
|
-
|
|
9
|
-
#import "YapDatabaseSecondaryIndexSetup.h"
|
|
10
|
-
#import "YapCache.h"
|
|
11
|
-
|
|
12
|
-
#import "sqlite3.h"
|
|
13
|
-
|
|
14
|
-
@interface YapDatabaseSecondaryIndex () {
|
|
15
|
-
@public
|
|
16
|
-
|
|
17
|
-
YapDatabaseSecondaryIndexSetup *setup;
|
|
18
|
-
|
|
19
|
-
YapDatabaseSecondaryIndexBlock block;
|
|
20
|
-
YapDatabaseSecondaryIndexBlockType blockType;
|
|
21
|
-
|
|
22
|
-
int version;
|
|
23
|
-
|
|
24
|
-
id columnNamesSharedKeySet;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
- (NSString *)tableName;
|
|
28
|
-
|
|
29
|
-
@end
|
|
30
|
-
|
|
31
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
32
|
-
#pragma mark -
|
|
33
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
34
|
-
|
|
35
|
-
@interface YapDatabaseSecondaryIndexConnection () {
|
|
36
|
-
@public
|
|
37
|
-
|
|
38
|
-
__strong YapDatabaseSecondaryIndex *secondaryIndex;
|
|
39
|
-
__unsafe_unretained YapDatabaseConnection *databaseConnection;
|
|
40
|
-
|
|
41
|
-
NSMutableDictionary *blockDict;
|
|
42
|
-
|
|
43
|
-
YapCache *queryCache;
|
|
44
|
-
NSUInteger queryCacheLimit;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
- (id)initWithSecondaryIndex:(YapDatabaseSecondaryIndex *)secondaryIndex
|
|
48
|
-
databaseConnection:(YapDatabaseConnection *)databaseConnection;
|
|
49
|
-
|
|
50
|
-
- (sqlite3_stmt *)insertStatement;
|
|
51
|
-
- (sqlite3_stmt *)updateStatement;
|
|
52
|
-
- (sqlite3_stmt *)removeStatement;
|
|
53
|
-
- (sqlite3_stmt *)removeAllStatement;
|
|
54
|
-
|
|
55
|
-
@end
|
|
56
|
-
|
|
57
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
58
|
-
#pragma mark -
|
|
59
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
60
|
-
|
|
61
|
-
@interface YapDatabaseSecondaryIndexTransaction () {
|
|
62
|
-
@private
|
|
63
|
-
|
|
64
|
-
__unsafe_unretained YapDatabaseSecondaryIndexConnection *secondaryIndexConnection;
|
|
65
|
-
__unsafe_unretained YapDatabaseReadTransaction *databaseTransaction;
|
|
66
|
-
|
|
67
|
-
BOOL isMutated;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
- (id)initWithSecondaryIndexConnection:(YapDatabaseSecondaryIndexConnection *)secondaryIndexConnection
|
|
71
|
-
databaseTransaction:(YapDatabaseReadTransaction *)databaseTransaction;
|
|
72
|
-
|
|
73
|
-
@end
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
#import <Foundation/Foundation.h>
|
|
2
|
-
#import "sqlite3.h"
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Simple wrapper class to facilitate storing sqlite3_stmt items as objects (primarily in YapCache).
|
|
6
|
-
**/
|
|
7
|
-
@interface YapDatabaseStatement : NSObject
|
|
8
|
-
|
|
9
|
-
- (id)initWithStatement:(sqlite3_stmt *)stmt;
|
|
10
|
-
|
|
11
|
-
@property (nonatomic, assign, readonly) sqlite3_stmt *stmt;
|
|
12
|
-
|
|
13
|
-
@end
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* There are a LOT of conversions from NSString to char array.
|
|
3
|
-
* This happens in almost every method, where we bind text to prepared sqlite3 statements.
|
|
4
|
-
*
|
|
5
|
-
* It is inefficient to use [key UTF8String] for these situations.
|
|
6
|
-
* The Apple documentation is very explicit concerning the UTF8String method:
|
|
7
|
-
*
|
|
8
|
-
* > The returned C string is automatically freed just as a returned object would be released;
|
|
9
|
-
* > you should copy the C string if [you need] to store it outside of the
|
|
10
|
-
* > autorelease context in which the C string is created.
|
|
11
|
-
*
|
|
12
|
-
* In other words, the UTF8String method does a malloc for character buffer, copies the characters,
|
|
13
|
-
* and autoreleases the buffer (just like an autoreleased NSData instance).
|
|
14
|
-
*
|
|
15
|
-
* Thus we suffer a bunch of malloc's if we use UTF8String.
|
|
16
|
-
*
|
|
17
|
-
* Considering that almost all keys are likely to be relatively small,
|
|
18
|
-
* a much faster technique is to use the stack instead of the heap (with obvious precautions, see below).
|
|
19
|
-
*
|
|
20
|
-
* Note: This technique ONLY applies to key names and collection names.
|
|
21
|
-
* It does NOT apply to object/primitiveData or metadata. Those are binded to sqlite3 statements using binary blobs.
|
|
22
|
-
**/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* We must be cautious and conservative so as to avoid stack overflow.
|
|
27
|
-
* This is possibe if really huge key names or collection names are used.
|
|
28
|
-
*
|
|
29
|
-
* The number below represents the largest amount of memory (in bytes) that will be allocated on the stack per string.
|
|
30
|
-
**/
|
|
31
|
-
#define YapDatabaseStringMaxStackLength (1024 * 4)
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Struct designed to be allocated on the stack.
|
|
35
|
-
* You then use the inline functions below to "setup" and "teardown" the struct.
|
|
36
|
-
* For example:
|
|
37
|
-
*
|
|
38
|
-
* > YapDatabaseString myKeyChar;
|
|
39
|
-
* > MakeYapDatabaseString(&myKeyChar, myNSStringKey);
|
|
40
|
-
* > ...
|
|
41
|
-
* > sqlite3_bind_text(statement, position, myKeyChar.str, myKeyChar.length, SQLITE_STATIC);
|
|
42
|
-
* > ...
|
|
43
|
-
* > sqlite3_clear_bindings(statement);
|
|
44
|
-
* > sqlite3_reset(statement);
|
|
45
|
-
* > FreeYapDatabaseString(&myKeyChar);
|
|
46
|
-
*
|
|
47
|
-
* There are 2 "public" fields:
|
|
48
|
-
* str - Pointer to the char[] string.
|
|
49
|
-
* length - Represents the length (in bytes) of the char[] str (excluding the NULL termination byte, as usual).
|
|
50
|
-
*
|
|
51
|
-
* The other 2 "private" fields are for internal use:
|
|
52
|
-
* strStack - If the string doesn't exceed YapDatabaseStringMaxStackLength,
|
|
53
|
-
* then the bytes are copied here (onto stack storage), and str actually points to strStack.
|
|
54
|
-
* strHeap - If the string exceeds YapDatabaseStringMaxStackLength,
|
|
55
|
-
* the space is allocated on the heap, strHeap holds the pointer, and str has the same pointer.
|
|
56
|
-
*
|
|
57
|
-
* Thus the "setup" and "teardown" methods below will automatically switch to heap storage (just like UTF8String),
|
|
58
|
-
* if the key/collection name is too long, and performance will be equivalent.
|
|
59
|
-
* But in the common case of short key/collection names, we can skip the more expensive heap allocation/deallocation.
|
|
60
|
-
**/
|
|
61
|
-
struct YapDatabaseString {
|
|
62
|
-
int length;
|
|
63
|
-
char strStack[YapDatabaseStringMaxStackLength];
|
|
64
|
-
char *strHeap;
|
|
65
|
-
char *str; // Pointer to either strStack or strHeap
|
|
66
|
-
};
|
|
67
|
-
typedef struct YapDatabaseString YapDatabaseString;
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Initializes the YapDatabaseString structure.
|
|
71
|
-
* It will automatically use heap storage if the given NSString is too long.
|
|
72
|
-
*
|
|
73
|
-
* This method should always be balanced with a call to FreeYapDatabaseString.
|
|
74
|
-
**/
|
|
75
|
-
NS_INLINE void MakeYapDatabaseString(YapDatabaseString *dbStr, NSString *nsStr)
|
|
76
|
-
{
|
|
77
|
-
if (nsStr)
|
|
78
|
-
{
|
|
79
|
-
// We convert to int because the sqlite3_bind_text() function expects an int parameter.
|
|
80
|
-
// So we can change it to int here, or we can cast everywhere throughout the project.
|
|
81
|
-
|
|
82
|
-
dbStr->length = (int)[nsStr lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
|
|
83
|
-
|
|
84
|
-
if ((dbStr->length + 1) <= YapDatabaseStringMaxStackLength)
|
|
85
|
-
{
|
|
86
|
-
dbStr->strHeap = NULL;
|
|
87
|
-
dbStr->str = dbStr->strStack;
|
|
88
|
-
}
|
|
89
|
-
else
|
|
90
|
-
{
|
|
91
|
-
dbStr->strHeap = (char *)malloc((dbStr->length + 1));
|
|
92
|
-
dbStr->str = dbStr->strHeap;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
[nsStr getCString:dbStr->str maxLength:(dbStr->length + 1) encoding:NSUTF8StringEncoding];
|
|
96
|
-
}
|
|
97
|
-
else
|
|
98
|
-
{
|
|
99
|
-
dbStr->length = 0;
|
|
100
|
-
dbStr->strHeap = NULL;
|
|
101
|
-
dbStr->str = NULL;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* If heap storage was needed (because the string length exceeded YapDatabaseStringMaxStackLength),
|
|
107
|
-
* this method frees the heap allocated memory.
|
|
108
|
-
*
|
|
109
|
-
* In the common case of stack storage, strHeap will be NULL, and this method is essentially a no-op.
|
|
110
|
-
*
|
|
111
|
-
* This method should be invoked AFTER sqlite3_clear_bindings (assuming SQLITE_STATIC is used).
|
|
112
|
-
**/
|
|
113
|
-
NS_INLINE void FreeYapDatabaseString(YapDatabaseString *dbStr)
|
|
114
|
-
{
|
|
115
|
-
if (dbStr->strHeap)
|
|
116
|
-
{
|
|
117
|
-
free(dbStr->strHeap);
|
|
118
|
-
dbStr->strHeap = NULL;
|
|
119
|
-
dbStr->str = NULL;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
#import "YapDatabaseViewChange.h"
|
|
2
|
-
#import "YapDatabaseViewMappings.h"
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* This header file is PRIVATE, and is only to be used by the YapDatabaseView classes.
|
|
6
|
-
**/
|
|
7
|
-
|
|
8
|
-
@interface YapDatabaseViewSectionChange () {
|
|
9
|
-
@public
|
|
10
|
-
|
|
11
|
-
// This header file is PRIVATE, and is only to be used by YapDatabaseView classes
|
|
12
|
-
|
|
13
|
-
NSString *group; // immutable
|
|
14
|
-
BOOL isReset; // immutable
|
|
15
|
-
|
|
16
|
-
YapDatabaseViewChangeType type; // mutable during consolidation
|
|
17
|
-
|
|
18
|
-
NSUInteger originalSection; // mutable during pre-processing
|
|
19
|
-
NSUInteger finalSection; // mutable during pre-processing
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
+ (YapDatabaseViewSectionChange *)insertGroup:(NSString *)group;
|
|
23
|
-
+ (YapDatabaseViewSectionChange *)deleteGroup:(NSString *)group;
|
|
24
|
-
|
|
25
|
-
+ (YapDatabaseViewSectionChange *)resetGroup:(NSString *)group;
|
|
26
|
-
|
|
27
|
-
@end
|
|
28
|
-
|
|
29
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
30
|
-
#pragma mark -
|
|
31
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
32
|
-
|
|
33
|
-
@interface YapDatabaseViewRowChange () {
|
|
34
|
-
@public
|
|
35
|
-
|
|
36
|
-
// This header file is PRIVATE, and is only to be used by YapDatabaseView classes
|
|
37
|
-
|
|
38
|
-
id key; // immutable
|
|
39
|
-
|
|
40
|
-
NSString *originalGroup; // immutable
|
|
41
|
-
NSString *finalGroup; // mutable during consolidation
|
|
42
|
-
|
|
43
|
-
YapDatabaseViewChangeType type; // mutable during consolidation
|
|
44
|
-
int changes; // mutable during consolidation
|
|
45
|
-
|
|
46
|
-
NSUInteger opOriginalIndex; // immutable
|
|
47
|
-
NSUInteger opFinalIndex; // immutable
|
|
48
|
-
|
|
49
|
-
NSUInteger originalIndex; // mutable during processing
|
|
50
|
-
NSUInteger finalIndex; // mutable during processing
|
|
51
|
-
|
|
52
|
-
NSUInteger originalSection; // mutable during pre-processing
|
|
53
|
-
NSUInteger finalSection; // mutable during pre-processing
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* During a transaction, there are only 3 row change types that may be recorded.
|
|
58
|
-
*
|
|
59
|
-
* Post-processing figures out everything else, such as if an item was moved,
|
|
60
|
-
* or if multiple operations can be consolidated into one.
|
|
61
|
-
**/
|
|
62
|
-
|
|
63
|
-
+ (YapDatabaseViewRowChange *)insertKey:(id)key inGroup:(NSString *)group atIndex:(NSUInteger)index;
|
|
64
|
-
+ (YapDatabaseViewRowChange *)deleteKey:(id)key inGroup:(NSString *)group atIndex:(NSUInteger)index;
|
|
65
|
-
|
|
66
|
-
+ (YapDatabaseViewRowChange *)updateKey:(id)key changes:(int)flags inGroup:(NSString *)group atIndex:(NSUInteger)index;
|
|
67
|
-
|
|
68
|
-
@end
|
|
69
|
-
|
|
70
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
71
|
-
#pragma mark -
|
|
72
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
73
|
-
|
|
74
|
-
@interface YapDatabaseViewChange : NSObject
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* The brains behind the post-processing logic.
|
|
78
|
-
* Exposed privately to be used by the unit tests.
|
|
79
|
-
**/
|
|
80
|
-
+ (void)processRowChanges:(NSMutableArray *)changes;
|
|
81
|
-
+ (void)consolidateRowChanges:(NSMutableArray *)changes;
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* This method applies the given mappings, and then invokes the post-processing method.
|
|
85
|
-
*
|
|
86
|
-
* This method is ONLY to be used by YapDatabaseViewConnection.
|
|
87
|
-
**/
|
|
88
|
-
+ (void)getSectionChanges:(NSArray **)sectionChangesPtr
|
|
89
|
-
rowChanges:(NSArray **)rowChangesPtr
|
|
90
|
-
withOriginalMappings:(YapDatabaseViewMappings *)originalMappings
|
|
91
|
-
finalMappings:(YapDatabaseViewMappings *)finalMappings
|
|
92
|
-
fromChanges:(NSArray *)changes;
|
|
93
|
-
|
|
94
|
-
@end
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
#import "YapDatabaseViewMappings.h"
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* This header file is PRIVATE, and is only to be used by the YapDatabaseView classes.
|
|
5
|
-
**/
|
|
6
|
-
|
|
7
|
-
@interface YapDatabaseViewMappings ()
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* For UNIT TESTING only.
|
|
11
|
-
**/
|
|
12
|
-
- (void)updateWithCounts:(NSDictionary *)counts;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Returns a mutable copy of the count dictionary, where:
|
|
16
|
-
* key = group
|
|
17
|
-
* value = NSNumber of count of items
|
|
18
|
-
**/
|
|
19
|
-
- (NSMutableDictionary *)counts;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* fullCountForGroup => Count from view.group (excluding rangeOptions)
|
|
23
|
-
* visibleCountForGroup => Subset count (including rangeOptions)
|
|
24
|
-
**/
|
|
25
|
-
- (NSUInteger)fullCountForGroup:(NSString *)group;
|
|
26
|
-
- (NSUInteger)visibleCountForGroup:(NSString *)group;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Returns a copy of the rangeOptions dictionary, where:
|
|
30
|
-
* key = group
|
|
31
|
-
* value = YapDatabaseViewMappingsRangeOptions
|
|
32
|
-
**/
|
|
33
|
-
- (NSDictionary *)rangeOptions;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* This method is used by YapDatabaseViewChange.
|
|
37
|
-
*
|
|
38
|
-
* After processing changeset(s), the length and/or offset may change.
|
|
39
|
-
* The new length and/or offsets are properly calculated,
|
|
40
|
-
* and then this method is used to avoid duplicating the calculations.
|
|
41
|
-
*
|
|
42
|
-
* Note: After invoking this method, be sure to invoke updateVisibility (after all groups have been updated).
|
|
43
|
-
**/
|
|
44
|
-
- (void)updateRangeOptionsForGroup:(NSString *)group
|
|
45
|
-
withNewLength:(NSUInteger)newLength
|
|
46
|
-
newOffset:(NSUInteger)newOffset;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Normally this method is called automatically.
|
|
50
|
-
* But needs to be called manually if you use updateRangeOptionsForGroup:withNewLength:newOffset:
|
|
51
|
-
**/
|
|
52
|
-
- (void)updateVisibility;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Returns a copy of the dependencies dictionary, where:
|
|
56
|
-
* key = group
|
|
57
|
-
* value = NSSet of cellDrawingDependency offsets
|
|
58
|
-
**/
|
|
59
|
-
- (NSDictionary *)dependencies;
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Returns a copy of the reverse set, which contains groups that are to be reversed.
|
|
63
|
-
**/
|
|
64
|
-
- (NSSet *)reverse;
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* During processing we need to disable the the isUsingConsolidatedGroup flag
|
|
68
|
-
* in order to access the raw mappings.
|
|
69
|
-
**/
|
|
70
|
-
- (void)setAutoConsolidatingDisabled:(BOOL)disabled;
|
|
71
|
-
|
|
72
|
-
@end
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
#import <Foundation/Foundation.h>
|
|
2
|
-
|
|
3
|
-
@interface YapDatabaseViewPage : NSObject <NSCopying>
|
|
4
|
-
|
|
5
|
-
- (id)init;
|
|
6
|
-
- (id)initWithCapacity:(NSUInteger)capacity;
|
|
7
|
-
|
|
8
|
-
- (NSData *)serialize;
|
|
9
|
-
- (void)deserialize:(NSData *)data;
|
|
10
|
-
|
|
11
|
-
- (NSUInteger)count;
|
|
12
|
-
|
|
13
|
-
- (int64_t)rowidAtIndex:(NSUInteger)index;
|
|
14
|
-
|
|
15
|
-
- (void)addRowid:(int64_t)rowid;
|
|
16
|
-
- (void)insertRowid:(int64_t)rowid atIndex:(NSUInteger)index;
|
|
17
|
-
|
|
18
|
-
- (void)removeRowidAtIndex:(NSUInteger)index;
|
|
19
|
-
|
|
20
|
-
- (void)removeRange:(NSRange)range;
|
|
21
|
-
|
|
22
|
-
- (void)appendRange:(NSRange)range ofPage:(YapDatabaseViewPage *)page;
|
|
23
|
-
- (void)prependRange:(NSRange)range ofPage:(YapDatabaseViewPage *)page;
|
|
24
|
-
|
|
25
|
-
- (BOOL)getIndex:(NSUInteger *)indexPtr ofRowid:(int64_t)rowid;
|
|
26
|
-
|
|
27
|
-
- (void)enumerateRowidsUsingBlock:(void (^)(int64_t rowid, NSUInteger idx, BOOL *stop))block;
|
|
28
|
-
|
|
29
|
-
- (void)enumerateRowidsWithOptions:(NSEnumerationOptions)options
|
|
30
|
-
usingBlock:(void (^)(int64_t rowid, NSUInteger index, BOOL *stop))block;
|
|
31
|
-
|
|
32
|
-
- (void)enumerateRowidsWithOptions:(NSEnumerationOptions)options
|
|
33
|
-
range:(NSRange)range
|
|
34
|
-
usingBlock:(void (^)(int64_t rowid, NSUInteger index, BOOL *stop))block;
|
|
35
|
-
|
|
36
|
-
@end
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
#import <Foundation/Foundation.h>
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* This class stores the metadata about each "page" in the view.
|
|
5
|
-
*
|
|
6
|
-
* That is, a "page" is a subset of the array of rowids in a group.
|
|
7
|
-
* The metadata does the following:
|
|
8
|
-
*
|
|
9
|
-
* - stores the associated group
|
|
10
|
-
* - keeps the pages ordered (via prevPageKey).
|
|
11
|
-
* - keeps the count on hand to make it easier to find a particular index
|
|
12
|
-
*
|
|
13
|
-
* This class is designed only to store the metadata in RAM.
|
|
14
|
-
* When the metadata is stored to disk, the individual ivars have an associated column.
|
|
15
|
-
**/
|
|
16
|
-
@interface YapDatabaseViewPageMetadata : NSObject <NSCopying> {
|
|
17
|
-
@public
|
|
18
|
-
|
|
19
|
-
NSString * pageKey;
|
|
20
|
-
NSString * prevPageKey;
|
|
21
|
-
NSString * group;
|
|
22
|
-
NSUInteger count;
|
|
23
|
-
|
|
24
|
-
BOOL isNew; // Is NOT copied. Relevant only to connection.
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
@end
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
#import <Foundation/Foundation.h>
|
|
2
|
-
|
|
3
|
-
#import "YapDatabase.h"
|
|
4
|
-
#import "YapDatabaseConnection.h"
|
|
5
|
-
#import "YapDatabaseTransaction.h"
|
|
6
|
-
|
|
7
|
-
#import "YapDatabaseView.h"
|
|
8
|
-
#import "YapDatabaseViewOptions.h"
|
|
9
|
-
#import "YapDatabaseViewConnection.h"
|
|
10
|
-
#import "YapDatabaseViewTransaction.h"
|
|
11
|
-
|
|
12
|
-
#import "YapMemoryTable.h"
|
|
13
|
-
|
|
14
|
-
#import "sqlite3.h"
|
|
15
|
-
|
|
16
|
-
@class YapCache;
|
|
17
|
-
@class YapCollectionKey;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* This version number is stored in the yap2 table.
|
|
21
|
-
* If there is a major re-write to this class, then the version number will be incremented,
|
|
22
|
-
* and the class can automatically rebuild the tables as needed.
|
|
23
|
-
**/
|
|
24
|
-
#define YAP_DATABASE_VIEW_CLASS_VERSION 3
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
@interface YapDatabaseView () {
|
|
28
|
-
@public
|
|
29
|
-
YapDatabaseViewGroupingBlock groupingBlock;
|
|
30
|
-
YapDatabaseViewSortingBlock sortingBlock;
|
|
31
|
-
|
|
32
|
-
YapDatabaseViewBlockType groupingBlockType;
|
|
33
|
-
YapDatabaseViewBlockType sortingBlockType;
|
|
34
|
-
|
|
35
|
-
int version;
|
|
36
|
-
|
|
37
|
-
YapDatabaseViewOptions *options;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
- (NSString *)mapTableName;
|
|
41
|
-
- (NSString *)pageTableName;
|
|
42
|
-
- (NSString *)pageMetadataTableName;
|
|
43
|
-
|
|
44
|
-
@end
|
|
45
|
-
|
|
46
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
47
|
-
#pragma mark -
|
|
48
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
49
|
-
|
|
50
|
-
@interface YapDatabaseViewConnection () {
|
|
51
|
-
@public
|
|
52
|
-
|
|
53
|
-
__strong YapDatabaseView *view;
|
|
54
|
-
__unsafe_unretained YapDatabaseConnection *databaseConnection;
|
|
55
|
-
|
|
56
|
-
NSMutableDictionary *group_pagesMetadata_dict; // group -> @[ YapDatabaseViewPageMetadata, ... ]
|
|
57
|
-
NSMutableDictionary *pageKey_group_dict; // pageKey -> group
|
|
58
|
-
|
|
59
|
-
YapCache *mapCache;
|
|
60
|
-
YapCache *pageCache;
|
|
61
|
-
|
|
62
|
-
NSMutableDictionary *dirtyMaps;
|
|
63
|
-
NSMutableDictionary *dirtyPages;
|
|
64
|
-
NSMutableDictionary *dirtyLinks;
|
|
65
|
-
BOOL reset;
|
|
66
|
-
|
|
67
|
-
BOOL lastInsertWasAtFirstIndex;
|
|
68
|
-
BOOL lastInsertWasAtLastIndex;
|
|
69
|
-
|
|
70
|
-
NSMutableArray *changes;
|
|
71
|
-
NSMutableSet *mutatedGroups;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
- (id)initWithView:(YapDatabaseView *)view databaseConnection:(YapDatabaseConnection *)dbc;
|
|
75
|
-
|
|
76
|
-
- (void)prepareForReadWriteTransaction;
|
|
77
|
-
- (void)postRollbackCleanup;
|
|
78
|
-
- (void)postCommitCleanup;
|
|
79
|
-
|
|
80
|
-
- (sqlite3_stmt *)mapTable_getPageKeyForRowidStatement;
|
|
81
|
-
- (sqlite3_stmt *)mapTable_setPageKeyForRowidStatement;
|
|
82
|
-
- (sqlite3_stmt *)mapTable_removeForRowidStatement;
|
|
83
|
-
- (sqlite3_stmt *)mapTable_removeAllStatement;
|
|
84
|
-
|
|
85
|
-
- (sqlite3_stmt *)pageTable_getDataForPageKeyStatement;
|
|
86
|
-
- (sqlite3_stmt *)pageTable_insertForPageKeyStatement;
|
|
87
|
-
- (sqlite3_stmt *)pageTable_updateAllForPageKeyStatement;
|
|
88
|
-
- (sqlite3_stmt *)pageTable_updatePageForPageKeyStatement;
|
|
89
|
-
- (sqlite3_stmt *)pageTable_updateLinkForPageKeyStatement;
|
|
90
|
-
- (sqlite3_stmt *)pageTable_removeForPageKeyStatement;
|
|
91
|
-
- (sqlite3_stmt *)pageTable_removeAllStatement;
|
|
92
|
-
|
|
93
|
-
@end
|
|
94
|
-
|
|
95
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
96
|
-
#pragma mark -
|
|
97
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
98
|
-
|
|
99
|
-
@interface YapDatabaseViewTransaction () {
|
|
100
|
-
@private
|
|
101
|
-
|
|
102
|
-
YapMemoryTableTransaction *mapTableTransaction;
|
|
103
|
-
YapMemoryTableTransaction *pageTableTransaction;
|
|
104
|
-
YapMemoryTableTransaction *pageMetadataTableTransaction;
|
|
105
|
-
|
|
106
|
-
@protected
|
|
107
|
-
|
|
108
|
-
__unsafe_unretained YapDatabaseViewConnection *viewConnection;
|
|
109
|
-
__unsafe_unretained YapDatabaseReadTransaction *databaseTransaction;
|
|
110
|
-
|
|
111
|
-
NSString *lastHandledGroup;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
- (id)initWithViewConnection:(YapDatabaseViewConnection *)viewConnection
|
|
115
|
-
databaseTransaction:(YapDatabaseReadTransaction *)databaseTransaction;
|
|
116
|
-
|
|
117
|
-
// The following are declared for view subclasses (such as YapDatabaseFilteredView)
|
|
118
|
-
|
|
119
|
-
- (BOOL)createTables;
|
|
120
|
-
|
|
121
|
-
- (NSString *)registeredName;
|
|
122
|
-
- (BOOL)isPersistentView;
|
|
123
|
-
|
|
124
|
-
- (NSString *)pageKeyForRowid:(int64_t)rowid;
|
|
125
|
-
- (NSUInteger)indexForRowid:(int64_t)rowid inGroup:(NSString *)group withPageKey:(NSString *)pageKey;
|
|
126
|
-
- (BOOL)getRowid:(int64_t *)rowidPtr atIndex:(NSUInteger)index inGroup:(NSString *)group;
|
|
127
|
-
|
|
128
|
-
- (void)insertRowid:(int64_t)rowid collectionKey:(YapCollectionKey *)collectionKey inNewGroup:(NSString *)group;
|
|
129
|
-
- (void)insertRowid:(int64_t)rowid collectionKey:(YapCollectionKey *)collectionKey
|
|
130
|
-
inGroup:(NSString *)group
|
|
131
|
-
atIndex:(NSUInteger)index
|
|
132
|
-
withExistingPageKey:(NSString *)existingPageKey;
|
|
133
|
-
|
|
134
|
-
- (void)insertRowid:(int64_t)rowid
|
|
135
|
-
collectionKey:(YapCollectionKey *)collectionKey
|
|
136
|
-
object:(id)object
|
|
137
|
-
metadata:(id)metadata
|
|
138
|
-
inGroup:(NSString *)group
|
|
139
|
-
withChanges:(int)flags
|
|
140
|
-
isNew:(BOOL)isGuaranteedNew;
|
|
141
|
-
|
|
142
|
-
- (void)removeRowid:(int64_t)rowid
|
|
143
|
-
collectionKey:(YapCollectionKey *)collectionKey
|
|
144
|
-
atIndex:(NSUInteger)index
|
|
145
|
-
inGroup:(NSString *)group;
|
|
146
|
-
|
|
147
|
-
- (void)removeRowid:(int64_t)rowid collectionKey:(YapCollectionKey *)collectionKey;
|
|
148
|
-
- (void)removeAllRowids;
|
|
149
|
-
|
|
150
|
-
- (void)enumerateRowidsInGroup:(NSString *)group
|
|
151
|
-
usingBlock:(void (^)(int64_t rowid, NSUInteger index, BOOL *stop))block;
|
|
152
|
-
|
|
153
|
-
@end
|