motion-yapper 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +20 -0
- data/.travis.yml +6 -0
- data/Gemfile +5 -0
- data/Gemfile.lock +63 -0
- data/README.md +16 -0
- data/Rakefile +20 -0
- data/app/app_delegate.rb +5 -0
- data/lib/yapper.rb +30 -0
- data/lib/yapper/attachment.rb +48 -0
- data/lib/yapper/bson.rb +20 -0
- data/lib/yapper/config.rb +18 -0
- data/lib/yapper/db.rb +151 -0
- data/lib/yapper/document.rb +54 -0
- data/lib/yapper/document/attachment.rb +26 -0
- data/lib/yapper/document/callbacks.rb +86 -0
- data/lib/yapper/document/persistance.rb +171 -0
- data/lib/yapper/document/relation.rb +84 -0
- data/lib/yapper/document/selection.rb +100 -0
- data/lib/yapper/extensions.rb +80 -0
- data/lib/yapper/log.rb +5 -0
- data/lib/yapper/sync.rb +134 -0
- data/lib/yapper/sync/data.rb +12 -0
- data/lib/yapper/sync/event.rb +194 -0
- data/lib/yapper/sync/queue.rb +164 -0
- data/lib/yapper/timestamps.rb +16 -0
- data/lib/yapper/version.rb +3 -0
- data/lib/yapper/yapper.rb +2 -0
- data/spec/helpers/time_helper.rb +3 -0
- data/spec/integration/all_spec.rb +40 -0
- data/spec/integration/callback_spec.rb +87 -0
- data/spec/integration/db_spec.rb +40 -0
- data/spec/integration/find_spec.rb +51 -0
- data/spec/integration/persistance_spec.rb +118 -0
- data/spec/integration/relation_spec.rb +174 -0
- data/spec/integration/sync_spec.rb +42 -0
- data/spec/integration/timestamps_spec.rb +34 -0
- data/spec/integration/types_spec.rb +23 -0
- data/spec/integration/when_spec.rb +29 -0
- data/spec/integration/where_spec.rb +132 -0
- data/vendor/Podfile.lock +24 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPClient.h +641 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPClient.m +1396 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.h +133 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.m +327 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFImageRequestOperation.h +113 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFImageRequestOperation.m +321 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFJSONRequestOperation.h +71 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFJSONRequestOperation.m +150 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFNetworkActivityIndicatorManager.h +75 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFNetworkActivityIndicatorManager.m +157 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFNetworking.h +43 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFPropertyListRequestOperation.h +68 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFPropertyListRequestOperation.m +143 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.h +370 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.m +848 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFXMLRequestOperation.h +89 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFXMLRequestOperation.m +167 -0
- data/vendor/Pods/AFNetworking/AFNetworking/UIImageView+AFNetworking.h +78 -0
- data/vendor/Pods/AFNetworking/AFNetworking/UIImageView+AFNetworking.m +191 -0
- data/vendor/Pods/AFNetworking/LICENSE +19 -0
- data/vendor/Pods/AFNetworking/README.md +208 -0
- data/vendor/Pods/BuildHeaders/AFNetworking/AFHTTPClient.h +641 -0
- data/vendor/Pods/BuildHeaders/AFNetworking/AFHTTPRequestOperation.h +133 -0
- data/vendor/Pods/BuildHeaders/AFNetworking/AFImageRequestOperation.h +113 -0
- data/vendor/Pods/BuildHeaders/AFNetworking/AFJSONRequestOperation.h +71 -0
- data/vendor/Pods/BuildHeaders/AFNetworking/AFNetworkActivityIndicatorManager.h +75 -0
- data/vendor/Pods/BuildHeaders/AFNetworking/AFNetworking.h +43 -0
- data/vendor/Pods/BuildHeaders/AFNetworking/AFPropertyListRequestOperation.h +68 -0
- data/vendor/Pods/BuildHeaders/AFNetworking/AFURLConnectionOperation.h +370 -0
- data/vendor/Pods/BuildHeaders/AFNetworking/AFXMLRequestOperation.h +89 -0
- data/vendor/Pods/BuildHeaders/AFNetworking/UIImageView+AFNetworking.h +78 -0
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/ContextFilterLogFormatter.h +65 -0
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDASLLogger.h +41 -0
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDAbstractDatabaseLogger.h +102 -0
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDFileLogger.h +334 -0
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDLog.h +601 -0
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDTTYLogger.h +167 -0
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DispatchQueueLogFormatter.h +116 -0
- data/vendor/Pods/BuildHeaders/NSData+MD5Digest/NSData+MD5Digest.h +18 -0
- data/vendor/Pods/BuildHeaders/Reachability/Reachability.h +109 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapCache.h +90 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapCollectionKey.h +20 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabase.h +547 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseConnection.h +447 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseConnectionState.h +29 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseDefaults.h +37 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseExtension.h +15 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseExtensionConnection.h +11 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseExtensionPrivate.h +440 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseExtensionTransaction.h +11 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredView.h +108 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewConnection.h +12 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewPrivate.h +19 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewTransaction.h +39 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearch.h +89 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearchConnection.h +32 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearchPrivate.h +69 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearchSnippetOptions.h +79 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearchTransaction.h +68 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseLogging.h +158 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseManager.h +17 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabasePrivate.h +424 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseQuery.h +42 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndex.h +100 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexConnection.h +33 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexPrivate.h +73 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexSetup.h +33 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexTransaction.h +58 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseStatement.h +13 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseString.h +121 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseTransaction.h +541 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseView.h +186 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewChange.h +272 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewChangePrivate.h +94 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewConnection.h +115 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewMappings.h +825 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewMappingsPrivate.h +72 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewOptions.h +56 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewPage.h +36 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewPageMetadata.h +27 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewPrivate.h +153 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewRangeOptions.h +330 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewRangeOptionsPrivate.h +17 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewTransaction.h +447 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapMemoryTable.h +74 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapNull.h +17 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapSet.h +41 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapTouch.h +15 -0
- data/vendor/Pods/CocoaLumberjack/LICENSE.txt +18 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDASLLogger.h +41 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDASLLogger.m +99 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDAbstractDatabaseLogger.h +102 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDAbstractDatabaseLogger.m +727 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDFileLogger.h +334 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDFileLogger.m +1353 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog.h +601 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog.m +1083 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDTTYLogger.h +167 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDTTYLogger.m +1479 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/ContextFilterLogFormatter.h +65 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/ContextFilterLogFormatter.m +191 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DispatchQueueLogFormatter.h +116 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DispatchQueueLogFormatter.m +251 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/README.txt +7 -0
- data/vendor/Pods/CocoaLumberjack/README.markdown +37 -0
- data/vendor/Pods/Headers/AFNetworking/AFHTTPClient.h +641 -0
- data/vendor/Pods/Headers/AFNetworking/AFHTTPRequestOperation.h +133 -0
- data/vendor/Pods/Headers/AFNetworking/AFImageRequestOperation.h +113 -0
- data/vendor/Pods/Headers/AFNetworking/AFJSONRequestOperation.h +71 -0
- data/vendor/Pods/Headers/AFNetworking/AFNetworkActivityIndicatorManager.h +75 -0
- data/vendor/Pods/Headers/AFNetworking/AFNetworking.h +43 -0
- data/vendor/Pods/Headers/AFNetworking/AFPropertyListRequestOperation.h +68 -0
- data/vendor/Pods/Headers/AFNetworking/AFURLConnectionOperation.h +370 -0
- data/vendor/Pods/Headers/AFNetworking/AFXMLRequestOperation.h +89 -0
- data/vendor/Pods/Headers/AFNetworking/UIImageView+AFNetworking.h +78 -0
- data/vendor/Pods/Headers/CocoaLumberjack/ContextFilterLogFormatter.h +65 -0
- data/vendor/Pods/Headers/CocoaLumberjack/DDASLLogger.h +41 -0
- data/vendor/Pods/Headers/CocoaLumberjack/DDAbstractDatabaseLogger.h +102 -0
- data/vendor/Pods/Headers/CocoaLumberjack/DDFileLogger.h +334 -0
- data/vendor/Pods/Headers/CocoaLumberjack/DDLog.h +601 -0
- data/vendor/Pods/Headers/CocoaLumberjack/DDTTYLogger.h +167 -0
- data/vendor/Pods/Headers/CocoaLumberjack/DispatchQueueLogFormatter.h +116 -0
- data/vendor/Pods/Headers/NSData+MD5Digest/NSData+MD5Digest.h +18 -0
- data/vendor/Pods/Headers/Reachability/Reachability.h +109 -0
- data/vendor/Pods/Headers/YapDatabase/YapCache.h +90 -0
- data/vendor/Pods/Headers/YapDatabase/YapCollectionKey.h +20 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabase.h +547 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseConnection.h +447 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseConnectionState.h +29 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseDefaults.h +37 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseExtension.h +15 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseExtensionConnection.h +11 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseExtensionPrivate.h +440 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseExtensionTransaction.h +11 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredView.h +108 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewConnection.h +12 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewPrivate.h +19 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewTransaction.h +39 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearch.h +89 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearchConnection.h +32 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearchPrivate.h +69 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearchSnippetOptions.h +79 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearchTransaction.h +68 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseLogging.h +158 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseManager.h +17 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabasePrivate.h +424 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseQuery.h +42 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndex.h +100 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndexConnection.h +33 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndexPrivate.h +73 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndexSetup.h +33 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndexTransaction.h +58 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseStatement.h +13 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseString.h +121 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseTransaction.h +541 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseView.h +186 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewChange.h +272 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewChangePrivate.h +94 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewConnection.h +115 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewMappings.h +825 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewMappingsPrivate.h +72 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewOptions.h +56 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewPage.h +36 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewPageMetadata.h +27 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewPrivate.h +153 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewRangeOptions.h +330 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewRangeOptionsPrivate.h +17 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewTransaction.h +447 -0
- data/vendor/Pods/Headers/YapDatabase/YapMemoryTable.h +74 -0
- data/vendor/Pods/Headers/YapDatabase/YapNull.h +17 -0
- data/vendor/Pods/Headers/YapDatabase/YapSet.h +41 -0
- data/vendor/Pods/Headers/YapDatabase/YapTouch.h +15 -0
- data/vendor/Pods/Headers/____Pods-AFNetworking-prefix.h +17 -0
- data/vendor/Pods/Headers/____Pods-CocoaLumberjack-prefix.h +5 -0
- data/vendor/Pods/Headers/____Pods-NSData+MD5Digest-prefix.h +5 -0
- data/vendor/Pods/Headers/____Pods-Reachability-prefix.h +5 -0
- data/vendor/Pods/Headers/____Pods-YapDatabase-prefix.h +5 -0
- data/vendor/Pods/Headers/____Pods-environment.h +38 -0
- data/vendor/Pods/Manifest.lock +24 -0
- data/vendor/Pods/NSData+MD5Digest/NSData+MD5Digest/NSData+MD5Digest.h +18 -0
- data/vendor/Pods/NSData+MD5Digest/NSData+MD5Digest/NSData+MD5Digest.m +39 -0
- data/vendor/Pods/NSData+MD5Digest/README.md +11 -0
- data/vendor/Pods/Pods-AFNetworking-Private.xcconfig +5 -0
- data/vendor/Pods/Pods-AFNetworking-dummy.m +5 -0
- data/vendor/Pods/Pods-AFNetworking-prefix.pch +17 -0
- data/vendor/Pods/Pods-AFNetworking.xcconfig +1 -0
- data/vendor/Pods/Pods-Acknowledgements.markdown +96 -0
- data/vendor/Pods/Pods-Acknowledgements.plist +142 -0
- data/vendor/Pods/Pods-CocoaLumberjack-Private.xcconfig +5 -0
- data/vendor/Pods/Pods-CocoaLumberjack-dummy.m +5 -0
- data/vendor/Pods/Pods-CocoaLumberjack-prefix.pch +5 -0
- data/vendor/Pods/Pods-CocoaLumberjack.xcconfig +0 -0
- data/vendor/Pods/Pods-NSData+MD5Digest-Private.xcconfig +5 -0
- data/vendor/Pods/Pods-NSData+MD5Digest-dummy.m +5 -0
- data/vendor/Pods/Pods-NSData+MD5Digest-prefix.pch +5 -0
- data/vendor/Pods/Pods-NSData+MD5Digest.xcconfig +0 -0
- data/vendor/Pods/Pods-Reachability-Private.xcconfig +5 -0
- data/vendor/Pods/Pods-Reachability-dummy.m +5 -0
- data/vendor/Pods/Pods-Reachability-prefix.pch +5 -0
- data/vendor/Pods/Pods-Reachability.xcconfig +1 -0
- data/vendor/Pods/Pods-YapDatabase-Private.xcconfig +5 -0
- data/vendor/Pods/Pods-YapDatabase-dummy.m +5 -0
- data/vendor/Pods/Pods-YapDatabase-prefix.pch +5 -0
- data/vendor/Pods/Pods-YapDatabase.xcconfig +1 -0
- data/vendor/Pods/Pods-dummy.m +5 -0
- data/vendor/Pods/Pods-environment.h +38 -0
- data/vendor/Pods/Pods-resources.sh +68 -0
- data/vendor/Pods/Pods.bridgesupport +5096 -0
- data/vendor/Pods/Pods.xcconfig +5 -0
- data/vendor/Pods/Pods.xcodeproj/project.pbxproj +5536 -0
- data/vendor/Pods/Reachability/LICENCE.txt +24 -0
- data/vendor/Pods/Reachability/README.md +65 -0
- data/vendor/Pods/Reachability/Reachability.h +109 -0
- data/vendor/Pods/Reachability/Reachability.m +527 -0
- data/vendor/Pods/YapDatabase/LICENSE.txt +18 -0
- data/vendor/Pods/YapDatabase/README.md +30 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/Internal/YapDatabaseFilteredViewPrivate.h +19 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredView.h +108 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredView.m +175 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewConnection.h +12 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewConnection.m +41 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewTransaction.h +39 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewTransaction.m +966 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/Internal/YapDatabaseFullTextSearchPrivate.h +69 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearch.h +89 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearch.m +146 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchConnection.h +32 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchConnection.m +298 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchSnippetOptions.h +79 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchSnippetOptions.m +95 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchTransaction.h +68 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchTransaction.m +1352 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/Internal/YapDatabaseExtensionPrivate.h +440 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtension.h +15 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtension.m +58 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionConnection.h +11 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionConnection.m +46 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionTransaction.h +11 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionTransaction.m +180 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/Internal/YapDatabaseSecondaryIndexPrivate.h +73 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndex.h +100 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndex.m +149 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexConnection.h +33 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexConnection.m +330 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexSetup.h +33 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexSetup.m +184 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexTransaction.h +58 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexTransaction.m +1166 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewChangePrivate.h +94 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewMappingsPrivate.h +72 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPage.h +36 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPage.mm +296 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPageMetadata.h +27 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPageMetadata.m +28 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPrivate.h +153 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewRangeOptionsPrivate.h +17 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewChange.h +272 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewChange.m +2494 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewMappings.h +825 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewMappings.m +1567 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewRangeOptions.h +330 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewRangeOptions.m +141 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseView.h +186 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseView.m +191 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewConnection.h +115 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewConnection.m +897 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewOptions.h +56 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewOptions.m +27 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTransaction.h +447 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTransaction.m +4505 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapCache.h +90 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapCache.m +453 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseConnectionState.h +29 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseConnectionState.m +48 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseDefaults.h +37 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseDefaults.m +83 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseLogging.h +158 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseLogging.m +73 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseManager.h +17 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseManager.m +56 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabasePrivate.h +424 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseStatement.h +13 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseStatement.m +26 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseString.h +121 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapMemoryTable.h +74 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapMemoryTable.m +603 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapNull.h +17 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapNull.m +31 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapTouch.h +15 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapTouch.m +31 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapCollectionKey.h +20 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapCollectionKey.m +194 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapDatabaseQuery.h +42 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapDatabaseQuery.m +96 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapSet.h +41 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapSet.m +82 -0
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabase.h +547 -0
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabase.m +2022 -0
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseConnection.h +447 -0
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseConnection.m +3874 -0
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseTransaction.h +541 -0
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseTransaction.m +5282 -0
- data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.bridgesupport +16 -0
- data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.h +13 -0
- data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.m +20 -0
- data/yapper.gemspec +24 -0
- metadata +458 -0
@@ -0,0 +1,108 @@
|
|
1
|
+
#import <Foundation/Foundation.h>
|
2
|
+
|
3
|
+
#import "YapDatabaseView.h"
|
4
|
+
#import "YapDatabaseFilteredViewConnection.h"
|
5
|
+
#import "YapDatabaseFilteredViewTransaction.h"
|
6
|
+
|
7
|
+
|
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
|
+
@interface YapDatabaseFilteredView : YapDatabaseView
|
25
|
+
|
26
|
+
/**
|
27
|
+
* @param parentViewName
|
28
|
+
*
|
29
|
+
* The parentViewName must be the registered name of a YapDatabaseView or
|
30
|
+
* YapDatabaseFilteredView extension.
|
31
|
+
* That is, you must first register the parentView, and then use that registered name here.
|
32
|
+
*
|
33
|
+
* @param filteringBlock
|
34
|
+
*
|
35
|
+
* The filteringBlock type is one of the following typedefs:
|
36
|
+
* - YapDatabaseViewFilteringWithKeyBlock
|
37
|
+
* - YapDatabaseViewFilteringWithObjectBlock
|
38
|
+
* - YapDatabaseViewFilteringWithMetadataBlock
|
39
|
+
* - YapDatabaseViewFilteringWithRowBlock
|
40
|
+
* It allows you to filter items from this view that exist in the parent view.
|
41
|
+
* You should pick a block type that requires the minimum number of parameters that you need.
|
42
|
+
*
|
43
|
+
* @param filteringBlockType
|
44
|
+
*
|
45
|
+
* This parameter identifies the type of filtering block being used.
|
46
|
+
* It must be one of the following (and must match the filteringBlock being passed):
|
47
|
+
* - YapDatabaseViewBlockTypeWithKey
|
48
|
+
* - YapDatabaseViewBlockTypeWithObject
|
49
|
+
* - YapDatabaseViewBlockTypeWithMetadata
|
50
|
+
* - YapDatabaseViewBlockTypeWithRow
|
51
|
+
*
|
52
|
+
* @param tag
|
53
|
+
*
|
54
|
+
* The filteringBlock may be changed after the filteredView is created (see YapDatabaseFilteredViewTransaction).
|
55
|
+
* This is often in association with user events.
|
56
|
+
* The tag helps to identify the filteringBlock being used.
|
57
|
+
* During initialization of the view, the view will compare the passed tag to what it has stored from a previous
|
58
|
+
* app session. If the tag matches, then the filteredView is already setup. Otherwise the view will automatically
|
59
|
+
* flush its tables, and re-populate itself.
|
60
|
+
*
|
61
|
+
* @param options
|
62
|
+
*
|
63
|
+
* The options allow you to specify things like creating an IN-MEMORY-ONLY VIEW (non persistent).
|
64
|
+
**/
|
65
|
+
|
66
|
+
- (id)initWithParentViewName:(NSString *)viewName
|
67
|
+
filteringBlock:(YapDatabaseViewFilteringBlock)filteringBlock
|
68
|
+
filteringBlockType:(YapDatabaseViewBlockType)filteringBlockType;
|
69
|
+
|
70
|
+
- (id)initWithParentViewName:(NSString *)viewName
|
71
|
+
filteringBlock:(YapDatabaseViewFilteringBlock)filteringBlock
|
72
|
+
filteringBlockType:(YapDatabaseViewBlockType)filteringBlockType
|
73
|
+
tag:(NSString *)tag;
|
74
|
+
|
75
|
+
- (id)initWithParentViewName:(NSString *)viewName
|
76
|
+
filteringBlock:(YapDatabaseViewFilteringBlock)filteringBlock
|
77
|
+
filteringBlockType:(YapDatabaseViewBlockType)filteringBlockType
|
78
|
+
tag:(NSString *)tag
|
79
|
+
options:(YapDatabaseViewOptions *)options;
|
80
|
+
|
81
|
+
@property (nonatomic, strong, readonly) NSString *parentViewName;
|
82
|
+
|
83
|
+
@property (nonatomic, strong, readonly) YapDatabaseViewFilteringBlock filteringBlock;
|
84
|
+
@property (nonatomic, assign, readonly) YapDatabaseViewBlockType filteringBlockType;
|
85
|
+
|
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
|
+
/**
|
104
|
+
* The options allow you to specify things like creating an IN-MEMORY-ONLY VIEW (non persistent).
|
105
|
+
**/
|
106
|
+
@property (nonatomic, copy, readonly) YapDatabaseViewOptions *options;
|
107
|
+
|
108
|
+
@end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
#import <Foundation/Foundation.h>
|
2
|
+
#import "YapDatabaseViewConnection.h"
|
3
|
+
|
4
|
+
@class YapDatabaseFilteredView;
|
5
|
+
|
6
|
+
|
7
|
+
@interface YapDatabaseFilteredViewConnection : YapDatabaseViewConnection
|
8
|
+
|
9
|
+
// Returns properly typed parent view instance
|
10
|
+
@property (nonatomic, strong, readonly) YapDatabaseFilteredView *filteredView;
|
11
|
+
|
12
|
+
@end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
#import "YapDatabaseFilteredView.h"
|
2
|
+
#import "YapDatabaseFilteredViewConnection.h"
|
3
|
+
#import "YapDatabaseFilteredViewTransaction.h"
|
4
|
+
|
5
|
+
#import "YapDatabaseViewPrivate.h"
|
6
|
+
|
7
|
+
|
8
|
+
@interface YapDatabaseFilteredView () {
|
9
|
+
@public
|
10
|
+
|
11
|
+
NSString *parentViewName;
|
12
|
+
|
13
|
+
YapDatabaseViewFilteringBlock filteringBlock;
|
14
|
+
YapDatabaseViewBlockType filteringBlockType;
|
15
|
+
|
16
|
+
NSString *tag;
|
17
|
+
}
|
18
|
+
|
19
|
+
@end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
#import <Foundation/Foundation.h>
|
2
|
+
|
3
|
+
#import "YapDatabaseViewTransaction.h"
|
4
|
+
#import "YapDatabaseFilteredView.h"
|
5
|
+
|
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
|
+
|
23
|
+
@interface YapDatabaseFilteredViewTransaction : YapDatabaseViewTransaction
|
24
|
+
|
25
|
+
// This class extends YapDatabaseViewTransaction.
|
26
|
+
//
|
27
|
+
// Please see YapDatabaseViewTransaction.h
|
28
|
+
|
29
|
+
@end
|
30
|
+
|
31
|
+
#pragma mark -
|
32
|
+
|
33
|
+
@interface YapDatabaseFilteredViewTransaction (ReadWrite)
|
34
|
+
|
35
|
+
- (void)setFilteringBlock:(YapDatabaseViewFilteringBlock)filteringBlock
|
36
|
+
filteringBlockType:(YapDatabaseViewBlockType)filteringBlockType
|
37
|
+
tag:(NSString *)tag;
|
38
|
+
|
39
|
+
@end
|
@@ -0,0 +1,89 @@
|
|
1
|
+
#import <Foundation/Foundation.h>
|
2
|
+
|
3
|
+
#import "YapDatabaseExtension.h"
|
4
|
+
#import "YapDatabaseFullTextSearchConnection.h"
|
5
|
+
#import "YapDatabaseFullTextSearchTransaction.h"
|
6
|
+
|
7
|
+
/**
|
8
|
+
* Welcome to YapDatabase!
|
9
|
+
*
|
10
|
+
* https://github.com/yaptv/YapDatabase
|
11
|
+
*
|
12
|
+
* The project wiki has a wealth of documentation if you have any questions.
|
13
|
+
* https://github.com/yaptv/YapDatabase/wiki
|
14
|
+
*
|
15
|
+
* YapDatabaseFullTextSearch is an extension for performing text based search.
|
16
|
+
* Internally it uses sqlite's FTS module which was contributed by Google.
|
17
|
+
**/
|
18
|
+
|
19
|
+
/**
|
20
|
+
* The block handles extracting the column values for indexing by the FTS module.
|
21
|
+
*
|
22
|
+
* When you add or update rows in the databse the FTS block is invoked.
|
23
|
+
* Your block can inspect the row and determine if it contains any text columns that should be indexed.
|
24
|
+
* If not, the block can simply return.
|
25
|
+
* Otherwise the block should extract any text values, add them to the given dictionary.
|
26
|
+
*
|
27
|
+
* After the block returns, the dictionary parameter will be inspected,
|
28
|
+
* and any set values will be automatically passed to sqlite's FTS module for indexing.
|
29
|
+
*
|
30
|
+
* You should choose a block type that takes the minimum number of required parameters.
|
31
|
+
* The view can make various optimizations based on required parameters of the block.
|
32
|
+
**/
|
33
|
+
typedef id YapDatabaseFullTextSearchBlock; // One of YapDatabaseFullTextSearchXBlock types
|
34
|
+
|
35
|
+
typedef void (^YapDatabaseFullTextSearchWithKeyBlock) \
|
36
|
+
(NSMutableDictionary *dict, NSString *collection, NSString *key);
|
37
|
+
typedef void (^YapDatabaseFullTextSearchWithObjectBlock) \
|
38
|
+
(NSMutableDictionary *dict, NSString *collection, NSString *key, id object);
|
39
|
+
typedef void (^YapDatabaseFullTextSearchWithMetadataBlock) \
|
40
|
+
(NSMutableDictionary *dict, NSString *collection, NSString *key, id metadata);
|
41
|
+
typedef void (^YapDatabaseFullTextSearchWithRowBlock) \
|
42
|
+
(NSMutableDictionary *dict, NSString *collection, NSString *key, id object, id metadata);
|
43
|
+
|
44
|
+
/**
|
45
|
+
* Use this enum to specify what kind of block you're passing.
|
46
|
+
**/
|
47
|
+
typedef enum {
|
48
|
+
YapDatabaseFullTextSearchBlockTypeWithKey = 201,
|
49
|
+
YapDatabaseFullTextSearchBlockTypeWithObject = 202,
|
50
|
+
YapDatabaseFullTextSearchBlockTypeWithMetadata = 203,
|
51
|
+
YapDatabaseFullTextSearchBlockTypeWithRow = 204
|
52
|
+
} YapDatabaseFullTextSearchBlockType;
|
53
|
+
|
54
|
+
@interface YapDatabaseFullTextSearch : YapDatabaseExtension
|
55
|
+
|
56
|
+
/* Inherited from YapDatabaseExtension
|
57
|
+
|
58
|
+
@property (nonatomic, strong, readonly) NSString *registeredName;
|
59
|
+
|
60
|
+
*/
|
61
|
+
|
62
|
+
- (id)initWithColumnNames:(NSArray *)columnNames
|
63
|
+
block:(YapDatabaseFullTextSearchBlock)block
|
64
|
+
blockType:(YapDatabaseFullTextSearchBlockType)blockType;
|
65
|
+
|
66
|
+
- (id)initWithColumnNames:(NSArray *)columnNames
|
67
|
+
block:(YapDatabaseFullTextSearchBlock)block
|
68
|
+
blockType:(YapDatabaseFullTextSearchBlockType)blockType
|
69
|
+
version:(int)version;
|
70
|
+
|
71
|
+
- (id)initWithColumnNames:(NSArray *)columnNames
|
72
|
+
options:(NSDictionary *)options
|
73
|
+
block:(YapDatabaseFullTextSearchBlock)block
|
74
|
+
blockType:(YapDatabaseFullTextSearchBlockType)blockType
|
75
|
+
version:(int)version;
|
76
|
+
|
77
|
+
@property (nonatomic, strong, readonly) YapDatabaseFullTextSearchBlock block;
|
78
|
+
@property (nonatomic, assign, readonly) YapDatabaseFullTextSearchBlockType blockType;
|
79
|
+
|
80
|
+
/**
|
81
|
+
* The version assists in making changes to the extension.
|
82
|
+
*
|
83
|
+
* If you need to change the columnNames and/or block,
|
84
|
+
* then simply pass an incremented version during the init method,
|
85
|
+
* and the FTS extension will automatically update itself.
|
86
|
+
**/
|
87
|
+
@property (nonatomic, assign, readonly) int version;
|
88
|
+
|
89
|
+
@end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
#import <Foundation/Foundation.h>
|
2
|
+
#import "YapDatabaseExtensionConnection.h"
|
3
|
+
|
4
|
+
@class YapDatabaseFullTextSearch;
|
5
|
+
|
6
|
+
/**
|
7
|
+
* Welcome to YapDatabase!
|
8
|
+
*
|
9
|
+
* https://github.com/yaptv/YapDatabase
|
10
|
+
*
|
11
|
+
* The project wiki has a wealth of documentation if you have any questions.
|
12
|
+
* https://github.com/yaptv/YapDatabase/wiki
|
13
|
+
*
|
14
|
+
* YapDatabaseFullTextSearch is an extension for performing text based search.
|
15
|
+
* Internally it uses sqlite's FTS module which was contributed by Google.
|
16
|
+
*
|
17
|
+
* As an extension, YapCollectiosnDatabaseFullTextSearchConnection is automatically
|
18
|
+
* created by YapDatabaseConnnection. You can access this object via:
|
19
|
+
*
|
20
|
+
* [databaseConnection extension:@"myRegisteredExtensionName"]
|
21
|
+
*
|
22
|
+
* @see YapDatabaseFullTextSearch
|
23
|
+
* @see YapDatabaseFullTextSearchTransaction
|
24
|
+
**/
|
25
|
+
@interface YapDatabaseFullTextSearchConnection : YapDatabaseExtensionConnection
|
26
|
+
|
27
|
+
/**
|
28
|
+
* Returns the parent instance.
|
29
|
+
**/
|
30
|
+
@property (nonatomic, strong, readonly) YapDatabaseFullTextSearch *fullTextSearch;
|
31
|
+
|
32
|
+
@end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
#import "YapDatabaseFullTextSearch.h"
|
2
|
+
#import "YapDatabaseFullTextSearchConnection.h"
|
3
|
+
#import "YapDatabaseFullTextSearchTransaction.h"
|
4
|
+
|
5
|
+
#import "YapDatabase.h"
|
6
|
+
#import "YapDatabaseConnection.h"
|
7
|
+
#import "YapDatabaseTransaction.h"
|
8
|
+
|
9
|
+
#import "sqlite3.h"
|
10
|
+
|
11
|
+
@interface YapDatabaseFullTextSearch () {
|
12
|
+
@public
|
13
|
+
|
14
|
+
YapDatabaseFullTextSearchBlock block;
|
15
|
+
YapDatabaseFullTextSearchBlockType blockType;
|
16
|
+
|
17
|
+
NSOrderedSet *columnNames;
|
18
|
+
NSDictionary *options;
|
19
|
+
int version;
|
20
|
+
|
21
|
+
id columnNamesSharedKeySet;
|
22
|
+
}
|
23
|
+
|
24
|
+
- (NSString *)tableName;
|
25
|
+
|
26
|
+
@end
|
27
|
+
|
28
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
29
|
+
#pragma mark -
|
30
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
31
|
+
|
32
|
+
@interface YapDatabaseFullTextSearchConnection () {
|
33
|
+
@public
|
34
|
+
|
35
|
+
__strong YapDatabaseFullTextSearch *fts;
|
36
|
+
__unsafe_unretained YapDatabaseConnection *databaseConnection;
|
37
|
+
|
38
|
+
NSMutableDictionary *blockDict;
|
39
|
+
}
|
40
|
+
|
41
|
+
- (id)initWithFTS:(YapDatabaseFullTextSearch *)fts
|
42
|
+
databaseConnection:(YapDatabaseConnection *)databaseConnection;
|
43
|
+
|
44
|
+
- (sqlite3_stmt *)insertRowidStatement;
|
45
|
+
- (sqlite3_stmt *)setRowidStatement;
|
46
|
+
- (sqlite3_stmt *)removeRowidStatement;
|
47
|
+
- (sqlite3_stmt *)removeAllStatement;
|
48
|
+
- (sqlite3_stmt *)queryStatement;
|
49
|
+
- (sqlite3_stmt *)querySnippetStatement;
|
50
|
+
|
51
|
+
@end
|
52
|
+
|
53
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
54
|
+
#pragma mark -
|
55
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
56
|
+
|
57
|
+
@interface YapDatabaseFullTextSearchTransaction () {
|
58
|
+
@private
|
59
|
+
|
60
|
+
__unsafe_unretained YapDatabaseFullTextSearchConnection *ftsConnection;
|
61
|
+
__unsafe_unretained YapDatabaseReadTransaction *databaseTransaction;
|
62
|
+
|
63
|
+
BOOL isMutated;
|
64
|
+
}
|
65
|
+
|
66
|
+
- (id)initWithFTSConnection:(YapDatabaseFullTextSearchConnection *)ftsConnection
|
67
|
+
databaseTransaction:(YapDatabaseReadTransaction *)databaseTransaction;
|
68
|
+
|
69
|
+
@end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
#import <Foundation/Foundation.h>
|
2
|
+
|
3
|
+
/**
|
4
|
+
* This class represents options that may be passed to the FTS snippet function.
|
5
|
+
*
|
6
|
+
* It correlates with the snippet funtion arguments as defined in sqlite's FTS module:
|
7
|
+
* http://www.sqlite.org/fts3.html#section_4_2
|
8
|
+
*
|
9
|
+
* For example, if you were searching for the word "favorite",
|
10
|
+
* then a returned snippet may look something like this:
|
11
|
+
*
|
12
|
+
* <b>...</b>one of my <b>favorite</b> cheese pairings is<b>...</b>
|
13
|
+
**/
|
14
|
+
@interface YapDatabaseFullTextSearchSnippetOptions : NSObject <NSCopying>
|
15
|
+
|
16
|
+
|
17
|
+
+ (NSString *)defaultStartMatchText; // @"<b>"
|
18
|
+
+ (NSString *)defaultEndMatchText; // @"</b>"
|
19
|
+
+ (NSString *)defaultEllipsesText; // @"..."
|
20
|
+
|
21
|
+
+ (int)defaultNumberOfTokens; // 15
|
22
|
+
|
23
|
+
- (id)init;
|
24
|
+
|
25
|
+
/**
|
26
|
+
* The startMatchText is inserted before matched terms/phrases, and also before injected ellipses text.
|
27
|
+
* It is used to mark the beginning of special text within the snippet.
|
28
|
+
*
|
29
|
+
* If not set, it will be the defaultStartMatchText: @"<b>"
|
30
|
+
*
|
31
|
+
* @see defaultStartMatchText
|
32
|
+
**/
|
33
|
+
@property (nonatomic, copy) NSString *startMatchText;
|
34
|
+
|
35
|
+
/**
|
36
|
+
* The endMatchText is inserted after matched terms/phrases, and also after injected ellipses text.
|
37
|
+
* It is used to mark the end of special text within the snippet.
|
38
|
+
*
|
39
|
+
* If not set, it will be the defaultEndMatchText: @"</b>"
|
40
|
+
*
|
41
|
+
* @see defaultEndMatchText
|
42
|
+
**/
|
43
|
+
@property (nonatomic, copy) NSString *endMatchText;
|
44
|
+
|
45
|
+
/**
|
46
|
+
* If the full text from the column is too big, the snippets will be a small subsection of the snippet,
|
47
|
+
* centered on matching terms/phrases. When this occurs, and the snippet is truncated on the left and/or right,
|
48
|
+
* then the ellipsesText will be inserted on the left and/or right.
|
49
|
+
*
|
50
|
+
* If not set, it will be the defaultEllipsesText: @"…"
|
51
|
+
*
|
52
|
+
* @see defaultEllipsesText
|
53
|
+
* @see numberOfTokens
|
54
|
+
**/
|
55
|
+
@property (nonatomic, copy) NSString *ellipsesText;
|
56
|
+
|
57
|
+
/**
|
58
|
+
* The column name from which to extract the returned fragments of text from.
|
59
|
+
* If nil, then the text may be extracted from any column.
|
60
|
+
*
|
61
|
+
* If not set, the default value is nil.
|
62
|
+
**/
|
63
|
+
@property (nonatomic, copy) NSString *columnName;
|
64
|
+
|
65
|
+
/**
|
66
|
+
* The numberOfTokens is used as the (approximate) number of tokens to include in the returned snippet text value.
|
67
|
+
*
|
68
|
+
* If not set, it will be defaultNumberOfTokens: 15
|
69
|
+
*
|
70
|
+
* Setting this to a value of zero resets the value to the default.
|
71
|
+
* Negative values are allowed, as the snippet function automatically uses the absolute value.
|
72
|
+
*
|
73
|
+
* The maximum allowable absolute value is 64.
|
74
|
+
*
|
75
|
+
* @see defaultNumberOfTokens
|
76
|
+
**/
|
77
|
+
@property (nonatomic, assign) int numberOfTokens;
|
78
|
+
|
79
|
+
@end
|