├── .gitignore ├── Example ├── AppDelegate.swift ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Model │ └── Realm │ │ ├── Cat.swift │ │ └── Dog.swift ├── Resources │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ └── Info.plist └── ViewController.swift ├── LICENSE ├── Podfile ├── Podfile.lock ├── Pods ├── Manifest.lock ├── Pods.xcodeproj │ └── project.pbxproj ├── Realm │ ├── LICENSE │ ├── README.md │ ├── Realm │ │ ├── NSError+RLMSync.m │ │ ├── ObjectStore │ │ │ └── src │ │ │ │ ├── binding_callback_thread_observer.cpp │ │ │ │ ├── collection_notifications.cpp │ │ │ │ ├── impl │ │ │ │ ├── apple │ │ │ │ │ ├── external_commit_helper.cpp │ │ │ │ │ └── keychain_helper.cpp │ │ │ │ ├── collection_change_builder.cpp │ │ │ │ ├── collection_notifier.cpp │ │ │ │ ├── list_notifier.cpp │ │ │ │ ├── object_notifier.cpp │ │ │ │ ├── primitive_list_notifier.cpp │ │ │ │ ├── realm_coordinator.cpp │ │ │ │ ├── results_notifier.cpp │ │ │ │ ├── transact_log_handler.cpp │ │ │ │ └── weak_realm_notifier.cpp │ │ │ │ ├── index_set.cpp │ │ │ │ ├── list.cpp │ │ │ │ ├── object.cpp │ │ │ │ ├── object_schema.cpp │ │ │ │ ├── object_store.cpp │ │ │ │ ├── placeholder.cpp │ │ │ │ ├── results.cpp │ │ │ │ ├── schema.cpp │ │ │ │ ├── shared_realm.cpp │ │ │ │ ├── sync │ │ │ │ ├── impl │ │ │ │ │ ├── apple │ │ │ │ │ │ ├── network_reachability_observer.cpp │ │ │ │ │ │ └── system_configuration.cpp │ │ │ │ │ ├── sync_file.cpp │ │ │ │ │ ├── sync_metadata.cpp │ │ │ │ │ └── work_queue.cpp │ │ │ │ ├── partial_sync.cpp │ │ │ │ ├── sync_config.cpp │ │ │ │ ├── sync_manager.cpp │ │ │ │ ├── sync_permission.cpp │ │ │ │ ├── sync_session.cpp │ │ │ │ └── sync_user.cpp │ │ │ │ ├── thread_safe_reference.cpp │ │ │ │ └── util │ │ │ │ └── uuid.cpp │ │ ├── RLMAccessor.mm │ │ ├── RLMAnalytics.mm │ │ ├── RLMArray.mm │ │ ├── RLMClassInfo.mm │ │ ├── RLMCollection.mm │ │ ├── RLMConstants.m │ │ ├── RLMJSONModels.m │ │ ├── RLMListBase.mm │ │ ├── RLMManagedArray.mm │ │ ├── RLMMigration.mm │ │ ├── RLMNetworkClient.mm │ │ ├── RLMObject.mm │ │ ├── RLMObjectBase.mm │ │ ├── RLMObjectSchema.mm │ │ ├── RLMObjectStore.mm │ │ ├── RLMObservation.mm │ │ ├── RLMOptionalBase.mm │ │ ├── RLMPredicateUtil.mm │ │ ├── RLMProperty.mm │ │ ├── RLMQueryUtil.mm │ │ ├── RLMRealm+Sync.mm │ │ ├── RLMRealm.mm │ │ ├── RLMRealmConfiguration+Sync.mm │ │ ├── RLMRealmConfiguration.mm │ │ ├── RLMRealmUtil.mm │ │ ├── RLMResults.mm │ │ ├── RLMSchema.mm │ │ ├── RLMSwiftSupport.m │ │ ├── RLMSyncConfiguration.mm │ │ ├── RLMSyncCredentials.m │ │ ├── RLMSyncManager.mm │ │ ├── RLMSyncPermission.mm │ │ ├── RLMSyncPermissionResults.mm │ │ ├── RLMSyncSession.mm │ │ ├── RLMSyncSessionRefreshHandle.mm │ │ ├── RLMSyncSubscription.mm │ │ ├── RLMSyncUser.mm │ │ ├── RLMSyncUtil.mm │ │ ├── RLMThreadSafeReference.mm │ │ ├── RLMUpdateChecker.mm │ │ ├── RLMUtil.mm │ │ └── Realm.modulemap │ ├── build.sh │ ├── core │ │ └── librealmcore-ios.a │ └── include │ │ ├── NSError+RLMSync.h │ │ ├── RLMAccessor.h │ │ ├── RLMAccessor.hpp │ │ ├── RLMAnalytics.hpp │ │ ├── RLMArray.h │ │ ├── RLMArray_Private.h │ │ ├── RLMArray_Private.hpp │ │ ├── RLMClassInfo.hpp │ │ ├── RLMCollection.h │ │ ├── RLMCollection_Private.h │ │ ├── RLMCollection_Private.hpp │ │ ├── RLMConstants.h │ │ ├── RLMJSONModels.h │ │ ├── RLMListBase.h │ │ ├── RLMMigration.h │ │ ├── RLMMigration_Private.h │ │ ├── RLMNetworkClient.h │ │ ├── RLMObject.h │ │ ├── RLMObjectBase.h │ │ ├── RLMObjectBase_Dynamic.h │ │ ├── RLMObjectBase_Private.h │ │ ├── RLMObjectSchema.h │ │ ├── RLMObjectSchema_Private.h │ │ ├── RLMObjectSchema_Private.hpp │ │ ├── RLMObjectStore.h │ │ ├── RLMObject_Private.h │ │ ├── RLMObject_Private.hpp │ │ ├── RLMObservation.hpp │ │ ├── RLMOptionalBase.h │ │ ├── RLMPlatform.h │ │ ├── RLMPredicateUtil.hpp │ │ ├── RLMPrefix.h │ │ ├── RLMProperty.h │ │ ├── RLMProperty_Private.h │ │ ├── RLMProperty_Private.hpp │ │ ├── RLMQueryUtil.hpp │ │ ├── RLMRealm+Sync.h │ │ ├── RLMRealm.h │ │ ├── RLMRealmConfiguration+Sync.h │ │ ├── RLMRealmConfiguration.h │ │ ├── RLMRealmConfiguration_Private.h │ │ ├── RLMRealmConfiguration_Private.hpp │ │ ├── RLMRealmUtil.hpp │ │ ├── RLMRealm_Dynamic.h │ │ ├── RLMRealm_Private.h │ │ ├── RLMRealm_Private.hpp │ │ ├── RLMResults.h │ │ ├── RLMResults_Private.h │ │ ├── RLMResults_Private.hpp │ │ ├── RLMSchema.h │ │ ├── RLMSchema_Private.h │ │ ├── RLMSchema_Private.hpp │ │ ├── RLMSwiftBridgingHeader.h │ │ ├── RLMSwiftSupport.h │ │ ├── RLMSyncConfiguration.h │ │ ├── RLMSyncConfiguration_Private.h │ │ ├── RLMSyncConfiguration_Private.hpp │ │ ├── RLMSyncCredentials.h │ │ ├── RLMSyncManager.h │ │ ├── RLMSyncManager_Private.h │ │ ├── RLMSyncPermission.h │ │ ├── RLMSyncPermissionResults.h │ │ ├── RLMSyncPermission_Private.hpp │ │ ├── RLMSyncSession.h │ │ ├── RLMSyncSessionRefreshHandle.h │ │ ├── RLMSyncSessionRefreshHandle.hpp │ │ ├── RLMSyncSession_Private.hpp │ │ ├── RLMSyncSubscription.h │ │ ├── RLMSyncUser.h │ │ ├── RLMSyncUser_Private.hpp │ │ ├── RLMSyncUtil.h │ │ ├── RLMSyncUtil_Private.h │ │ ├── RLMSyncUtil_Private.hpp │ │ ├── RLMThreadSafeReference.h │ │ ├── RLMThreadSafeReference_Private.hpp │ │ ├── RLMUpdateChecker.hpp │ │ ├── RLMUtil.hpp │ │ ├── Realm.h │ │ ├── binding_callback_thread_observer.hpp │ │ ├── binding_context.hpp │ │ ├── collection_notifications.hpp │ │ ├── core │ │ ├── realm.hpp │ │ └── realm │ │ │ ├── alloc.hpp │ │ │ ├── alloc_slab.hpp │ │ │ ├── array.hpp │ │ │ ├── array_basic.hpp │ │ │ ├── array_basic_tpl.hpp │ │ │ ├── array_binary.hpp │ │ │ ├── array_blob.hpp │ │ │ ├── array_blobs_big.hpp │ │ │ ├── array_direct.hpp │ │ │ ├── array_integer.hpp │ │ │ ├── array_string.hpp │ │ │ ├── array_string_long.hpp │ │ │ ├── binary_data.hpp │ │ │ ├── bptree.hpp │ │ │ ├── chunked_binary.hpp │ │ │ ├── column.hpp │ │ │ ├── column_backlink.hpp │ │ │ ├── column_binary.hpp │ │ │ ├── column_fwd.hpp │ │ │ ├── column_link.hpp │ │ │ ├── column_linkbase.hpp │ │ │ ├── column_linklist.hpp │ │ │ ├── column_mixed.hpp │ │ │ ├── column_mixed_tpl.hpp │ │ │ ├── column_string.hpp │ │ │ ├── column_string_enum.hpp │ │ │ ├── column_table.hpp │ │ │ ├── column_timestamp.hpp │ │ │ ├── column_tpl.hpp │ │ │ ├── column_type.hpp │ │ │ ├── column_type_traits.hpp │ │ │ ├── data_type.hpp │ │ │ ├── descriptor.hpp │ │ │ ├── descriptor_fwd.hpp │ │ │ ├── disable_sync_to_disk.hpp │ │ │ ├── exceptions.hpp │ │ │ ├── group.hpp │ │ │ ├── group_shared.hpp │ │ │ ├── group_shared_options.hpp │ │ │ ├── group_writer.hpp │ │ │ ├── handover_defs.hpp │ │ │ ├── history.hpp │ │ │ ├── impl │ │ │ ├── array_writer.hpp │ │ │ ├── clamped_hex_dump.hpp │ │ │ ├── clock.hpp │ │ │ ├── cont_transact_hist.hpp │ │ │ ├── destroy_guard.hpp │ │ │ ├── input_stream.hpp │ │ │ ├── output_stream.hpp │ │ │ ├── sequential_getter.hpp │ │ │ ├── simulated_failure.hpp │ │ │ └── transact_log.hpp │ │ │ ├── index_string.hpp │ │ │ ├── lang_bind_helper.hpp │ │ │ ├── link_view.hpp │ │ │ ├── link_view_fwd.hpp │ │ │ ├── metrics │ │ │ ├── metric_timer.hpp │ │ │ ├── metrics.hpp │ │ │ ├── query_info.hpp │ │ │ └── transaction_info.hpp │ │ │ ├── mixed.hpp │ │ │ ├── null.hpp │ │ │ ├── olddatetime.hpp │ │ │ ├── owned_data.hpp │ │ │ ├── parser │ │ │ ├── collection_operator_expression.hpp │ │ │ ├── expression_container.hpp │ │ │ ├── keypath_mapping.hpp │ │ │ ├── parser.hpp │ │ │ ├── parser_utils.hpp │ │ │ ├── property_expression.hpp │ │ │ ├── query_builder.hpp │ │ │ ├── subquery_expression.hpp │ │ │ └── value_expression.hpp │ │ │ ├── query.hpp │ │ │ ├── query_conditions.hpp │ │ │ ├── query_engine.hpp │ │ │ ├── query_expression.hpp │ │ │ ├── query_operators.hpp │ │ │ ├── realm_nmmintrin.h │ │ │ ├── replication.hpp │ │ │ ├── row.hpp │ │ │ ├── spec.hpp │ │ │ ├── string_data.hpp │ │ │ ├── sync │ │ │ ├── changeset.hpp │ │ │ ├── changeset_cooker.hpp │ │ │ ├── changeset_encoder.hpp │ │ │ ├── changeset_parser.hpp │ │ │ ├── client.hpp │ │ │ ├── crypto.hpp │ │ │ ├── crypto_server.hpp │ │ │ ├── feature_token.hpp │ │ │ ├── history.hpp │ │ │ ├── instruction_applier.hpp │ │ │ ├── instruction_replication.hpp │ │ │ ├── instructions.hpp │ │ │ ├── object.hpp │ │ │ ├── object_id.hpp │ │ │ ├── permissions.hpp │ │ │ ├── protocol.hpp │ │ │ ├── transform.hpp │ │ │ └── version.hpp │ │ │ ├── table.hpp │ │ │ ├── table_ref.hpp │ │ │ ├── table_view.hpp │ │ │ ├── timestamp.hpp │ │ │ ├── unicode.hpp │ │ │ ├── util │ │ │ ├── aes_cryptor.hpp │ │ │ ├── any.hpp │ │ │ ├── assert.hpp │ │ │ ├── backtrace.hpp │ │ │ ├── base64.hpp │ │ │ ├── basic_system_errors.hpp │ │ │ ├── bind_ptr.hpp │ │ │ ├── buffer.hpp │ │ │ ├── buffer_stream.hpp │ │ │ ├── call_with_tuple.hpp │ │ │ ├── cf_ptr.hpp │ │ │ ├── circular_buffer.hpp │ │ │ ├── compression.hpp │ │ │ ├── config.h │ │ │ ├── demangle.hpp │ │ │ ├── encrypted_file_mapping.hpp │ │ │ ├── enum.hpp │ │ │ ├── errno.hpp │ │ │ ├── features.h │ │ │ ├── file.hpp │ │ │ ├── file_mapper.hpp │ │ │ ├── flat_map.hpp │ │ │ ├── hex_dump.hpp │ │ │ ├── http.hpp │ │ │ ├── inspect.hpp │ │ │ ├── interprocess_condvar.hpp │ │ │ ├── interprocess_mutex.hpp │ │ │ ├── json_parser.hpp │ │ │ ├── load_file.hpp │ │ │ ├── logger.hpp │ │ │ ├── memory_stream.hpp │ │ │ ├── misc_errors.hpp │ │ │ ├── misc_ext_errors.hpp │ │ │ ├── miscellaneous.hpp │ │ │ ├── network.hpp │ │ │ ├── network_ssl.hpp │ │ │ ├── optional.hpp │ │ │ ├── overload.hpp │ │ │ ├── parent_dir.hpp │ │ │ ├── priority_queue.hpp │ │ │ ├── random.hpp │ │ │ ├── resource_limits.hpp │ │ │ ├── safe_int_ops.hpp │ │ │ ├── scope_exit.hpp │ │ │ ├── serializer.hpp │ │ │ ├── shared_ptr.hpp │ │ │ ├── signal_blocker.hpp │ │ │ ├── string_buffer.hpp │ │ │ ├── system_process.hpp │ │ │ ├── terminate.hpp │ │ │ ├── thread.hpp │ │ │ ├── thread_exec_guard.hpp │ │ │ ├── time.hpp │ │ │ ├── to_string.hpp │ │ │ ├── type_list.hpp │ │ │ ├── type_traits.hpp │ │ │ ├── uri.hpp │ │ │ ├── utf8.hpp │ │ │ ├── value_reset_guard.hpp │ │ │ └── websocket.hpp │ │ │ ├── utilities.hpp │ │ │ ├── version.hpp │ │ │ ├── version_id.hpp │ │ │ └── views.hpp │ │ ├── execution_context_id.hpp │ │ ├── feature_checks.hpp │ │ ├── impl │ │ ├── apple │ │ │ ├── external_commit_helper.hpp │ │ │ └── keychain_helper.hpp │ │ ├── collection_change_builder.hpp │ │ ├── collection_notifier.hpp │ │ ├── external_commit_helper.hpp │ │ ├── list_notifier.hpp │ │ ├── notification_wrapper.hpp │ │ ├── object_accessor_impl.hpp │ │ ├── object_notifier.hpp │ │ ├── primitive_list_notifier.hpp │ │ ├── realm_coordinator.hpp │ │ ├── results_notifier.hpp │ │ ├── transact_log_handler.hpp │ │ └── weak_realm_notifier.hpp │ │ ├── index_set.hpp │ │ ├── list.hpp │ │ ├── object.hpp │ │ ├── object_accessor.hpp │ │ ├── object_schema.hpp │ │ ├── object_store.hpp │ │ ├── property.hpp │ │ ├── results.hpp │ │ ├── schema.hpp │ │ ├── shared_realm.hpp │ │ ├── sync │ │ ├── impl │ │ │ ├── apple │ │ │ │ ├── network_reachability_observer.hpp │ │ │ │ └── system_configuration.hpp │ │ │ ├── network_reachability.hpp │ │ │ ├── sync_client.hpp │ │ │ ├── sync_file.hpp │ │ │ ├── sync_metadata.hpp │ │ │ └── work_queue.hpp │ │ ├── partial_sync.hpp │ │ ├── subscription_state.hpp │ │ ├── sync_config.hpp │ │ ├── sync_manager.hpp │ │ ├── sync_permission.hpp │ │ ├── sync_session.hpp │ │ └── sync_user.hpp │ │ ├── thread_safe_reference.hpp │ │ └── util │ │ ├── aligned_union.hpp │ │ ├── apple │ │ └── event_loop_signal.hpp │ │ ├── atomic_shared_ptr.hpp │ │ ├── event_loop_signal.hpp │ │ ├── tagged_bool.hpp │ │ └── uuid.hpp ├── RealmSwift │ ├── LICENSE │ ├── README.md │ ├── RealmSwift │ │ ├── Aliases.swift │ │ ├── Error.swift │ │ ├── LinkingObjects.swift │ │ ├── List.swift │ │ ├── Migration.swift │ │ ├── Object.swift │ │ ├── ObjectSchema.swift │ │ ├── ObjectiveCSupport.swift │ │ ├── Optional.swift │ │ ├── Property.swift │ │ ├── Realm.swift │ │ ├── RealmCollection.swift │ │ ├── RealmConfiguration.swift │ │ ├── Results.swift │ │ ├── Schema.swift │ │ ├── SortDescriptor.swift │ │ ├── SwiftVersion.swift │ │ ├── Sync.swift │ │ ├── ThreadSafeReference.swift │ │ └── Util.swift │ └── build.sh └── Target Support Files │ ├── Pods-Example │ ├── Pods-Example-Info.plist │ ├── Pods-Example-acknowledgements.markdown │ ├── Pods-Example-acknowledgements.plist │ ├── Pods-Example-dummy.m │ ├── Pods-Example-frameworks.sh │ ├── Pods-Example-umbrella.h │ ├── Pods-Example.debug.xcconfig │ ├── Pods-Example.modulemap │ └── Pods-Example.release.xcconfig │ ├── Pods-RealmSwiftService │ ├── Pods-RealmSwiftService-Info.plist │ ├── Pods-RealmSwiftService-acknowledgements.markdown │ ├── Pods-RealmSwiftService-acknowledgements.plist │ ├── Pods-RealmSwiftService-dummy.m │ ├── Pods-RealmSwiftService-umbrella.h │ ├── Pods-RealmSwiftService.debug.xcconfig │ ├── Pods-RealmSwiftService.modulemap │ └── Pods-RealmSwiftService.release.xcconfig │ ├── Pods-RealmSwiftServiceTests │ ├── Pods-RealmSwiftServiceTests-Info.plist │ ├── Pods-RealmSwiftServiceTests-acknowledgements.markdown │ ├── Pods-RealmSwiftServiceTests-acknowledgements.plist │ ├── Pods-RealmSwiftServiceTests-dummy.m │ ├── Pods-RealmSwiftServiceTests-umbrella.h │ ├── Pods-RealmSwiftServiceTests.debug.xcconfig │ ├── Pods-RealmSwiftServiceTests.modulemap │ └── Pods-RealmSwiftServiceTests.release.xcconfig │ ├── Realm │ ├── Realm-Info.plist │ ├── Realm-dummy.m │ ├── Realm-prefix.pch │ ├── Realm.modulemap │ └── Realm.xcconfig │ └── RealmSwift │ ├── RealmSwift-Info.plist │ ├── RealmSwift-dummy.m │ ├── RealmSwift-prefix.pch │ ├── RealmSwift-umbrella.h │ ├── RealmSwift.modulemap │ └── RealmSwift.xcconfig ├── README.md ├── RealmSwiftService.podspec ├── RealmSwiftService.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── xcuserdata │ └── hayashi.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist ├── RealmSwiftService.xcworkspace ├── contents.xcworkspacedata └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── RealmSwiftService ├── Info.plist ├── RealmAccessible.swift ├── RealmDao.swift └── RealmSwiftService.h └── RealmSwiftServiceTests ├── Info.plist └── RealmSwiftServiceTests.swift /Example/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // Example 4 | // 5 | // Created by Tsubasa Hayashi on 2018/11/05. 6 | // Copyright © 2018 Tsubasa Hayashi. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 17 | return true 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Example/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Example/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Example/Model/Realm/Cat.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Cat.swift 3 | // Example 4 | // 5 | // Created by Tsubasa Hayashi on 2018/11/05. 6 | // Copyright © 2018 Tsubasa Hayashi. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import RealmSwift 11 | import RealmSwiftService 12 | 13 | @objcMembers 14 | class Cat: Object, RealmAccessible { 15 | 16 | dynamic var id = UUID().uuidString 17 | dynamic var name = "" 18 | 19 | override static func primaryKey() -> String? { return "id" } 20 | 21 | convenience init(name: String) { 22 | self.init() 23 | self.name = name 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Example/Model/Realm/Dog.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Dog.swift 3 | // Example 4 | // 5 | // Created by Tsubasa Hayashi on 2018/11/05. 6 | // Copyright © 2018 Tsubasa Hayashi. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import RealmSwift 11 | 12 | @objcMembers 13 | class Dog: Object { 14 | 15 | dynamic var id = UUID().uuidString 16 | dynamic var name = "" 17 | 18 | override static func primaryKey() -> String? { return "id" } 19 | 20 | convenience init(name: String) { 21 | self.init() 22 | self.name = name 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Example/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /Example/Resources/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Example/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /Example/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // Example 4 | // 5 | // Created by Tsubasa Hayashi on 2018/11/05. 6 | // Copyright © 2018 Tsubasa Hayashi. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import RealmSwiftService 11 | 12 | class ViewController: UIViewController { 13 | 14 | override func viewDidLoad() { 15 | super.viewDidLoad() 16 | 17 | //--- RealmAccessible Example --- 18 | let cat = Cat(name: "tama") // Create Realm Object 19 | _ = Cat.all() // Get All Object of Cat 20 | _ = Cat.find(by: "id") // Find Cat by id property 21 | _ = Cat.first() // Get Last Object of Cat 22 | _ = Cat.last() // Get First Object of Cat 23 | try! cat.save() // Save Object of Cat 24 | try! cat.delete() // Delete Object of Cat 25 | try! Cat.deleteAll() // Delete All Object of Cat 26 | 27 | 28 | // --- Dao Example --- 29 | let dao = RealmDao() // Create Dao of Dog 30 | let dog = Dog(name: "pochi") // Create Realm Object 31 | _ = dao.all() // Get All Object of Dog 32 | _ = dao.find(by: "id") // Find Dog by id property 33 | _ = dao.first() // Get First Object of Dog 34 | _ = dao.last() // Get Last Object of Dog 35 | try! dao.save(dog) // Save Object of Dog 36 | try! dao.delete(dog) // Delete Object of Dog 37 | try! dao.deleteAll() // Delete All Object of Dog 38 | 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2018 yokurin 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | target 'Example' do 5 | # Comment the next line if you're not using Swift and don't want to use dynamic frameworks 6 | use_frameworks! 7 | 8 | # Pods for Example 9 | pod 'RealmSwift' 10 | end 11 | 12 | target 'RealmSwiftService' do 13 | # Comment the next line if you're not using Swift and don't want to use dynamic frameworks 14 | use_frameworks! 15 | 16 | # Pods for RealmSwiftService 17 | pod 'RealmSwift' 18 | 19 | target 'RealmSwiftServiceTests' do 20 | inherit! :search_paths 21 | # Pods for testing 22 | end 23 | 24 | end 25 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Realm (3.11.1): 3 | - Realm/Headers (= 3.11.1) 4 | - Realm/Headers (3.11.1) 5 | - RealmSwift (3.11.1): 6 | - Realm (= 3.11.1) 7 | 8 | DEPENDENCIES: 9 | - RealmSwift 10 | 11 | SPEC REPOS: 12 | https://github.com/cocoapods/specs.git: 13 | - Realm 14 | - RealmSwift 15 | 16 | SPEC CHECKSUMS: 17 | Realm: 037c5919b9ceb59d6beed5d3b031096856b119b3 18 | RealmSwift: c9580133e73ef40ed340401af2dbc9a5790dfea7 19 | 20 | PODFILE CHECKSUM: 0a4c3ff5168c6c2157328eed71e475ded47adec5 21 | 22 | COCOAPODS: 1.6.0.beta.1 23 | -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Realm (3.11.1): 3 | - Realm/Headers (= 3.11.1) 4 | - Realm/Headers (3.11.1) 5 | - RealmSwift (3.11.1): 6 | - Realm (= 3.11.1) 7 | 8 | DEPENDENCIES: 9 | - RealmSwift 10 | 11 | SPEC REPOS: 12 | https://github.com/cocoapods/specs.git: 13 | - Realm 14 | - RealmSwift 15 | 16 | SPEC CHECKSUMS: 17 | Realm: 037c5919b9ceb59d6beed5d3b031096856b119b3 18 | RealmSwift: c9580133e73ef40ed340401af2dbc9a5790dfea7 19 | 20 | PODFILE CHECKSUM: 0a4c3ff5168c6c2157328eed71e475ded47adec5 21 | 22 | COCOAPODS: 1.6.0.beta.1 23 | -------------------------------------------------------------------------------- /Pods/Realm/Realm/NSError+RLMSync.m: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2017 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import "NSError+RLMSync.h" 20 | 21 | #import "RLMSyncUtil.h" 22 | 23 | @implementation NSError (RLMSync) 24 | 25 | - (RLMSyncErrorActionToken *)rlmSync_errorActionToken { 26 | if (self.domain != RLMSyncErrorDomain) { 27 | return nil; 28 | } 29 | if (self.code == RLMSyncErrorClientResetError 30 | || self.code == RLMSyncErrorPermissionDeniedError) { 31 | return (RLMSyncErrorActionToken *)self.userInfo[kRLMSyncErrorActionTokenKey]; 32 | } 33 | return nil; 34 | } 35 | 36 | - (NSString *)rlmSync_clientResetBackedUpRealmPath { 37 | if (self.domain == RLMSyncErrorDomain && self.code == RLMSyncErrorClientResetError) { 38 | return self.userInfo[kRLMSyncPathOfRealmBackupCopyKey]; 39 | } 40 | return nil; 41 | } 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Pods/Realm/Realm/ObjectStore/src/binding_callback_thread_observer.cpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2017 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #include "binding_callback_thread_observer.hpp" 20 | 21 | namespace realm { 22 | BindingCallbackThreadObserver* g_binding_callback_thread_observer = nullptr; 23 | } 24 | -------------------------------------------------------------------------------- /Pods/Realm/Realm/ObjectStore/src/collection_notifications.cpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2016 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #include "collection_notifications.hpp" 20 | 21 | #include "impl/collection_notifier.hpp" 22 | 23 | using namespace realm; 24 | using namespace realm::_impl; 25 | 26 | NotificationToken::NotificationToken(std::shared_ptr<_impl::CollectionNotifier> notifier, uint64_t token) 27 | : m_notifier(std::move(notifier)), m_token(token) 28 | { 29 | } 30 | 31 | NotificationToken::~NotificationToken() 32 | { 33 | // m_notifier itself (and not just the pointed-to thing) needs to be accessed 34 | // atomically to ensure that there are no data races when the token is 35 | // destroyed after being modified on a different thread. 36 | // This is needed despite the token not being thread-safe in general as 37 | // users find it very surprising for obj-c objects to care about what 38 | // thread they are deallocated on. 39 | if (auto notifier = m_notifier.exchange({})) { 40 | notifier->remove_callback(m_token); 41 | } 42 | } 43 | 44 | NotificationToken::NotificationToken(NotificationToken&&) = default; 45 | 46 | NotificationToken& NotificationToken::operator=(realm::NotificationToken&& rgt) 47 | { 48 | if (this != &rgt) { 49 | if (auto notifier = m_notifier.exchange({})) { 50 | notifier->remove_callback(m_token); 51 | } 52 | m_notifier = std::move(rgt.m_notifier); 53 | m_token = rgt.m_token; 54 | } 55 | return *this; 56 | } 57 | 58 | void NotificationToken::suppress_next() 59 | { 60 | m_notifier.load()->suppress_next_notification(m_token); 61 | } 62 | -------------------------------------------------------------------------------- /Pods/Realm/Realm/ObjectStore/src/impl/weak_realm_notifier.cpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2015 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #include "impl/weak_realm_notifier.hpp" 20 | 21 | #include "shared_realm.hpp" 22 | #include "util/event_loop_signal.hpp" 23 | 24 | using namespace realm; 25 | using namespace realm::_impl; 26 | 27 | 28 | WeakRealmNotifier::WeakRealmNotifier(const std::shared_ptr& realm, bool cache) 29 | : m_realm(realm) 30 | , m_execution_context(realm->config().execution_context) 31 | , m_realm_key(realm.get()) 32 | , m_cache(cache) 33 | , m_signal(std::make_shared>(Callback{realm})) 34 | { 35 | } 36 | 37 | WeakRealmNotifier::~WeakRealmNotifier() = default; 38 | 39 | void WeakRealmNotifier::Callback::operator()() const 40 | { 41 | if (auto realm = weak_realm.lock()) { 42 | realm->notify(); 43 | } 44 | } 45 | 46 | void WeakRealmNotifier::notify() 47 | { 48 | m_signal->notify(); 49 | } 50 | -------------------------------------------------------------------------------- /Pods/Realm/Realm/ObjectStore/src/placeholder.cpp: -------------------------------------------------------------------------------- 1 | // This file is intentionally left blank. 2 | -------------------------------------------------------------------------------- /Pods/Realm/Realm/ObjectStore/src/sync/impl/work_queue.cpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2018 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #include "sync/impl/work_queue.hpp" 20 | 21 | #include 22 | 23 | namespace realm { 24 | namespace _impl { 25 | namespace partial_sync { 26 | 27 | WorkQueue::~WorkQueue() 28 | { 29 | { 30 | std::unique_lock lock(m_mutex); 31 | m_stopping = true; 32 | } 33 | m_cv.notify_one(); 34 | 35 | if (m_thread.joinable()) 36 | m_thread.join(); 37 | } 38 | 39 | void WorkQueue::enqueue(std::function function) 40 | { 41 | { 42 | std::unique_lock lock(m_mutex); 43 | m_queue.push_back(std::move(function)); 44 | 45 | if (m_stopped) 46 | create_thread(); 47 | } 48 | m_cv.notify_one(); 49 | } 50 | 51 | void WorkQueue::create_thread() 52 | { 53 | if (m_thread.joinable()) 54 | m_thread.join(); 55 | 56 | m_thread = std::thread([this] { 57 | std::vector> queue; 58 | 59 | std::unique_lock lock(m_mutex); 60 | while (!m_stopping && 61 | m_cv.wait_for(lock, std::chrono::milliseconds(500), 62 | [&] { return !m_queue.empty() || m_stopping; })) { 63 | 64 | swap(queue, m_queue); 65 | 66 | lock.unlock(); 67 | for (auto& f : queue) 68 | f(); 69 | queue.clear(); 70 | lock.lock(); 71 | } 72 | 73 | m_stopped = true; 74 | }); 75 | m_stopped = false; 76 | } 77 | 78 | } // namespace partial_sync 79 | } // namespace _impl 80 | } // namespace realm 81 | -------------------------------------------------------------------------------- /Pods/Realm/Realm/ObjectStore/src/sync/sync_config.cpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2017 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #include "sync/sync_config.hpp" 20 | 21 | #include "sync/sync_manager.hpp" 22 | 23 | #include 24 | 25 | namespace realm { 26 | 27 | std::string SyncConfig::partial_sync_identifier(const SyncUser& user) 28 | { 29 | std::string raw_identifier = SyncManager::shared().client_uuid() + "/" + user.local_identity(); 30 | 31 | // The type of the argument to sha1() changed in sync 3.11.1. Implicitly 32 | // convert to either char or unsigned char so that both signatures work. 33 | struct cast { 34 | uint8_t* value; 35 | operator uint8_t*() { return value; } 36 | operator char*() { return reinterpret_cast(value); } 37 | }; 38 | uint8_t identifier[20]; 39 | sync::crypto::sha1(raw_identifier.data(), raw_identifier.size(), cast{&identifier[0]}); 40 | 41 | std::stringstream ss; 42 | ss << std::hex << std::setfill('0'); 43 | for (uint8_t c : identifier) 44 | ss << std::setw(2) << (unsigned)c; 45 | return ss.str(); 46 | } 47 | 48 | std::string SyncConfig::realm_url() const 49 | { 50 | REALM_ASSERT(reference_realm_url.length() > 0); 51 | REALM_ASSERT(user); 52 | 53 | if (!is_partial) 54 | return reference_realm_url; 55 | 56 | std::string base_url = reference_realm_url; 57 | if (base_url.back() == '/') 58 | base_url.pop_back(); 59 | 60 | if (custom_partial_sync_identifier) 61 | return util::format("%1/__partial/%2", base_url, *custom_partial_sync_identifier); 62 | return util::format("%1/__partial/%2/%3", base_url, user->identity(), partial_sync_identifier(*user)); 63 | } 64 | 65 | } // namespace realm 66 | -------------------------------------------------------------------------------- /Pods/Realm/Realm/RLMConstants.m: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2014 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import 20 | 21 | RLMNotification const RLMRealmRefreshRequiredNotification = @"RLMRealmRefreshRequiredNotification"; 22 | RLMNotification const RLMRealmDidChangeNotification = @"RLMRealmDidChangeNotification"; 23 | 24 | NSString * const RLMErrorDomain = @"io.realm"; 25 | 26 | NSString * const RLMUnknownSystemErrorDomain = @"io.realm.unknown"; 27 | 28 | NSString * const RLMExceptionName = @"RLMException"; 29 | 30 | NSString * const RLMRealmVersionKey = @"RLMRealmVersion"; 31 | 32 | NSString * const RLMRealmCoreVersionKey = @"RLMRealmCoreVersion"; 33 | 34 | NSString * const RLMInvalidatedKey = @"invalidated"; 35 | 36 | NSString * const RLMBackupRealmConfigurationErrorKey = @"RLMBackupRealmConfiguration"; 37 | -------------------------------------------------------------------------------- /Pods/Realm/Realm/RLMListBase.mm: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2015 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import "RLMListBase.h" 20 | 21 | #import "RLMArray_Private.hpp" 22 | #import "RLMObservation.hpp" 23 | 24 | @interface RLMArray (KVO) 25 | - (NSArray *)objectsAtIndexes:(__unused NSIndexSet *)indexes; 26 | @end 27 | 28 | @implementation RLMListBase { 29 | std::unique_ptr _observationInfo; 30 | } 31 | 32 | - (instancetype)initWithArray:(RLMArray *)array { 33 | self = [super init]; 34 | if (self) { 35 | __rlmArray = array; 36 | } 37 | return self; 38 | } 39 | 40 | - (id)valueForKey:(NSString *)key { 41 | return [__rlmArray valueForKey:key]; 42 | } 43 | 44 | - (id)valueForKeyPath:(NSString *)keyPath { 45 | return [__rlmArray valueForKeyPath:keyPath]; 46 | } 47 | 48 | - (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id __unsafe_unretained [])buffer count:(NSUInteger)len { 49 | return [__rlmArray countByEnumeratingWithState:state objects:buffer count:len]; 50 | } 51 | 52 | - (NSArray *)objectsAtIndexes:(NSIndexSet *)indexes { 53 | return [__rlmArray objectsAtIndexes:indexes]; 54 | } 55 | 56 | - (void)addObserver:(id)observer 57 | forKeyPath:(NSString *)keyPath 58 | options:(NSKeyValueObservingOptions)options 59 | context:(void *)context { 60 | RLMEnsureArrayObservationInfo(_observationInfo, keyPath, __rlmArray, self); 61 | [super addObserver:observer forKeyPath:keyPath options:options context:context]; 62 | } 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /Pods/Realm/Realm/RLMRealm+Sync.mm: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2017 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import "RLMRealm+Sync.h" 20 | 21 | #import "RLMObjectBase.h" 22 | #import "RLMObjectSchema.h" 23 | #import "RLMRealm_Private.hpp" 24 | #import "RLMResults_Private.hpp" 25 | #import "RLMSchema.h" 26 | #import "RLMSyncSession.h" 27 | 28 | #import "results.hpp" 29 | #import "sync/partial_sync.hpp" 30 | #import "shared_realm.hpp" 31 | 32 | using namespace realm; 33 | 34 | @implementation RLMRealm (Sync) 35 | 36 | - (void)subscribeToObjects:(Class)type where:(NSString *)query callback:(RLMPartialSyncFetchCallback)callback { 37 | NSString *className = [type className]; 38 | auto cb = [=](Results results, std::exception_ptr err) { 39 | if (err) { 40 | try { 41 | rethrow_exception(err); 42 | } 43 | catch (...) { 44 | NSError *error = nil; 45 | RLMRealmTranslateException(&error); 46 | callback(nil, error); 47 | } 48 | return; 49 | } 50 | callback([RLMResults resultsWithObjectInfo:_info[className] results:std::move(results)], nil); 51 | }; 52 | partial_sync::register_query(_realm, className.UTF8String, query.UTF8String, std::move(cb)); 53 | } 54 | 55 | - (RLMSyncSession *)syncSession { 56 | return [RLMSyncSession sessionForRealm:self]; 57 | } 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /Pods/Realm/Realm/RLMSwiftSupport.m: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2014 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import "RLMSwiftSupport.h" 20 | 21 | @implementation RLMSwiftSupport 22 | 23 | + (BOOL)isSwiftClassName:(NSString *)className { 24 | return [className rangeOfString:@"."].location != NSNotFound; 25 | } 26 | 27 | + (NSString *)demangleClassName:(NSString *)className { 28 | return [className substringFromIndex:[className rangeOfString:@"."].location + 1]; 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Pods/Realm/Realm/Realm.modulemap: -------------------------------------------------------------------------------- 1 | framework module Realm { 2 | umbrella header "Realm.h" 3 | 4 | export * 5 | module * { export * } 6 | 7 | explicit module Private { 8 | header "RLMAccessor.h" 9 | header "RLMArray_Private.h" 10 | header "RLMCollection_Private.h" 11 | header "RLMListBase.h" 12 | header "RLMObject_Private.h" 13 | header "RLMObjectBase_Dynamic.h" 14 | header "RLMObjectBase_Private.h" 15 | header "RLMObjectSchema_Private.h" 16 | header "RLMObjectStore.h" 17 | header "RLMOptionalBase.h" 18 | header "RLMProperty_Private.h" 19 | header "RLMRealm_Private.h" 20 | header "RLMRealmConfiguration_Private.h" 21 | header "RLMResults_Private.h" 22 | header "RLMSchema_Private.h" 23 | header "RLMSyncConfiguration_Private.h" 24 | header "RLMSyncUtil_Private.h" 25 | } 26 | 27 | explicit module Dynamic { 28 | header "RLMRealm_Dynamic.h" 29 | header "RLMObjectBase_Dynamic.h" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Pods/Realm/core/librealmcore-ios.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yokurin/RealmSwiftService/c4f886ec10952f8fba8f35b5bf5824f44c434ff6/Pods/Realm/core/librealmcore-ios.a -------------------------------------------------------------------------------- /Pods/Realm/include/NSError+RLMSync.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2017 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import 20 | 21 | NS_ASSUME_NONNULL_BEGIN 22 | 23 | @class RLMSyncErrorActionToken; 24 | 25 | /// NSError category extension providing methods to get data out of Realm's 26 | /// "client reset" error. 27 | @interface NSError (RLMSync) 28 | 29 | /** 30 | Given an appropriate Realm Object Server error, return the token that 31 | can be passed into `+[RLMSyncSession immediatelyHandleError:]` to 32 | immediately perform error clean-up work, or nil if the error isn't of 33 | a type that provides a token. 34 | */ 35 | - (nullable RLMSyncErrorActionToken *)rlmSync_errorActionToken NS_REFINED_FOR_SWIFT; 36 | 37 | /** 38 | Given a Realm Object Server client reset error, return the path where the 39 | backup copy of the Realm will be placed once the client reset process is 40 | complete. 41 | */ 42 | - (nullable NSString *)rlmSync_clientResetBackedUpRealmPath NS_SWIFT_UNAVAILABLE(""); 43 | 44 | @end 45 | 46 | NS_ASSUME_NONNULL_END 47 | -------------------------------------------------------------------------------- /Pods/Realm/include/RLMAccessor.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2014 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import 20 | 21 | @class RLMObjectSchema, RLMProperty, RLMObjectBase; 22 | 23 | NS_ASSUME_NONNULL_BEGIN 24 | 25 | // 26 | // Accessors Class Creation/Caching 27 | // 28 | 29 | // get accessor classes for an object class - generates classes if not cached 30 | Class RLMManagedAccessorClassForObjectClass(Class objectClass, RLMObjectSchema *schema, const char *name); 31 | Class RLMUnmanagedAccessorClassForObjectClass(Class objectClass, RLMObjectSchema *schema); 32 | 33 | // 34 | // Dynamic getters/setters 35 | // 36 | FOUNDATION_EXTERN void RLMDynamicValidatedSet(RLMObjectBase *obj, NSString *propName, id __nullable val); 37 | FOUNDATION_EXTERN id __nullable RLMDynamicGet(RLMObjectBase *obj, RLMProperty *prop); 38 | FOUNDATION_EXTERN id __nullable RLMDynamicGetByName(RLMObjectBase *obj, NSString *propName, bool asList); 39 | 40 | // by property/column 41 | void RLMDynamicSet(RLMObjectBase *obj, RLMProperty *prop, id val); 42 | 43 | // 44 | // Class modification 45 | // 46 | 47 | // Replace className method for the given class 48 | void RLMReplaceClassNameMethod(Class accessorClass, NSString *className); 49 | 50 | // Replace sharedSchema method for the given class 51 | void RLMReplaceSharedSchemaMethod(Class accessorClass, RLMObjectSchema * __nullable schema); 52 | 53 | NS_ASSUME_NONNULL_END 54 | -------------------------------------------------------------------------------- /Pods/Realm/include/RLMArray_Private.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2014 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import 20 | #import 21 | 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | @interface RLMArray () 25 | - (instancetype)initWithObjectClassName:(NSString *)objectClassName; 26 | - (instancetype)initWithObjectType:(RLMPropertyType)type optional:(BOOL)optional; 27 | - (NSString *)descriptionWithMaxDepth:(NSUInteger)depth; 28 | @end 29 | 30 | void RLMArrayValidateMatchingObjectType(RLMArray *array, id value); 31 | 32 | NS_ASSUME_NONNULL_END 33 | -------------------------------------------------------------------------------- /Pods/Realm/include/RLMCollection_Private.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2016 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import 20 | 21 | #import 22 | 23 | @protocol RLMFastEnumerable; 24 | 25 | void RLMCollectionSetValueForKey(id collection, NSString *key, id value); 26 | FOUNDATION_EXTERN NSString *RLMDescriptionWithMaxDepth(NSString *name, id collection, NSUInteger depth); 27 | -------------------------------------------------------------------------------- /Pods/Realm/include/RLMListBase.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2014 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import 20 | 21 | @class RLMArray; 22 | 23 | NS_ASSUME_NONNULL_BEGIN 24 | 25 | // A base class for Swift generic Lists to make it possible to interact with 26 | // them from obj-c 27 | @interface RLMListBase : NSObject 28 | @property (nonatomic, strong) RLMArray *_rlmArray; 29 | 30 | - (instancetype)initWithArray:(RLMArray *)array; 31 | @end 32 | 33 | NS_ASSUME_NONNULL_END 34 | -------------------------------------------------------------------------------- /Pods/Realm/include/RLMMigration_Private.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2014 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import 20 | #import 21 | #import 22 | 23 | namespace realm { 24 | class Schema; 25 | } 26 | 27 | NS_ASSUME_NONNULL_BEGIN 28 | 29 | @interface RLMMigration () 30 | 31 | @property (nonatomic, strong) RLMRealm *oldRealm; 32 | @property (nonatomic, strong) RLMRealm *realm; 33 | 34 | - (instancetype)initWithRealm:(RLMRealm *)realm oldRealm:(RLMRealm *)oldRealm schema:(realm::Schema &)schema; 35 | 36 | - (void)execute:(RLMMigrationBlock)block; 37 | 38 | @end 39 | 40 | NS_ASSUME_NONNULL_END 41 | -------------------------------------------------------------------------------- /Pods/Realm/include/RLMObjectBase.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2014 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import 20 | 21 | NS_ASSUME_NONNULL_BEGIN 22 | 23 | @class RLMRealm; 24 | @class RLMSchema; 25 | @class RLMObjectSchema; 26 | 27 | /// :nodoc: 28 | @interface RLMObjectBase : NSObject 29 | 30 | @property (nonatomic, readonly, getter = isInvalidated) BOOL invalidated; 31 | 32 | - (instancetype)init NS_DESIGNATED_INITIALIZER; 33 | 34 | + (NSString *)className; 35 | 36 | // Returns whether the class is included in the default set of classes managed by a Realm. 37 | + (BOOL)shouldIncludeInDefaultSchema; 38 | 39 | + (nullable NSString *)_realmObjectName; 40 | + (nullable NSDictionary *)_realmColumnNames; 41 | 42 | @end 43 | 44 | NS_ASSUME_NONNULL_END 45 | -------------------------------------------------------------------------------- /Pods/Realm/include/RLMObjectBase_Private.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2017 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import 20 | 21 | NS_ASSUME_NONNULL_BEGIN 22 | 23 | // RLMObjectBase private 24 | @interface RLMObjectBase () 25 | + (void)initializeLinkedObjectSchemas; 26 | @end 27 | 28 | NS_ASSUME_NONNULL_END 29 | -------------------------------------------------------------------------------- /Pods/Realm/include/RLMObjectSchema.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2014 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import 20 | 21 | NS_ASSUME_NONNULL_BEGIN 22 | 23 | @class RLMProperty; 24 | 25 | /** 26 | This class represents Realm model object schemas. 27 | 28 | When using Realm, `RLMObjectSchema` instances allow performing migrations and 29 | introspecting the database's schema. 30 | 31 | Object schemas map to tables in the core database. 32 | */ 33 | @interface RLMObjectSchema : NSObject 34 | 35 | #pragma mark - Properties 36 | 37 | /** 38 | An array of `RLMProperty` instances representing the managed properties of a class described by the schema. 39 | 40 | @see `RLMProperty` 41 | */ 42 | @property (nonatomic, readonly, copy) NSArray *properties; 43 | 44 | /** 45 | The name of the class the schema describes. 46 | */ 47 | @property (nonatomic, readonly) NSString *className; 48 | 49 | /** 50 | The property which serves as the primary key for the class the schema describes, if any. 51 | */ 52 | @property (nonatomic, readonly, nullable) RLMProperty *primaryKeyProperty; 53 | 54 | #pragma mark - Methods 55 | 56 | /** 57 | Retrieves an `RLMProperty` object by the property name. 58 | 59 | @param propertyName The property's name. 60 | 61 | @return An `RLMProperty` object, or `nil` if there is no property with the given name. 62 | */ 63 | - (nullable RLMProperty *)objectForKeyedSubscript:(NSString *)propertyName; 64 | 65 | /** 66 | Returns whether two `RLMObjectSchema` instances are equal. 67 | */ 68 | - (BOOL)isEqualToObjectSchema:(RLMObjectSchema *)objectSchema; 69 | 70 | @end 71 | 72 | NS_ASSUME_NONNULL_END 73 | -------------------------------------------------------------------------------- /Pods/Realm/include/RLMObjectSchema_Private.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2014 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import "RLMObjectSchema_Private.h" 20 | 21 | namespace realm { 22 | class ObjectSchema; 23 | } 24 | @class RLMSchema; 25 | 26 | @interface RLMObjectSchema () 27 | // create realm::ObjectSchema copy 28 | - (realm::ObjectSchema)objectStoreCopy:(RLMSchema *)schema; 29 | 30 | // initialize with realm::ObjectSchema 31 | + (instancetype)objectSchemaForObjectStoreSchema:(realm::ObjectSchema const&)objectSchema; 32 | @end 33 | 34 | // An objc_ivar pointer which is guaranteed to not point to any actually-existing 35 | // ivar. Used as part of https://github.com/realm/realm-cocoa/issues/5784 36 | extern const Ivar RLMDummySwiftIvar; 37 | -------------------------------------------------------------------------------- /Pods/Realm/include/RLMObject_Private.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2014 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import "RLMObject_Private.h" 20 | 21 | #import "RLMRealm_Private.hpp" 22 | #import "RLMUtil.hpp" 23 | 24 | #import // required by row.hpp 25 | #import 26 | 27 | class RLMObservationInfo; 28 | 29 | // RLMObject accessor and read/write realm 30 | @interface RLMObjectBase () { 31 | @public 32 | realm::Row _row; 33 | RLMObservationInfo *_observationInfo; 34 | RLMClassInfo *_info; 35 | } 36 | @end 37 | 38 | // FIXME-2.0: This should be folded into initWithRealm:schema:, but changing the 39 | // signature of that is a breaking change for Swift 40 | id RLMCreateManagedAccessor(Class cls, RLMRealm *realm, RLMClassInfo *info) NS_RETURNS_RETAINED; 41 | 42 | // throw an exception if the object is invalidated or on the wrong thread 43 | static inline void RLMVerifyAttached(__unsafe_unretained RLMObjectBase *const obj) { 44 | if (!obj->_row.is_attached()) { 45 | @throw RLMException(@"Object has been deleted or invalidated."); 46 | } 47 | [obj->_realm verifyThread]; 48 | } 49 | 50 | // throw an exception if the object can't be modified for any reason 51 | static inline void RLMVerifyInWriteTransaction(__unsafe_unretained RLMObjectBase *const obj) { 52 | // first verify is attached 53 | RLMVerifyAttached(obj); 54 | 55 | if (!obj->_realm.inWriteTransaction) { 56 | @throw RLMException(@"Attempting to modify object outside of a write transaction - call beginWriteTransaction on an RLMRealm instance first."); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Pods/Realm/include/RLMOptionalBase.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2015 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import 20 | #import 21 | 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | @class RLMObjectBase, RLMProperty; 25 | 26 | @interface RLMOptionalBase : NSProxy 27 | - (instancetype)init; 28 | @end 29 | 30 | FOUNDATION_EXTERN id _Nullable RLMGetOptional(RLMOptionalBase *); 31 | FOUNDATION_EXTERN void RLMSetOptional(RLMOptionalBase *, id _Nullable); 32 | 33 | void RLMInitializeManagedOptional(RLMOptionalBase *, RLMObjectBase *parent, RLMProperty *prop); 34 | void RLMInitializeUnmanagedOptional(RLMOptionalBase *, RLMObjectBase *parent, RLMProperty *prop); 35 | 36 | NS_ASSUME_NONNULL_END 37 | -------------------------------------------------------------------------------- /Pods/Realm/include/RLMPlatform.h: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Pods/Realm/include/RLMPredicateUtil.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2015 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | 18 | #import 19 | #import 20 | 21 | using ExpressionVisitor = std::function; 22 | NSPredicate *transformPredicate(NSPredicate *, ExpressionVisitor); 23 | -------------------------------------------------------------------------------- /Pods/Realm/include/RLMPrefix.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2015 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #ifdef __OBJC__ 20 | #import 21 | #endif 22 | 23 | #ifdef __cplusplus 24 | #import 25 | #import 26 | #import 27 | #import 28 | #import 29 | 30 | #import 31 | #import 32 | #import 33 | #import 34 | #import 35 | #endif 36 | -------------------------------------------------------------------------------- /Pods/Realm/include/RLMProperty_Private.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2016 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import 20 | 21 | namespace realm { 22 | struct Property; 23 | } 24 | 25 | @class RLMSchema; 26 | 27 | @interface RLMProperty () 28 | 29 | + (instancetype)propertyForObjectStoreProperty:(const realm::Property&)property; 30 | 31 | - (realm::Property)objectStoreCopy:(RLMSchema *)schema; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Pods/Realm/include/RLMQueryUtil.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2014 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import 20 | 21 | #import 22 | 23 | namespace realm { 24 | class Group; 25 | class Query; 26 | class SortDescriptor; 27 | } 28 | 29 | @class RLMObjectSchema, RLMProperty, RLMSchema, RLMSortDescriptor; 30 | class RLMClassInfo; 31 | 32 | extern NSString * const RLMPropertiesComparisonTypeMismatchException; 33 | extern NSString * const RLMUnsupportedTypesFoundInPropertyComparisonException; 34 | 35 | realm::Query RLMPredicateToQuery(NSPredicate *predicate, RLMObjectSchema *objectSchema, 36 | RLMSchema *schema, realm::Group &group); 37 | 38 | // return property - throw for invalid column name 39 | RLMProperty *RLMValidatedProperty(RLMObjectSchema *objectSchema, NSString *columnName); 40 | -------------------------------------------------------------------------------- /Pods/Realm/include/RLMRealm+Sync.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2017 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import 20 | 21 | #import "RLMRealm.h" 22 | 23 | @class RLMResults, RLMSyncSession; 24 | 25 | /** 26 | A callback used to vend the results of a partial sync fetch. 27 | */ 28 | typedef void(^RLMPartialSyncFetchCallback)(RLMResults * _Nullable results, NSError * _Nullable error); 29 | 30 | NS_ASSUME_NONNULL_BEGIN 31 | 32 | /// 33 | @interface RLMRealm (Sync) 34 | 35 | /** 36 | If the Realm is a partially synchronized Realm, fetch and synchronize the objects 37 | of a given object type that match the given query (in string format). 38 | 39 | The results will be returned asynchronously in the callback. 40 | Use `-[RLMResults addNotificationBlock:]` to be notified to changes to the set of 41 | synchronized objects. 42 | 43 | @warning Partial synchronization is a tech preview. Its APIs are subject to change. 44 | */ 45 | - (void)subscribeToObjects:(Class)type where:(NSString *)query callback:(RLMPartialSyncFetchCallback)callback 46 | __deprecated_msg("Use -[RLMResults subscribe]"); 47 | 48 | /** 49 | Get the RLMSyncSession used by this Realm. Will be nil if this is not a 50 | synchronized Realm. 51 | */ 52 | @property (nonatomic, nullable, readonly) RLMSyncSession *syncSession; 53 | 54 | @end 55 | 56 | NS_ASSUME_NONNULL_END 57 | -------------------------------------------------------------------------------- /Pods/Realm/include/RLMRealmConfiguration+Sync.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2016 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import 20 | 21 | #import "RLMSyncUtil.h" 22 | 23 | @class RLMSyncConfiguration; 24 | 25 | /// Realm configuration options related to Sync. 26 | @interface RLMRealmConfiguration (Sync) 27 | 28 | NS_ASSUME_NONNULL_BEGIN 29 | 30 | /** 31 | A configuration object representing configuration state for Realms intended 32 | to sync with a Realm Object Server. 33 | 34 | This property is mutually exclusive with both `inMemoryIdentifier` and `fileURL`; 35 | setting any one of the three properties will automatically nil out the other two. 36 | 37 | @see `RLMSyncConfiguration` 38 | */ 39 | @property (nullable, nonatomic) RLMSyncConfiguration *syncConfiguration; 40 | 41 | NS_ASSUME_NONNULL_END 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Pods/Realm/include/RLMRealmConfiguration_Private.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2015 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import 20 | 21 | @class RLMSchema; 22 | 23 | NS_ASSUME_NONNULL_BEGIN 24 | 25 | @interface RLMRealmConfiguration () 26 | 27 | @property (nonatomic, readwrite) bool cache; 28 | @property (nonatomic, readwrite) bool dynamic; 29 | @property (nonatomic, readwrite) bool disableFormatUpgrade; 30 | @property (nonatomic, copy, nullable) RLMSchema *customSchema; 31 | @property (nonatomic, copy) NSString *pathOnDisk; 32 | 33 | // Get the default confiugration without copying it 34 | + (RLMRealmConfiguration *)rawDefaultConfiguration; 35 | 36 | + (void)resetRealmConfigurationState; 37 | 38 | - (void)setCustomSchemaWithoutCopying:(nullable RLMSchema *)schema; 39 | @end 40 | 41 | // Get a path in the platform-appropriate documents directory with the given filename 42 | FOUNDATION_EXTERN NSString *RLMRealmPathForFile(NSString *fileName); 43 | FOUNDATION_EXTERN NSString *RLMRealmPathForFileAndBundleIdentifier(NSString *fileName, NSString *mainBundleIdentifier); 44 | 45 | NS_ASSUME_NONNULL_END 46 | -------------------------------------------------------------------------------- /Pods/Realm/include/RLMRealmConfiguration_Private.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2014 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import "RLMRealmConfiguration_Private.h" 20 | #import "shared_realm.hpp" 21 | 22 | @interface RLMRealmConfiguration () 23 | - (realm::Realm::Config&)config; 24 | 25 | @property (nonatomic) realm::SchemaMode schemaMode; 26 | @end 27 | -------------------------------------------------------------------------------- /Pods/Realm/include/RLMRealmUtil.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2014 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import 20 | #import 21 | 22 | @class RLMRealm; 23 | 24 | namespace realm { 25 | class BindingContext; 26 | } 27 | 28 | // Add a Realm to the weak cache 29 | void RLMCacheRealm(std::string const& path, RLMRealm *realm); 30 | // Get a Realm for the given path which can be used on the current thread 31 | RLMRealm *RLMGetThreadLocalCachedRealmForPath(std::string const& path); 32 | // Get a Realm for the given path 33 | RLMRealm *RLMGetAnyCachedRealmForPath(std::string const& path); 34 | // Clear the weak cache of Realms 35 | void RLMClearRealmCache(); 36 | // Check if the current thread is currently within a running CFRunLoop 37 | bool RLMIsInRunLoop(); 38 | 39 | std::unique_ptr RLMCreateBindingContext(RLMRealm *realm); 40 | -------------------------------------------------------------------------------- /Pods/Realm/include/RLMRealm_Private.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2014 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import 20 | 21 | @class RLMFastEnumerator; 22 | 23 | NS_ASSUME_NONNULL_BEGIN 24 | 25 | // Disable syncing files to disk. Cannot be re-enabled. Use only for tests. 26 | FOUNDATION_EXTERN void RLMDisableSyncToDisk(void); 27 | 28 | FOUNDATION_EXTERN NSData * _Nullable RLMRealmValidatedEncryptionKey(NSData *key); 29 | 30 | // Translate an in-flight exception resulting from an operation on a SharedGroup to 31 | // an NSError or NSException (if error is nil) 32 | void RLMRealmTranslateException(NSError **error); 33 | 34 | // RLMRealm private members 35 | @interface RLMRealm () 36 | 37 | @property (nonatomic, readonly) BOOL dynamic; 38 | @property (nonatomic, readwrite) RLMSchema *schema; 39 | 40 | + (void)resetRealmState; 41 | 42 | - (void)registerEnumerator:(RLMFastEnumerator *)enumerator; 43 | - (void)unregisterEnumerator:(RLMFastEnumerator *)enumerator; 44 | - (void)detachAllEnumerators; 45 | 46 | - (void)sendNotifications:(RLMNotification)notification; 47 | - (void)verifyThread; 48 | - (void)verifyNotificationsAreSupported:(bool)isCollection; 49 | 50 | @end 51 | 52 | NS_ASSUME_NONNULL_END 53 | -------------------------------------------------------------------------------- /Pods/Realm/include/RLMRealm_Private.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2014 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import "RLMRealm_Private.h" 20 | 21 | #import "RLMClassInfo.hpp" 22 | 23 | namespace realm { 24 | class Group; 25 | class Realm; 26 | } 27 | 28 | @interface RLMRealm () { 29 | @public 30 | std::shared_ptr _realm; 31 | RLMSchemaInfo _info; 32 | } 33 | 34 | // FIXME - group should not be exposed 35 | @property (nonatomic, readonly) realm::Group &group; 36 | @end 37 | -------------------------------------------------------------------------------- /Pods/Realm/include/RLMResults_Private.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2014 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import 20 | 21 | @class RLMObjectSchema; 22 | 23 | NS_ASSUME_NONNULL_BEGIN 24 | 25 | @interface RLMResults () 26 | @property (nonatomic, readonly, getter=isAttached) BOOL attached; 27 | 28 | + (instancetype)emptyDetachedResults; 29 | 30 | @end 31 | 32 | NS_ASSUME_NONNULL_END 33 | -------------------------------------------------------------------------------- /Pods/Realm/include/RLMResults_Private.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2017 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import "RLMResults_Private.h" 20 | 21 | #import "results.hpp" 22 | 23 | class RLMClassInfo; 24 | 25 | NS_ASSUME_NONNULL_BEGIN 26 | 27 | @interface RLMResults () { 28 | @protected 29 | realm::Results _results; 30 | } 31 | 32 | /** 33 | Initialize a 'raw' `RLMResults` using only an object store level Results. 34 | This is only meant for applications where a results collection is being backed 35 | by an object store object class that has no binding-level equivalent. The 36 | consumer is responsible for bridging between the underlying objects and whatever 37 | binding-level class is being vended out. 38 | */ 39 | - (instancetype)initWithResults:(realm::Results)results; 40 | 41 | + (instancetype)resultsWithObjectInfo:(RLMClassInfo&)info results:(realm::Results)results; 42 | @end 43 | 44 | NS_ASSUME_NONNULL_END 45 | 46 | // Utility functions 47 | 48 | [[gnu::noinline]] 49 | [[noreturn]] 50 | void RLMThrowResultsError(NSString * _Nullable aggregateMethod); 51 | 52 | #pragma clang diagnostic push 53 | #pragma clang diagnostic ignored "-Wnullability-completeness" 54 | template 55 | static auto translateRLMResultsErrors(Function&& f, NSString *aggregateMethod=nil) { 56 | try { 57 | return f(); 58 | } 59 | catch (...) { 60 | RLMThrowResultsError(aggregateMethod); 61 | } 62 | } 63 | #pragma clang diagnostic pop 64 | -------------------------------------------------------------------------------- /Pods/Realm/include/RLMSchema_Private.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2014 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import 20 | 21 | NS_ASSUME_NONNULL_BEGIN 22 | 23 | @class RLMRealm; 24 | 25 | // 26 | // RLMSchema private interface 27 | // 28 | @interface RLMSchema () 29 | 30 | /** 31 | Returns an `RLMSchema` containing only the given `RLMObject` subclasses. 32 | 33 | @param classes The classes to be included in the schema. 34 | 35 | @return An `RLMSchema` containing only the given classes. 36 | */ 37 | + (instancetype)schemaWithObjectClasses:(NSArray *)classes; 38 | 39 | @property (nonatomic, readwrite, copy) NSArray *objectSchema; 40 | 41 | // schema based on runtime objects 42 | + (instancetype)sharedSchema; 43 | 44 | // schema based upon all currently registered object classes 45 | + (instancetype)partialSharedSchema; 46 | 47 | // private schema based upon all currently registered object classes. 48 | // includes classes that are excluded from the default schema. 49 | + (instancetype)partialPrivateSharedSchema; 50 | 51 | // class for string 52 | + (nullable Class)classForString:(NSString *)className; 53 | 54 | + (nullable RLMObjectSchema *)sharedSchemaForClass:(Class)cls; 55 | 56 | @end 57 | 58 | NS_ASSUME_NONNULL_END 59 | -------------------------------------------------------------------------------- /Pods/Realm/include/RLMSchema_Private.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2015 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import "RLMSchema_Private.h" 20 | 21 | #import 22 | 23 | namespace realm { 24 | class Schema; 25 | class ObjectSchema; 26 | } 27 | 28 | @interface RLMSchema () 29 | + (instancetype)dynamicSchemaFromObjectStoreSchema:(realm::Schema const&)objectStoreSchema; 30 | - (realm::Schema)objectStoreCopy; 31 | @end 32 | -------------------------------------------------------------------------------- /Pods/Realm/include/RLMSwiftBridgingHeader.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2014 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import 20 | #import 21 | 22 | @interface RLMRealm (Swift) 23 | + (void)resetRealmState; 24 | @end 25 | 26 | @interface RLMArray (Swift) 27 | 28 | - (instancetype)initWithObjectClassName:(NSString *)objectClassName; 29 | 30 | - (NSUInteger)indexOfObjectWhere:(NSString *)predicateFormat args:(va_list)args; 31 | - (RLMResults *)objectsWhere:(NSString *)predicateFormat args:(va_list)args; 32 | 33 | @end 34 | 35 | @interface RLMResults (Swift) 36 | 37 | - (NSUInteger)indexOfObjectWhere:(NSString *)predicateFormat args:(va_list)args; 38 | - (RLMResults *)objectsWhere:(NSString *)predicateFormat args:(va_list)args; 39 | 40 | @end 41 | 42 | @interface RLMObjectBase (Swift) 43 | 44 | - (instancetype)initWithRealm:(RLMRealm *)realm schema:(RLMObjectSchema *)schema defaultValues:(BOOL)useDefaults; 45 | 46 | + (RLMResults *)objectsWhere:(NSString *)predicateFormat args:(va_list)args; 47 | + (RLMResults *)objectsInRealm:(RLMRealm *)realm where:(NSString *)predicateFormat args:(va_list)args; 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /Pods/Realm/include/RLMSwiftSupport.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2014 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import 20 | 21 | NS_ASSUME_NONNULL_BEGIN 22 | 23 | @interface RLMSwiftSupport : NSObject 24 | 25 | + (BOOL)isSwiftClassName:(NSString *)className; 26 | + (NSString *)demangleClassName:(NSString *)className; 27 | 28 | @end 29 | 30 | NS_ASSUME_NONNULL_END 31 | -------------------------------------------------------------------------------- /Pods/Realm/include/RLMSyncConfiguration_Private.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2016 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import 20 | 21 | NS_ASSUME_NONNULL_BEGIN 22 | 23 | typedef NS_ENUM(NSUInteger, RLMSyncStopPolicy) { 24 | RLMSyncStopPolicyImmediately, 25 | RLMSyncStopPolicyLiveIndefinitely, 26 | RLMSyncStopPolicyAfterChangesUploaded, 27 | }; 28 | 29 | @interface RLMSyncConfiguration () 30 | 31 | - (instancetype)initWithUser:(RLMSyncUser *)user 32 | realmURL:(NSURL *)url 33 | isPartial:(BOOL)isPartial 34 | urlPrefix:(nullable NSString *)urlPrefix 35 | stopPolicy:(RLMSyncStopPolicy)stopPolicy 36 | enableSSLValidation:(BOOL)enableSSLValidation 37 | certificatePath:(nullable NSURL *)certificatePath; 38 | 39 | @property (nonatomic, readwrite) RLMSyncStopPolicy stopPolicy; 40 | 41 | // Internal-only APIs 42 | @property (nullable, nonatomic) NSURL *customFileURL; 43 | 44 | @end 45 | 46 | NS_ASSUME_NONNULL_END 47 | -------------------------------------------------------------------------------- /Pods/Realm/include/RLMSyncConfiguration_Private.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2016 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import "RLMSyncConfiguration_Private.h" 20 | 21 | #import 22 | #import 23 | 24 | namespace realm { 25 | class SyncSession; 26 | struct SyncConfig; 27 | struct SyncError; 28 | using SyncSessionErrorHandler = void(std::shared_ptr, SyncError); 29 | } 30 | 31 | NS_ASSUME_NONNULL_BEGIN 32 | 33 | @interface RLMSyncConfiguration () 34 | 35 | - (instancetype)initWithUser:(RLMSyncUser *)user 36 | realmURL:(NSURL *)url 37 | customFileURL:(nullable NSURL *)customFileURL 38 | isPartial:(BOOL)isPartial 39 | stopPolicy:(RLMSyncStopPolicy)stopPolicy 40 | errorHandler:(std::function)errorHandler; 41 | 42 | - (instancetype)initWithRawConfig:(realm::SyncConfig)config; 43 | 44 | - (realm::SyncConfig)rawConfiguration; 45 | 46 | @end 47 | 48 | NS_ASSUME_NONNULL_END 49 | -------------------------------------------------------------------------------- /Pods/Realm/include/RLMSyncManager_Private.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2016 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import 20 | 21 | #import "RLMSyncUtil_Private.h" 22 | #import "RLMNetworkClient.h" 23 | 24 | @class RLMSyncUser, RLMSyncConfiguration; 25 | 26 | // All private API methods are threadsafe and synchronized, unless denoted otherwise. Since they are expected to be 27 | // called very infrequently, this should pose no issues. 28 | 29 | NS_ASSUME_NONNULL_BEGIN 30 | 31 | @interface RLMSyncManager () 32 | 33 | @property (nullable, nonatomic, copy) RLMSyncBasicErrorReportingBlock sessionCompletionNotifier; 34 | 35 | - (void)_fireError:(NSError *)error; 36 | 37 | - (void)_fireErrorWithCode:(int)errorCode 38 | message:(NSString *)message 39 | isFatal:(BOOL)fatal 40 | session:(RLMSyncSession *)session 41 | userInfo:(NSDictionary *)userInfo 42 | errorClass:(RLMSyncSystemErrorKind)errorClass; 43 | 44 | - (NSArray *)_allUsers; 45 | 46 | + (void)resetForTesting; 47 | 48 | - (RLMNetworkRequestOptions *)networkRequestOptions; 49 | 50 | NS_ASSUME_NONNULL_END 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /Pods/Realm/include/RLMSyncPermissionResults.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2017 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import 20 | 21 | #import "RLMResults.h" 22 | 23 | @class RLMSyncPermission; 24 | 25 | // A private subclass of `RLMResults`. 26 | @interface RLMSyncPermissionResults : RLMResults 27 | @end 28 | -------------------------------------------------------------------------------- /Pods/Realm/include/RLMSyncPermission_Private.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2017 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import "RLMSyncPermission.h" 20 | 21 | #import "sync/sync_permission.hpp" 22 | 23 | @interface RLMSyncPermission () 24 | 25 | - (instancetype)initWithPermission:(realm::Permission)permission; 26 | 27 | - (realm::Permission)rawPermission; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Pods/Realm/include/RLMSyncSessionRefreshHandle.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2017 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import 20 | 21 | @class RLMSyncUser; 22 | 23 | /// An object that handles refreshing a session's token periodically, as long 24 | /// as the session remains live and valid. 25 | @interface RLMSyncSessionRefreshHandle : NSObject 26 | 27 | - (void)scheduleRefreshTimer:(NSDate *)dateWhenTokenExpires; 28 | - (void)invalidate; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Pods/Realm/include/RLMSyncSessionRefreshHandle.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2016 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import "RLMSyncSessionRefreshHandle.h" 20 | 21 | #import "RLMSyncUtil_Private.h" 22 | 23 | #import 24 | 25 | namespace realm { 26 | class SyncSession; 27 | class SyncUser; 28 | } 29 | 30 | @class RLMSyncUser; 31 | 32 | @interface RLMSyncSessionRefreshHandle () 33 | 34 | NS_ASSUME_NONNULL_BEGIN 35 | 36 | - (instancetype)initWithRealmURL:(NSURL *)realmURL 37 | user:(std::shared_ptr)user 38 | session:(std::shared_ptr)session 39 | completionBlock:(nullable RLMSyncBasicErrorReportingBlock)completionBlock; 40 | 41 | NS_ASSUME_NONNULL_END 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Pods/Realm/include/RLMSyncSession_Private.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2016 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import "RLMSyncSession.h" 20 | 21 | #import "RLMSyncUtil_Private.h" 22 | #import 23 | 24 | namespace realm { 25 | class SyncSession; 26 | } 27 | 28 | NS_ASSUME_NONNULL_BEGIN 29 | 30 | @interface RLMSyncSession () { 31 | @public // So it's visible to tests 32 | std::weak_ptr _session; 33 | } RLM_SYNC_UNINITIALIZABLE 34 | 35 | - (instancetype)initWithSyncSession:(std::shared_ptr const&)session; 36 | 37 | /// Wait for pending uploads to complete or the session to expire, and dispatch the callback onto the specified queue. 38 | - (BOOL)waitForUploadCompletionOnQueue:(nullable dispatch_queue_t)queue callback:(void(^)(NSError * _Nullable))callback; 39 | 40 | /// Wait for pending downloads to complete or the session to expire, and dispatch the callback onto the specified queue. 41 | - (BOOL)waitForDownloadCompletionOnQueue:(nullable dispatch_queue_t)queue callback:(void(^)(NSError * _Nullable))callback; 42 | 43 | @end 44 | 45 | @interface RLMSyncErrorActionToken () 46 | 47 | - (instancetype)initWithOriginalPath:(std::string)originalPath; 48 | 49 | @end 50 | 51 | NS_ASSUME_NONNULL_END 52 | -------------------------------------------------------------------------------- /Pods/Realm/include/RLMThreadSafeReference_Private.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2016 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import "RLMThreadSafeReference.h" 20 | #import "thread_safe_reference.hpp" 21 | 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | @protocol RLMThreadConfined_Private 25 | 26 | // Constructs a new `ThreadSafeReference` 27 | - (std::unique_ptr)makeThreadSafeReference; 28 | 29 | // The extra information needed to construct an instance of this type from the Object Store type 30 | @property (nonatomic, readonly, nullable) id objectiveCMetadata; 31 | 32 | // Constructs an new instance of this type 33 | + (nullable instancetype)objectWithThreadSafeReference:(std::unique_ptr)reference 34 | metadata:(nullable id)metadata 35 | realm:(RLMRealm *)realm; 36 | @end 37 | 38 | @interface RLMThreadSafeReference () 39 | 40 | - (nullable id)resolveReferenceInRealm:(RLMRealm *)realm; 41 | 42 | @end 43 | 44 | NS_ASSUME_NONNULL_END 45 | -------------------------------------------------------------------------------- /Pods/Realm/include/RLMUpdateChecker.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2014 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | // Asynchronously check for updates to Realm if running on a simulator 20 | void RLMCheckForUpdates(); 21 | -------------------------------------------------------------------------------- /Pods/Realm/include/Realm.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2014 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #import 20 | 21 | #import 22 | #import 23 | #import 24 | #import 25 | #import 26 | #import 27 | #import 28 | #import 29 | #import 30 | #import 31 | #import 32 | #import 33 | #import 34 | #import 35 | #import 36 | #import 37 | #import 38 | #import 39 | #import 40 | #import 41 | #import 42 | -------------------------------------------------------------------------------- /Pods/Realm/include/binding_callback_thread_observer.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2017 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #ifndef REALM_OS_BINDING_CALLBACK_THREAD_OBSERVER_HPP 20 | #define REALM_OS_BINDING_CALLBACK_THREAD_OBSERVER_HPP 21 | 22 | #include 23 | 24 | namespace realm { 25 | // Interface for bindings interested in registering callbacks before/after the ObjectStore thread runs. 26 | // This is for example helpful to attach/detach the pthread to the JavaVM in order to be able to perform JNI calls. 27 | class BindingCallbackThreadObserver { 28 | public: 29 | // This method is called just before the thread is started 30 | virtual void did_create_thread() = 0; 31 | 32 | // This method is called just before the thread is being destroyed 33 | virtual void will_destroy_thread() = 0; 34 | 35 | // This method is called with any exception throws by client.run(). 36 | virtual void handle_error(std::exception const& e) = 0; 37 | }; 38 | 39 | extern BindingCallbackThreadObserver* g_binding_callback_thread_observer; 40 | } 41 | 42 | #endif // REALM_OS_BINDING_CALLBACK_THREAD_OBSERVER_HPP 43 | -------------------------------------------------------------------------------- /Pods/Realm/include/core/realm.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * 3 | * Copyright 2016 Realm Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | **************************************************************************/ 18 | 19 | #ifndef REALM_HPP 20 | #define REALM_HPP 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | #endif // REALM_HPP 31 | -------------------------------------------------------------------------------- /Pods/Realm/include/core/realm/column_fwd.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * 3 | * Copyright 2016 Realm Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | **************************************************************************/ 18 | 19 | #ifndef REALM_COLUMN_FWD_HPP 20 | #define REALM_COLUMN_FWD_HPP 21 | 22 | #include 23 | 24 | namespace realm { 25 | 26 | // Regular classes 27 | class ColumnBase; 28 | class StringColumn; 29 | class StringEnumColumn; 30 | class BinaryColumn; 31 | class SubtableColumn; 32 | class MixedColumn; 33 | class LinkColumn; 34 | class LinkListColumn; 35 | class TimestampColumn; 36 | 37 | // Templated classes 38 | template 39 | class Column; 40 | template 41 | class BasicColumn; 42 | template 43 | class ColumnRandIterator; 44 | 45 | namespace util { 46 | template 47 | class Optional; 48 | } 49 | 50 | // Shortcuts, aka typedefs. 51 | using IntegerColumn = Column; 52 | using IntNullColumn = Column>; 53 | using DoubleColumn = Column; 54 | using FloatColumn = Column; 55 | using IntegerColumnIterator = ColumnRandIterator; 56 | } // namespace realm 57 | 58 | #endif // REALM_COLUMN_FWD_HPP 59 | -------------------------------------------------------------------------------- /Pods/Realm/include/core/realm/column_type.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * 3 | * Copyright 2016 Realm Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | **************************************************************************/ 18 | 19 | #ifndef REALM_COLUMN_TYPE_HPP 20 | #define REALM_COLUMN_TYPE_HPP 21 | 22 | namespace realm { 23 | 24 | 25 | // Note: Enumeration value assignments must be kept in sync with 26 | // . 27 | enum ColumnType { 28 | // Column types 29 | col_type_Int = 0, 30 | col_type_Bool = 1, 31 | col_type_String = 2, 32 | col_type_StringEnum = 3, // double refs 33 | col_type_Binary = 4, 34 | col_type_Table = 5, 35 | col_type_Mixed = 6, 36 | col_type_OldDateTime = 7, 37 | col_type_Timestamp = 8, 38 | col_type_Float = 9, 39 | col_type_Double = 10, 40 | col_type_Reserved4 = 11, // Decimal 41 | col_type_Link = 12, 42 | col_type_LinkList = 13, 43 | col_type_BackLink = 14 44 | }; 45 | 46 | 47 | // Column attributes can be combined using bitwise or. 48 | enum ColumnAttr { 49 | col_attr_None = 0, 50 | col_attr_Indexed = 1, 51 | 52 | /// Specifies that this column forms a unique constraint. It requires 53 | /// `col_attr_Indexed`. 54 | col_attr_Unique = 2, 55 | 56 | /// Reserved for future use. 57 | col_attr_Reserved = 4, 58 | 59 | /// Specifies that the links of this column are strong, not weak. Applies 60 | /// only to link columns (`type_Link` and `type_LinkList`). 61 | col_attr_StrongLinks = 8, 62 | 63 | /// Specifies that elements in the column can be null. 64 | col_attr_Nullable = 16 65 | }; 66 | 67 | 68 | } // namespace realm 69 | 70 | #endif // REALM_COLUMN_TYPE_HPP 71 | -------------------------------------------------------------------------------- /Pods/Realm/include/core/realm/data_type.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * 3 | * Copyright 2016 Realm Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | **************************************************************************/ 18 | 19 | #ifndef REALM_DATA_TYPE_HPP 20 | #define REALM_DATA_TYPE_HPP 21 | 22 | #include 23 | 24 | namespace realm { 25 | 26 | class StringData; 27 | class BinaryData; 28 | 29 | typedef int64_t Int; 30 | typedef bool Bool; 31 | typedef float Float; 32 | typedef double Double; 33 | typedef realm::StringData String; 34 | typedef realm::BinaryData Binary; 35 | 36 | 37 | // Note: Value assignments must be kept in sync with 38 | // Note: Value assignments must be kept in sync with 39 | // Note: Value assignments must be kept in sync with 40 | // Note: Value assignments must be kept in sync with "com/realm/ColumnType.java" 41 | // Note: Any change to this enum is a file-format breaking change. 42 | enum DataType { 43 | type_Int = 0, 44 | type_Bool = 1, 45 | type_Float = 9, 46 | type_Double = 10, 47 | type_String = 2, 48 | type_Binary = 4, 49 | type_OldDateTime = 7, 50 | type_Timestamp = 8, 51 | type_Table = 5, 52 | type_Mixed = 6, 53 | type_Link = 12, 54 | type_LinkList = 13 55 | }; 56 | 57 | /// See Descriptor::set_link_type(). 58 | enum LinkType { 59 | link_Strong, 60 | link_Weak, 61 | }; 62 | 63 | } // namespace realm 64 | 65 | #endif // REALM_DATA_TYPE_HPP 66 | -------------------------------------------------------------------------------- /Pods/Realm/include/core/realm/descriptor_fwd.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * 3 | * Copyright 2016 Realm Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | **************************************************************************/ 18 | 19 | #ifndef REALM_DESCRIPTOR_FWD_HPP 20 | #define REALM_DESCRIPTOR_FWD_HPP 21 | 22 | #include 23 | 24 | 25 | namespace realm { 26 | 27 | class Descriptor; 28 | typedef std::shared_ptr DescriptorRef; 29 | typedef std::shared_ptr ConstDescriptorRef; 30 | 31 | } // namespace realm 32 | 33 | #endif // REALM_DESCRIPTOR_FWD_HPP 34 | -------------------------------------------------------------------------------- /Pods/Realm/include/core/realm/disable_sync_to_disk.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * 3 | * Copyright 2016 Realm Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | **************************************************************************/ 18 | 19 | #ifndef REALM_DISABLE_SYNC_TO_DISK_HPP 20 | #define REALM_DISABLE_SYNC_TO_DISK_HPP 21 | 22 | #include 23 | 24 | namespace realm { 25 | 26 | /// Completely disable synchronization with storage device to speed up unit 27 | /// testing. This is an unsafe mode of operation, and should never be used in 28 | /// production. This function is thread safe. 29 | void disable_sync_to_disk(); 30 | 31 | /// Returns true after disable_sync_to_disk() has been called. This function is 32 | /// thread safe. 33 | bool get_disable_sync_to_disk() noexcept; 34 | 35 | } // namespace realm 36 | 37 | #endif // REALM_DISABLE_SYNC_TO_DISK_HPP 38 | -------------------------------------------------------------------------------- /Pods/Realm/include/core/realm/history.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * 3 | * Copyright 2016 Realm Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | **************************************************************************/ 18 | 19 | #ifndef REALM_HISTORY_HPP 20 | #define REALM_HISTORY_HPP 21 | 22 | #include 23 | #include 24 | 25 | #include 26 | 27 | 28 | namespace realm { 29 | 30 | std::unique_ptr make_in_realm_history(const std::string& realm_path); 31 | 32 | } // namespace realm 33 | 34 | 35 | #endif // REALM_HISTORY_HPP 36 | -------------------------------------------------------------------------------- /Pods/Realm/include/core/realm/impl/array_writer.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * 3 | * Copyright 2016 Realm Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | **************************************************************************/ 18 | 19 | #ifndef REALM_ARRAY_WRITER_HPP 20 | #define REALM_ARRAY_WRITER_HPP 21 | 22 | #include 23 | 24 | namespace realm { 25 | namespace _impl { 26 | 27 | class ArrayWriterBase { 28 | public: 29 | virtual ~ArrayWriterBase() 30 | { 31 | } 32 | 33 | /// Write the specified array data and its checksum into free 34 | /// space. 35 | /// 36 | /// Returns the ref (position in the target stream) of the written copy of 37 | /// the specified array data. 38 | virtual ref_type write_array(const char* data, size_t size, uint32_t checksum) = 0; 39 | }; 40 | 41 | } // namespace impl_ 42 | } // namespace realm 43 | 44 | #endif // REALM_ARRAY_WRITER_HPP 45 | -------------------------------------------------------------------------------- /Pods/Realm/include/core/realm/impl/clamped_hex_dump.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * 3 | * REALM CONFIDENTIAL 4 | * __________________ 5 | * 6 | * [2011] - [2015] Realm Inc 7 | * All Rights Reserved. 8 | * 9 | * NOTICE: All information contained herein is, and remains 10 | * the property of Realm Incorporated and its suppliers, 11 | * if any. The intellectual and technical concepts contained 12 | * herein are proprietary to Realm Incorporated 13 | * and its suppliers and may be covered by U.S. and Foreign Patents, 14 | * patents in process, and are protected by trade secret or copyright law. 15 | * Dissemination of this information or reproduction of this material 16 | * is strictly forbidden unless prior written permission is obtained 17 | * from Realm Incorporated. 18 | * 19 | **************************************************************************/ 20 | 21 | #ifndef REALM_IMPL_CLAMPED_HEX_DUMP_HPP 22 | #define REALM_IMPL_CLAMPED_HEX_DUMP_HPP 23 | 24 | #include 25 | #include 26 | 27 | namespace realm { 28 | namespace _impl { 29 | 30 | /// Limit the amount of dumped data to 1024 bytes. For use in connection with 31 | /// logging. 32 | inline std::string clamped_hex_dump(BinaryData blob, std::size_t max_size = 1024) 33 | { 34 | bool was_clipped = false; 35 | std::size_t size_2 = blob.size(); 36 | if (size_2 > max_size) { 37 | size_2 = max_size; 38 | was_clipped = true; 39 | } 40 | std::string str = util::hex_dump(blob.data(), size_2); // Throws 41 | if (was_clipped) 42 | str += "..."; // Throws 43 | return str; 44 | } 45 | 46 | } // namespace _impl 47 | } // namespace realm 48 | 49 | #endif // REALM_IMPL_CLAMPED_HEX_DUMP_HPP 50 | -------------------------------------------------------------------------------- /Pods/Realm/include/core/realm/impl/clock.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * 3 | * REALM CONFIDENTIAL 4 | * __________________ 5 | * 6 | * [2011] - [2015] Realm Inc 7 | * All Rights Reserved. 8 | * 9 | * NOTICE: All information contained herein is, and remains 10 | * the property of Realm Incorporated and its suppliers, 11 | * if any. The intellectual and technical concepts contained 12 | * herein are proprietary to Realm Incorporated 13 | * and its suppliers and may be covered by U.S. and Foreign Patents, 14 | * patents in process, and are protected by trade secret or copyright law. 15 | * Dissemination of this information or reproduction of this material 16 | * is strictly forbidden unless prior written permission is obtained 17 | * from Realm Incorporated. 18 | * 19 | **************************************************************************/ 20 | 21 | #ifndef REALM_IMPL_CLOCK_HPP 22 | #define REALM_IMPL_CLOCK_HPP 23 | 24 | #include 25 | #include 26 | 27 | #include 28 | 29 | namespace realm { 30 | namespace _impl { 31 | 32 | inline sync::milliseconds_type realtime_clock_now() noexcept 33 | { 34 | using clock = std::chrono::system_clock; 35 | auto time_since_epoch = clock::now().time_since_epoch(); 36 | auto millis_since_epoch = 37 | std::chrono::duration_cast(time_since_epoch).count(); 38 | return sync::milliseconds_type(millis_since_epoch); 39 | } 40 | 41 | 42 | inline sync::milliseconds_type monotonic_clock_now() noexcept 43 | { 44 | using clock = std::chrono::steady_clock; 45 | auto time_since_epoch = clock::now().time_since_epoch(); 46 | auto millis_since_epoch = 47 | std::chrono::duration_cast(time_since_epoch).count(); 48 | return sync::milliseconds_type(millis_since_epoch); 49 | } 50 | 51 | } // namespace _impl 52 | } // namespace realm 53 | 54 | #endif // REALM_IMPL_CLOCK_HPP 55 | -------------------------------------------------------------------------------- /Pods/Realm/include/core/realm/impl/output_stream.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * 3 | * Copyright 2016 Realm Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | **************************************************************************/ 18 | 19 | #ifndef REALM_IMPL_OUTPUT_STREAM_HPP 20 | #define REALM_IMPL_OUTPUT_STREAM_HPP 21 | 22 | #include 23 | #include 24 | 25 | #include 26 | 27 | #include 28 | 29 | #include 30 | 31 | namespace realm { 32 | namespace _impl { 33 | 34 | 35 | class OutputStream : public ArrayWriterBase { 36 | public: 37 | OutputStream(std::ostream&); 38 | ~OutputStream() noexcept; 39 | 40 | ref_type get_ref_of_next_array() const noexcept; 41 | 42 | void write(const char* data, size_t size); 43 | 44 | ref_type write_array(const char* data, size_t size, uint32_t checksum) override; 45 | 46 | private: 47 | ref_type m_next_ref; 48 | std::ostream& m_out; 49 | 50 | void do_write(const char* data, size_t size); 51 | }; 52 | 53 | 54 | // Implementation: 55 | 56 | inline OutputStream::OutputStream(std::ostream& out) 57 | : m_next_ref(0) 58 | , m_out(out) 59 | { 60 | } 61 | 62 | inline OutputStream::~OutputStream() noexcept 63 | { 64 | } 65 | 66 | inline size_t OutputStream::get_ref_of_next_array() const noexcept 67 | { 68 | return m_next_ref; 69 | } 70 | 71 | 72 | } // namespace _impl 73 | } // namespace realm 74 | 75 | #endif // REALM_IMPL_OUTPUT_STREAM_HPP 76 | -------------------------------------------------------------------------------- /Pods/Realm/include/core/realm/link_view_fwd.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * 3 | * Copyright 2016 Realm Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | **************************************************************************/ 18 | 19 | #ifndef REALM_LINK_VIEW_FWD_HPP 20 | #define REALM_LINK_VIEW_FWD_HPP 21 | 22 | #include 23 | 24 | namespace realm { 25 | 26 | class LinkView; 27 | using LinkViewRef = std::shared_ptr; 28 | using ConstLinkViewRef = std::shared_ptr; 29 | 30 | } // namespace realm 31 | 32 | #endif // REALM_LINK_VIEW_FWD_HPP 33 | -------------------------------------------------------------------------------- /Pods/Realm/include/core/realm/metrics/query_info.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * 3 | * Copyright 2016 Realm Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | **************************************************************************/ 18 | 19 | #ifndef REALM_QUERY_INFO_HPP 20 | #define REALM_QUERY_INFO_HPP 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | #if REALM_METRICS 31 | 32 | namespace realm { 33 | 34 | class Query; // forward declare in namespace realm 35 | 36 | namespace metrics { 37 | 38 | class QueryInfo { 39 | public: 40 | 41 | enum QueryType { 42 | type_Find, 43 | type_FindAll, 44 | type_Count, 45 | type_Sum, 46 | type_Average, 47 | type_Maximum, 48 | type_Minimum, 49 | type_Invalid 50 | }; 51 | 52 | QueryInfo(const Query* query, QueryType type); 53 | ~QueryInfo() noexcept; 54 | 55 | std::string get_description() const; 56 | QueryType get_type() const; 57 | double get_query_time() const; 58 | 59 | static std::unique_ptr track(const Query* query, QueryType type); 60 | static QueryType type_from_action(Action action); 61 | 62 | private: 63 | std::string m_description; 64 | QueryType m_type; 65 | std::shared_ptr m_query_time; 66 | }; 67 | 68 | } // namespace metrics 69 | } // namespace realm 70 | 71 | #endif // REALM_METRICS 72 | #endif // REALM_QUERY_INFO_HPP 73 | -------------------------------------------------------------------------------- /Pods/Realm/include/core/realm/parser/value_expression.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2015 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #ifndef REALM_VALUE_EXPRESSION_HPP 20 | #define REALM_VALUE_EXPRESSION_HPP 21 | 22 | #include "parser.hpp" 23 | #include "query_builder.hpp" 24 | 25 | namespace realm { 26 | namespace parser { 27 | 28 | struct ValueExpression 29 | { 30 | const parser::Expression* value; 31 | query_builder::Arguments* arguments; 32 | std::function table_getter; 33 | 34 | ValueExpression(Query& query, query_builder::Arguments* args, const parser::Expression* v); 35 | bool is_null(); 36 | template 37 | RetType value_of_type_for_query(); 38 | }; 39 | 40 | } // namespace parser 41 | } // namespace realm 42 | 43 | #endif // REALM_VALUE_EXPRESSION_HPP 44 | -------------------------------------------------------------------------------- /Pods/Realm/include/core/realm/query_operators.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * 3 | * Copyright 2017 Realm Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | **************************************************************************/ 18 | 19 | #ifndef REALM_QUERY_OPERATORS_HPP 20 | #define REALM_QUERY_OPERATORS_HPP 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | namespace realm { 28 | 29 | // This is not supported in the general case 30 | template 31 | struct Size; 32 | 33 | template <> 34 | struct Size { 35 | int64_t operator()(StringData v) const 36 | { 37 | return v.size(); 38 | } 39 | typedef StringData type; 40 | }; 41 | 42 | template <> 43 | struct Size { 44 | int64_t operator()(BinaryData v) const 45 | { 46 | return v.size(); 47 | } 48 | typedef BinaryData type; 49 | }; 50 | 51 | template <> 52 | struct Size { 53 | int64_t operator()(ConstTableRef v) const 54 | { 55 | return v->size(); 56 | } 57 | typedef ConstTableRef type; 58 | }; 59 | 60 | template <> 61 | struct Size { 62 | int64_t operator()(ConstLinkViewRef v) const 63 | { 64 | return v->size(); 65 | } 66 | typedef ConstLinkViewRef type; 67 | }; 68 | 69 | } // namespace realm 70 | 71 | #endif // REALM_QUERY_OPERATORS_HPP 72 | -------------------------------------------------------------------------------- /Pods/Realm/include/core/realm/sync/changeset_cooker.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * 3 | * REALM CONFIDENTIAL 4 | * __________________ 5 | * 6 | * [2011] - [2015] Realm Inc 7 | * All Rights Reserved. 8 | * 9 | * NOTICE: All information contained herein is, and remains 10 | * the property of Realm Incorporated and its suppliers, 11 | * if any. The intellectual and technical concepts contained 12 | * herein are proprietary to Realm Incorporated 13 | * and its suppliers and may be covered by U.S. and Foreign Patents, 14 | * patents in process, and are protected by trade secret or copyright law. 15 | * Dissemination of this information or reproduction of this material 16 | * is strictly forbidden unless prior written permission is obtained 17 | * from Realm Incorporated. 18 | * 19 | **************************************************************************/ 20 | 21 | #include 22 | 23 | #ifndef REALM_SYNC_CHANGESET_COOKER_HPP 24 | #define REALM_SYNC_CHANGESET_COOKER_HPP 25 | 26 | namespace realm { 27 | namespace sync { 28 | 29 | /// Copy raw changesets unmodified. 30 | class TrivialChangesetCooker: public ClientHistory::ChangesetCooker { 31 | public: 32 | bool cook_changeset(const Group&, const char* changeset, 33 | std::size_t changeset_size, 34 | util::AppendBuffer&) override; 35 | }; 36 | 37 | } // namespace sync 38 | } // namespace realm 39 | 40 | #endif // REALM_SYNC_CHANGESET_COOKER_HPP 41 | -------------------------------------------------------------------------------- /Pods/Realm/include/core/realm/sync/changeset_parser.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * 3 | * REALM CONFIDENTIAL 4 | * __________________ 5 | * 6 | * [2011] - [2017] Realm Inc 7 | * All Rights Reserved. 8 | * 9 | * NOTICE: All information contained herein is, and remains 10 | * the property of Realm Incorporated and its suppliers, 11 | * if any. The intellectual and technical concepts contained 12 | * herein are proprietary to Realm Incorporated 13 | * and its suppliers and may be covered by U.S. and Foreign Patents, 14 | * patents in process, and are protected by trade secret or copyright law. 15 | * Dissemination of this information or reproduction of this material 16 | * is strictly forbidden unless prior written permission is obtained 17 | * from Realm Incorporated. 18 | * 19 | **************************************************************************/ 20 | 21 | #ifndef REALM_SYNC_CHANGESET_PARSER_HPP 22 | #define REALM_SYNC_CHANGESET_PARSER_HPP 23 | 24 | #include 25 | #include 26 | 27 | namespace realm { 28 | namespace sync { 29 | 30 | struct ChangesetParser { 31 | /// Throws BadChangesetError if parsing fails. 32 | /// 33 | /// FIXME: Consider using std::error_code instead of throwing exceptions on 34 | /// parse errors. 35 | void parse(_impl::NoCopyInputStream&, InstructionHandler&); 36 | private: 37 | struct State; 38 | }; 39 | 40 | void parse_changeset(_impl::NoCopyInputStream&, Changeset& out_log); 41 | void parse_changeset(_impl::InputStream&, Changeset& out_log); 42 | 43 | 44 | } // namespace sync 45 | } // namespace realm 46 | 47 | #endif // REALM_SYNC_CHANGESET_PARSER_HPP 48 | -------------------------------------------------------------------------------- /Pods/Realm/include/core/realm/sync/crypto.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * 3 | * REALM CONFIDENTIAL 4 | * __________________ 5 | * 6 | * [2011] - [2015] Realm Inc 7 | * All Rights Reserved. 8 | * 9 | * NOTICE: All information contained herein is, and remains 10 | * the property of Realm Incorporated and its suppliers, 11 | * if any. The intellectual and technical concepts contained 12 | * herein are proprietary to Realm Incorporated 13 | * and its suppliers and may be covered by U.S. and Foreign Patents, 14 | * patents in process, and are protected by trade secret or copyright law. 15 | * Dissemination of this information or reproduction of this material 16 | * is strictly forbidden unless prior written permission is obtained 17 | * from Realm Incorporated. 18 | * 19 | **************************************************************************/ 20 | 21 | #ifndef REALM_SYNC_CRYPTO_HPP 22 | #define REALM_SYNC_CRYPTO_HPP 23 | 24 | #include 25 | #include 26 | 27 | #include 28 | #include 29 | 30 | namespace realm { 31 | namespace sync { 32 | namespace crypto { 33 | 34 | /// The digest functions calculate the message digest of the input in \param 35 | /// in_buffer of size \param in_buffer_size. The digest is placed in \param 36 | /// out_buffer. The caller must guarantee that the output buffer is large 37 | /// enough to contain the digest. 38 | /// 39 | /// The functions throw if the underlying platform dependent implementations 40 | /// throw. Typically, exceptions are "out of memory" errors. 41 | /// 42 | /// sha1() calculates the SHA-1 hash value of output size 20. 43 | /// sha256() calculates the SHA-256 hash value of output size 32. 44 | void sha1(const char* in_buffer, size_t in_buffer_size, unsigned char* out_buffer); 45 | void sha256(const char* in_buffer, size_t in_buffer_size, unsigned char* out_buffer); 46 | 47 | } // namespace crypto 48 | } // namespace sync 49 | } // namespace realm 50 | 51 | #endif // REALM_SYNC_CRYPTO_HPP 52 | -------------------------------------------------------------------------------- /Pods/Realm/include/core/realm/sync/feature_token.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * 3 | * REALM CONFIDENTIAL 4 | * __________________ 5 | * 6 | * [2011] - [2012] Realm Inc 7 | * All Rights Reserved. 8 | * 9 | * NOTICE: All information contained herein is, and remains 10 | * the property of Realm Incorporated and its suppliers, 11 | * if any. The intellectual and technical concepts contained 12 | * herein are proprietary to Realm Incorporated 13 | * and its suppliers and may be covered by U.S. and Foreign Patents, 14 | * patents in process, and are protected by trade secret or copyright law. 15 | * Dissemination of this information or reproduction of this material 16 | * is strictly forbidden unless prior written permission is obtained 17 | * from Realm Incorporated. 18 | * 19 | **************************************************************************/ 20 | #ifndef REALM_SYNC_FEATURE_TOKEN_HPP 21 | #define REALM_SYNC_FEATURE_TOKEN_HPP 22 | 23 | #include 24 | 25 | #if !REALM_MOBILE && !defined(REALM_EXCLUDE_FEATURE_TOKENS) 26 | #define REALM_HAVE_FEATURE_TOKENS 1 27 | #else 28 | #define REALM_HAVE_FEATURE_TOKENS 0 29 | #endif 30 | 31 | #if REALM_HAVE_FEATURE_TOKENS 32 | 33 | #include 34 | 35 | #include 36 | 37 | namespace realm { 38 | namespace sync { 39 | 40 | class FeatureGate { 41 | public: 42 | 43 | // The constructor takes a JWT token as argument. 44 | // The constructor throws a std::runtime_error if 45 | // the token is invalid. An invalid token is a token 46 | // that has bad syntax, is not signed by Realm, or is 47 | // expired. 48 | FeatureGate(StringData token); 49 | 50 | // Constructs a feature gate without any features. 51 | FeatureGate(); 52 | ~FeatureGate(); 53 | 54 | FeatureGate(FeatureGate&&); 55 | FeatureGate& operator=(FeatureGate&&); 56 | 57 | bool has_feature(StringData feature_name); 58 | 59 | private: 60 | struct Impl; 61 | std::unique_ptr m_impl; 62 | }; 63 | 64 | 65 | } // namespace sync 66 | } // namespace realm 67 | 68 | #endif // REALM_HAVE_FEATURE_TOKENS 69 | #endif // REALM_SYNC_FEATURE_TOKEN_HPP 70 | -------------------------------------------------------------------------------- /Pods/Realm/include/core/realm/sync/version.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * 3 | * REALM CONFIDENTIAL 4 | * __________________ 5 | * 6 | * [2011] - [2013] Realm Inc 7 | * All Rights Reserved. 8 | * 9 | * NOTICE: All information contained herein is, and remains 10 | * the property of Realm Incorporated and its suppliers, 11 | * if any. The intellectual and technical concepts contained 12 | * herein are proprietary to Realm Incorporated 13 | * and its suppliers and may be covered by U.S. and Foreign Patents, 14 | * patents in process, and are protected by trade secret or copyright law. 15 | * Dissemination of this information or reproduction of this material 16 | * is strictly forbidden unless prior written permission is obtained 17 | * from Realm Incorporated. 18 | * 19 | **************************************************************************/ 20 | #ifndef REALM_SYNC_VERSION_HPP 21 | #define REALM_SYNC_VERSION_HPP 22 | 23 | #include 24 | 25 | #define REALM_SYNC_VER_MAJOR 3 26 | #define REALM_SYNC_VER_MINOR 12 27 | #define REALM_SYNC_VER_PATCH 2 28 | #define REALM_SYNC_PRODUCT_NAME "realm-sync" 29 | 30 | #define REALM_SYNC_VER_STRING REALM_QUOTE(REALM_SYNC_VER_MAJOR) "." \ 31 | REALM_QUOTE(REALM_SYNC_VER_MINOR) "." REALM_QUOTE(REALM_SYNC_VER_PATCH) 32 | #define REALM_SYNC_VER_CHUNK "[" REALM_SYNC_PRODUCT_NAME "-" REALM_SYNC_VER_STRING "]" 33 | 34 | #endif // REALM_SYNC_VERSION_HPP 35 | -------------------------------------------------------------------------------- /Pods/Realm/include/core/realm/util/call_with_tuple.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * 3 | * Copyright 2016 Realm Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | **************************************************************************/ 18 | 19 | #ifndef REALM_UTIL_CALL_WITH_TUPLE_HPP 20 | #define REALM_UTIL_CALL_WITH_TUPLE_HPP 21 | 22 | #include 23 | #include 24 | 25 | namespace realm { 26 | namespace _impl { 27 | 28 | /// \cond doxygen_skip 29 | /// Doxygen warns about a recursive class relation, but this is intentional. 30 | 31 | template 32 | struct Indexes { 33 | }; 34 | template 35 | struct GenIndexes : GenIndexes { 36 | }; 37 | template 38 | struct GenIndexes<0, I...> { 39 | typedef Indexes type; 40 | }; 41 | 42 | /// \endcond 43 | 44 | template 45 | auto call_with_tuple(F func, std::tuple args, Indexes) -> decltype(func(std::get(args)...)) 46 | { 47 | static_cast(args); // Prevent GCC warning when tuple is empty 48 | return func(std::get(args)...); 49 | } 50 | 51 | } // namespace _impl 52 | 53 | namespace util { 54 | 55 | template 56 | auto call_with_tuple(F func, std::tuple args) 57 | -> decltype(_impl::call_with_tuple(std::move(func), std::move(args), 58 | typename _impl::GenIndexes::type())) 59 | { 60 | return _impl::call_with_tuple(std::move(func), std::move(args), typename _impl::GenIndexes::type()); 61 | } 62 | 63 | } // namespace util 64 | } // namespace realm 65 | 66 | #endif // REALM_UTIL_CALL_WITH_TUPLE_HPP 67 | -------------------------------------------------------------------------------- /Pods/Realm/include/core/realm/util/config.h: -------------------------------------------------------------------------------- 1 | // Version information 2 | #define REALM_VERSION "" 3 | 4 | // Specific headers 5 | #define HAVE_MALLOC_H 0 6 | 7 | // Realm-specific configuration 8 | #define REALM_MAX_BPNODE_SIZE 1000 9 | /* #undef REALM_MAX_BPNODE_SIZE_DEBUG */ 10 | #define REALM_ENABLE_ASSERTIONS 0 11 | #define REALM_ENABLE_ALLOC_SET_ZERO 0 12 | #define REALM_ENABLE_ENCRYPTION 1 13 | #define REALM_ENABLE_MEMDEBUG 0 14 | #define REALM_VALGRIND 0 15 | #define REALM_METRICS 1 16 | #define REALM_ASAN 0 17 | #define REALM_TSAN 0 18 | 19 | #define REALM_INSTALL_PREFIX "/usr/local" 20 | #define REALM_INSTALL_INCLUDEDIR "include" 21 | #define REALM_INSTALL_BINDIR "bin" 22 | #define REALM_INSTALL_LIBDIR "lib" 23 | #define REALM_INSTALL_LIBEXECDIR "libexec" 24 | #define REALM_INSTALL_EXEC_PREFIX "/usr/local" 25 | -------------------------------------------------------------------------------- /Pods/Realm/include/core/realm/util/demangle.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * 3 | * REALM CONFIDENTIAL 4 | * __________________ 5 | * 6 | * [2011] - [2015] Realm Inc 7 | * All Rights Reserved. 8 | * 9 | * NOTICE: All information contained herein is, and remains 10 | * the property of Realm Incorporated and its suppliers, 11 | * if any. The intellectual and technical concepts contained 12 | * herein are proprietary to Realm Incorporated 13 | * and its suppliers and may be covered by U.S. and Foreign Patents, 14 | * patents in process, and are protected by trade secret or copyright law. 15 | * Dissemination of this information or reproduction of this material 16 | * is strictly forbidden unless prior written permission is obtained 17 | * from Realm Incorporated. 18 | * 19 | **************************************************************************/ 20 | #ifndef REALM_UTIL_DEMANGLE_HPP 21 | #define REALM_UTIL_DEMANGLE_HPP 22 | 23 | #include 24 | #include 25 | 26 | namespace realm { 27 | namespace util { 28 | 29 | 30 | /// Demangle the specified C++ ABI identifier. 31 | /// 32 | /// See for example 33 | /// http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/namespaceabi.html 34 | std::string demangle(const std::string&); 35 | 36 | 37 | /// Get the demangled name of the specified type. 38 | template inline std::string get_type_name() 39 | { 40 | return demangle(typeid(T).name()); 41 | } 42 | 43 | 44 | /// Get the demangled name of the type of the specified argument. 45 | template inline std::string get_type_name(const T& v) 46 | { 47 | return demangle(typeid(v).name()); 48 | } 49 | 50 | 51 | } // namespace util 52 | } // namespace realm 53 | 54 | #endif // REALM_UTIL_DEMANGLE_HPP 55 | -------------------------------------------------------------------------------- /Pods/Realm/include/core/realm/util/errno.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * 3 | * Copyright 2016 Realm Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | **************************************************************************/ 18 | 19 | #ifndef REALM_UTIL_ERRNO_HPP 20 | #define REALM_UTIL_ERRNO_HPP 21 | 22 | #include 23 | 24 | #include 25 | 26 | 27 | namespace realm { 28 | namespace util { 29 | 30 | // Get the error message for a given error code, and append it to `prefix` 31 | inline std::string get_errno_msg(const char* prefix, int err) 32 | { 33 | return prefix + make_basic_system_error_code(err).message(); 34 | } 35 | 36 | } // namespace util 37 | } // namespace realm 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /Pods/Realm/include/core/realm/util/hex_dump.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * 3 | * Copyright 2016 Realm Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | **************************************************************************/ 18 | 19 | #ifndef REALM_UTIL_HEX_DUMP_HPP 20 | #define REALM_UTIL_HEX_DUMP_HPP 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | #include 30 | 31 | namespace realm { 32 | namespace util { 33 | 34 | template 35 | std::string hex_dump(const T* data, size_t size, const char* separator = " ", int min_digits = -1) 36 | { 37 | using U = typename std::make_unsigned::type; 38 | 39 | if (min_digits < 0) 40 | min_digits = (std::numeric_limits::digits + 3) / 4; 41 | 42 | std::ostringstream out; 43 | for (const T* i = data; i != data + size; ++i) { 44 | if (i != data) 45 | out << separator; 46 | out << std::setw(min_digits) << std::setfill('0') << std::hex << std::uppercase << util::promote(U(*i)); 47 | } 48 | return out.str(); 49 | } 50 | 51 | } // namespace util 52 | } // namespace realm 53 | 54 | #endif // REALM_UTIL_HEX_DUMP_HPP 55 | -------------------------------------------------------------------------------- /Pods/Realm/include/core/realm/util/inspect.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * 3 | * Copyright 2016 Realm Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | **************************************************************************/ 18 | 19 | #ifndef REALM_UTIL_INSPECT_HPP 20 | #define REALM_UTIL_INSPECT_HPP 21 | 22 | #include 23 | 24 | namespace realm { 25 | namespace util { 26 | 27 | // LCOV_EXCL_START 28 | // 29 | // Because these are templated functions, every combination of output stream 30 | // type and value(s) type(s) generates a new function. This makes LCOV/GCOVR 31 | // report over 70 functions in this file, with only 6.6% function coverage, 32 | // even though line coverage is at 100%. 33 | 34 | template 35 | void inspect_value(OS& os, const T& value) 36 | { 37 | os << value; 38 | } 39 | 40 | template 41 | void inspect_value(OS& os, const std::string& value) 42 | { 43 | // FIXME: Escape the string. 44 | os << "\"" << value << "\""; 45 | } 46 | 47 | template 48 | void inspect_value(OS& os, const char* value) 49 | { 50 | // FIXME: Escape the string. 51 | os << "\"" << value << "\""; 52 | } 53 | 54 | template 55 | void inspect_all(OS&) 56 | { 57 | // No-op 58 | } 59 | 60 | /// Convert all arguments to strings, and quote string arguments. 61 | template 62 | void inspect_all(OS& os, First&& first, Args&&... args) 63 | { 64 | inspect_value(os, std::forward(first)); 65 | if (sizeof...(Args) != 0) { 66 | os << ", "; 67 | } 68 | inspect_all(os, std::forward(args)...); 69 | } 70 | 71 | // LCOV_EXCL_STOP 72 | 73 | } // namespace util 74 | } // namespace realm 75 | 76 | #endif // REALM_UTIL_INSPECT_HPP 77 | -------------------------------------------------------------------------------- /Pods/Realm/include/core/realm/util/load_file.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * 3 | * REALM CONFIDENTIAL 4 | * __________________ 5 | * 6 | * [2011] - [2015] Realm Inc 7 | * All Rights Reserved. 8 | * 9 | * NOTICE: All information contained herein is, and remains 10 | * the property of Realm Incorporated and its suppliers, 11 | * if any. The intellectual and technical concepts contained 12 | * herein are proprietary to Realm Incorporated 13 | * and its suppliers and may be covered by U.S. and Foreign Patents, 14 | * patents in process, and are protected by trade secret or copyright law. 15 | * Dissemination of this information or reproduction of this material 16 | * is strictly forbidden unless prior written permission is obtained 17 | * from Realm Incorporated. 18 | * 19 | **************************************************************************/ 20 | #ifndef REALM_UTIL_LOAD_FILE_HPP 21 | #define REALM_UTIL_LOAD_FILE_HPP 22 | 23 | #include 24 | 25 | namespace realm { 26 | namespace util { 27 | 28 | // FIXME: These functions ought to be moved to in the 29 | // realm-core repository. 30 | std::string load_file(const std::string& path); 31 | std::string load_file_and_chomp(const std::string& path); 32 | 33 | } // namespace util 34 | } // namespace realm 35 | 36 | #endif // REALM_UTIL_LOAD_FILE_HPP 37 | -------------------------------------------------------------------------------- /Pods/Realm/include/core/realm/util/misc_errors.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * 3 | * Copyright 2016 Realm Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | **************************************************************************/ 18 | 19 | #ifndef REALM_UTIL_MISC_ERRORS_HPP 20 | #define REALM_UTIL_MISC_ERRORS_HPP 21 | 22 | #include 23 | 24 | 25 | namespace realm { 26 | namespace util { 27 | namespace error { 28 | 29 | enum misc_errors { 30 | unknown = 1, 31 | }; 32 | 33 | std::error_code make_error_code(misc_errors); 34 | 35 | } // namespace error 36 | } // namespace util 37 | } // namespace realm 38 | 39 | namespace std { 40 | 41 | template <> 42 | class is_error_code_enum { 43 | public: 44 | static const bool value = true; 45 | }; 46 | 47 | } // namespace std 48 | 49 | #endif // REALM_UTIL_MISC_ERRORS_HPP 50 | -------------------------------------------------------------------------------- /Pods/Realm/include/core/realm/util/misc_ext_errors.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * 3 | * REALM CONFIDENTIAL 4 | * __________________ 5 | * 6 | * [2011] - [2015] Realm Inc 7 | * All Rights Reserved. 8 | * 9 | * NOTICE: All information contained herein is, and remains 10 | * the property of Realm Incorporated and its suppliers, 11 | * if any. The intellectual and technical concepts contained 12 | * herein are proprietary to Realm Incorporated 13 | * and its suppliers and may be covered by U.S. and Foreign Patents, 14 | * patents in process, and are protected by trade secret or copyright law. 15 | * Dissemination of this information or reproduction of this material 16 | * is strictly forbidden unless prior written permission is obtained 17 | * from Realm Incorporated. 18 | * 19 | **************************************************************************/ 20 | #ifndef REALM_UTIL_MISC_EXT_ERRORS_HPP 21 | #define REALM_UTIL_MISC_EXT_ERRORS_HPP 22 | 23 | #include 24 | 25 | namespace realm { 26 | namespace util { 27 | 28 | /// FIXME: The intention is that this enum will be merged into, and subsumed by 29 | /// util::MiscErrors in `` in the core library. 30 | enum class MiscExtErrors { 31 | /// End of input. 32 | end_of_input = 1, 33 | 34 | /// Premature end of input. That is, end of input at an unexpected, or 35 | /// illegal place in an input stream. 36 | premature_end_of_input, 37 | 38 | /// Delimiter not found. 39 | delim_not_found 40 | }; 41 | 42 | class MiscExtErrorCategory : public std::error_category { 43 | public: 44 | const char* name() const noexcept override final; 45 | std::string message(int) const override final; 46 | }; 47 | 48 | /// The error category associated with MiscErrors. The name of this category is 49 | /// `realm.util.misc_ext`. 50 | extern MiscExtErrorCategory misc_ext_error_category; 51 | 52 | inline std::error_code make_error_code(MiscExtErrors err) 53 | { 54 | return std::error_code(int(err), misc_ext_error_category); 55 | } 56 | 57 | } // namespace util 58 | } // namespace realm 59 | 60 | namespace std { 61 | 62 | template<> class is_error_code_enum { 63 | public: 64 | static const bool value = true; 65 | }; 66 | 67 | } // namespace std 68 | 69 | #endif // REALM_UTIL_MISC_EXT_ERRORS_HPP 70 | -------------------------------------------------------------------------------- /Pods/Realm/include/core/realm/util/miscellaneous.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * 3 | * Copyright 2016 Realm Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | **************************************************************************/ 18 | 19 | #ifndef REALM_UTIL_MISCELLANEOUS_HPP 20 | #define REALM_UTIL_MISCELLANEOUS_HPP 21 | 22 | #include 23 | 24 | namespace realm { 25 | namespace util { 26 | 27 | // FIXME: Replace this with std::add_const_t when we switch over to C++14 by 28 | // default. 29 | /// \brief Adds const qualifier, unless T already has the const qualifier 30 | template 31 | using add_const_t = typename std::add_const::type; 32 | 33 | // FIXME: Replace this with std::as_const when we switch over to C++17 by 34 | // default. 35 | /// \brief Forms an lvalue reference to const T 36 | template 37 | constexpr add_const_t& as_const(T& v) noexcept 38 | { 39 | return v; 40 | } 41 | 42 | /// \brief Disallows rvalue arguments 43 | template 44 | add_const_t& as_const(const T&&) = delete; 45 | 46 | } // namespace util 47 | } // namespace realm 48 | 49 | #endif // REALM_UTIL_MISCELLANEOUS_HPP 50 | -------------------------------------------------------------------------------- /Pods/Realm/include/core/realm/util/overload.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * 3 | * Copyright 2017 Realm Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | **************************************************************************/ 18 | 19 | #ifndef REALM_UTIL_OVERLOAD_HPP 20 | #define REALM_UTIL_OVERLOAD_HPP 21 | 22 | #include 23 | 24 | namespace realm { 25 | 26 | namespace _impl { 27 | 28 | template 29 | struct Overloaded; 30 | 31 | } // namespace _impl 32 | 33 | 34 | namespace util { 35 | 36 | // Declare an overload set using lambdas or other function objects. 37 | // A minimal version of C++ Library Evolution Working Group proposal P0051R2. 38 | 39 | template 40 | _impl::Overloaded overload(Fns&&... f) 41 | { 42 | return _impl::Overloaded(std::forward(f)...); 43 | } 44 | 45 | } // namespace util 46 | 47 | 48 | namespace _impl { 49 | 50 | template 51 | struct Overloaded : Fn, Overloaded { 52 | template 53 | Overloaded(U&& fn, Rest&&... rest) : Fn(std::forward(fn)), Overloaded(std::forward(rest)...) { } 54 | 55 | using Fn::operator(); 56 | using Overloaded::operator(); 57 | }; 58 | 59 | template 60 | struct Overloaded : Fn { 61 | template 62 | Overloaded(U&& fn) : Fn(std::forward(fn)) { } 63 | 64 | using Fn::operator(); 65 | }; 66 | 67 | } // namespace _impl 68 | } // namespace realm 69 | 70 | #endif // REALM_UTIL_OVERLOAD_HPP 71 | -------------------------------------------------------------------------------- /Pods/Realm/include/core/realm/util/parent_dir.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * 3 | * REALM CONFIDENTIAL 4 | * __________________ 5 | * 6 | * [2011] - [2015] Realm Inc 7 | * All Rights Reserved. 8 | * 9 | * NOTICE: All information contained herein is, and remains 10 | * the property of Realm Incorporated and its suppliers, 11 | * if any. The intellectual and technical concepts contained 12 | * herein are proprietary to Realm Incorporated 13 | * and its suppliers and may be covered by U.S. and Foreign Patents, 14 | * patents in process, and are protected by trade secret or copyright law. 15 | * Dissemination of this information or reproduction of this material 16 | * is strictly forbidden unless prior written permission is obtained 17 | * from Realm Incorporated. 18 | * 19 | **************************************************************************/ 20 | #ifndef REALM_UTIL_PARENT_DIR_HPP 21 | #define REALM_UTIL_PARENT_DIR_HPP 22 | 23 | #include 24 | 25 | namespace realm { 26 | namespace util { 27 | 28 | /// Same effect as std::filesystem::path::parent_path(). 29 | /// 30 | /// FIXME: This function ought to be moved to in the 31 | /// realm-core repository. 32 | std::string parent_dir(const std::string& path); 33 | 34 | } // namespace util 35 | } // namespace realm 36 | 37 | #endif // REALM_UTIL_PARENT_DIR_HPP 38 | -------------------------------------------------------------------------------- /Pods/Realm/include/core/realm/util/scope_exit.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * 3 | * Copyright 2016 Realm Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | **************************************************************************/ 18 | 19 | #ifndef REALM_UTIL_SCOPE_EXIT_HPP 20 | #define REALM_UTIL_SCOPE_EXIT_HPP 21 | 22 | #include 23 | #include 24 | 25 | #include 26 | 27 | namespace realm { 28 | namespace util { 29 | 30 | template 31 | class ScopeExit { 32 | public: 33 | explicit ScopeExit(const H& handler) noexcept(std::is_nothrow_copy_constructible::value) 34 | : m_handler(handler) 35 | { 36 | } 37 | 38 | explicit ScopeExit(H&& handler) noexcept(std::is_nothrow_move_constructible::value) 39 | : m_handler(std::move(handler)) 40 | { 41 | } 42 | 43 | ScopeExit(ScopeExit&& se) noexcept(std::is_nothrow_move_constructible::value) 44 | : m_handler(std::move(se.m_handler)) 45 | { 46 | se.m_handler = none; 47 | } 48 | 49 | ~ScopeExit() noexcept 50 | { 51 | if (m_handler) 52 | (*m_handler)(); 53 | } 54 | 55 | static_assert(noexcept(std::declval()()), "Handler must be nothrow executable"); 56 | static_assert(std::is_nothrow_destructible::value, "Handler must be nothrow destructible"); 57 | 58 | private: 59 | util::Optional m_handler; 60 | }; 61 | 62 | template 63 | ScopeExit::type> make_scope_exit(H&& handler) noexcept( 64 | noexcept(ScopeExit::type>(std::forward(handler)))) 65 | { 66 | return ScopeExit::type>(std::forward(handler)); 67 | } 68 | 69 | } // namespace util 70 | } // namespace realm 71 | 72 | #endif // REALM_UTIL_SCOPE_EXIT_HPP 73 | -------------------------------------------------------------------------------- /Pods/Realm/include/core/realm/version.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * 3 | * Copyright 2016 Realm Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | **************************************************************************/ 18 | 19 | #ifndef REALM_VERSION_HPP 20 | #define REALM_VERSION_HPP 21 | 22 | #include 23 | 24 | // Do not use `cmakedefine` here, as certain versions can be 0, which CMake 25 | // interprets as being undefined. 26 | #define REALM_VERSION_MAJOR 5 27 | #define REALM_VERSION_MINOR 10 28 | #define REALM_VERSION_PATCH 2 29 | #define REALM_VERSION_EXTRA "" 30 | #define REALM_VERSION_STRING "5.10.2" 31 | 32 | #define REALM_PRODUCT_NAME "realm-core" 33 | #define REALM_VER_CHUNK "[" REALM_PRODUCT_NAME "-" REALM_VERSION_STRING "]" 34 | 35 | namespace realm { 36 | 37 | enum Feature { 38 | feature_Debug, 39 | feature_Replication, 40 | }; 41 | 42 | class StringData; 43 | 44 | class Version { 45 | public: 46 | static int get_major() { return REALM_VERSION_MAJOR; } 47 | static int get_minor() { return REALM_VERSION_MINOR; } 48 | static int get_patch() { return REALM_VERSION_PATCH; } 49 | static StringData get_extra(); 50 | static std::string get_version(); 51 | static bool is_at_least(int major, int minor, int patch, StringData extra); 52 | static bool is_at_least(int major, int minor, int patch); 53 | static bool has_feature(Feature feature); 54 | }; 55 | 56 | 57 | } // namespace realm 58 | 59 | #endif // REALM_VERSION_HPP 60 | -------------------------------------------------------------------------------- /Pods/Realm/include/core/realm/version_id.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * 3 | * Copyright 2016 Realm Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | **************************************************************************/ 18 | 19 | #ifndef REALM_VERSION_ID_HPP 20 | #define REALM_VERSION_ID_HPP 21 | 22 | #if defined(_WIN32) && !defined(__STDC_LIMIT_MACROS) 23 | #define __STDC_LIMIT_MACROS 24 | #endif 25 | 26 | #include 27 | 28 | namespace realm { 29 | 30 | struct VersionID { 31 | using version_type = uint_fast64_t; 32 | version_type version = std::numeric_limits::max(); 33 | uint_fast32_t index = 0; 34 | 35 | VersionID() 36 | { 37 | } 38 | VersionID(version_type initial_version, uint_fast32_t initial_index) 39 | { 40 | version = initial_version; 41 | index = initial_index; 42 | } 43 | 44 | bool operator==(const VersionID& other) 45 | { 46 | return version == other.version; 47 | } 48 | bool operator!=(const VersionID& other) 49 | { 50 | return version != other.version; 51 | } 52 | bool operator<(const VersionID& other) 53 | { 54 | return version < other.version; 55 | } 56 | bool operator<=(const VersionID& other) 57 | { 58 | return version <= other.version; 59 | } 60 | bool operator>(const VersionID& other) 61 | { 62 | return version > other.version; 63 | } 64 | bool operator>=(const VersionID& other) 65 | { 66 | return version >= other.version; 67 | } 68 | }; 69 | 70 | } // namespace realm 71 | 72 | #endif // REALM_VERSION_ID_HPP 73 | -------------------------------------------------------------------------------- /Pods/Realm/include/feature_checks.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2017 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #ifndef REALM_OS_FEATURE_CHECKS_HPP 20 | #define REALM_OS_FEATURE_CHECKS_HPP 21 | 22 | #include 23 | 24 | #if REALM_ENABLE_SYNC 25 | 26 | #include 27 | 28 | #endif // REALM_ENABLE_SYNC 29 | 30 | #endif // REALM_OS_FEATURE_CHECKS_HPP 31 | -------------------------------------------------------------------------------- /Pods/Realm/include/impl/apple/keychain_helper.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2016 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #ifndef REALM_OS_KEYCHAIN_HELPER_HPP 20 | #define REALM_OS_KEYCHAIN_HELPER_HPP 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | namespace realm { 27 | namespace keychain { 28 | 29 | std::vector metadata_realm_encryption_key(bool check_legacy_service); 30 | 31 | class KeychainAccessException : public std::runtime_error { 32 | public: 33 | KeychainAccessException(int32_t error_code); 34 | }; 35 | 36 | } 37 | } 38 | 39 | #endif // REALM_OS_KEYCHAIN_HELPER_HPP 40 | -------------------------------------------------------------------------------- /Pods/Realm/include/impl/external_commit_helper.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2016 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #ifndef REALM_EXTERNAL_COMMIT_HELPER_HPP 20 | #define REALM_EXTERNAL_COMMIT_HELPER_HPP 21 | 22 | #include 23 | 24 | #if (defined(REALM_HAVE_EPOLL) && REALM_HAVE_EPOLL) || REALM_ANDROID || (defined(REALM_PLATFORM_NODE) && REALM_PLATFORM_NODE && !REALM_PLATFORM_APPLE && !defined(_WIN32)) 25 | #define REALM_USE_EPOLL 1 26 | #else 27 | #define REALM_USE_EPOLL 0 28 | #endif 29 | 30 | #if REALM_PLATFORM_APPLE 31 | #include "impl/apple/external_commit_helper.hpp" 32 | #elif REALM_USE_EPOLL 33 | #include "impl/epoll/external_commit_helper.hpp" 34 | #elif defined(_WIN32) 35 | #include "impl/windows/external_commit_helper.hpp" 36 | #else 37 | #include "impl/generic/external_commit_helper.hpp" 38 | #endif 39 | 40 | #endif // REALM_EXTERNAL_COMMIT_HELPER_HPP 41 | -------------------------------------------------------------------------------- /Pods/Realm/include/impl/list_notifier.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2016 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #ifndef REALM_LIST_NOTIFIER_HPP 20 | #define REALM_LIST_NOTIFIER_HPP 21 | 22 | #include "impl/collection_notifier.hpp" 23 | 24 | #include 25 | 26 | namespace realm { 27 | namespace _impl { 28 | class ListNotifier : public CollectionNotifier { 29 | public: 30 | ListNotifier(LinkViewRef lv, std::shared_ptr realm); 31 | 32 | private: 33 | // The linkview, in handover form if this has not been attached to the main 34 | // SharedGroup yet 35 | LinkViewRef m_lv; 36 | std::unique_ptr> m_lv_handover; 37 | 38 | // The last-seen size of the LinkView so that we can report row deletions 39 | // when the LinkView itself is deleted 40 | size_t m_prev_size; 41 | 42 | // The actual change, calculated in run() and delivered in prepare_handover() 43 | CollectionChangeBuilder m_change; 44 | TransactionChangeInfo* m_info; 45 | 46 | void run() override; 47 | 48 | void do_prepare_handover(SharedGroup&) override; 49 | 50 | void do_attach_to(SharedGroup& sg) override; 51 | void do_detach_from(SharedGroup& sg) override; 52 | 53 | void release_data() noexcept override; 54 | bool do_add_required_change_info(TransactionChangeInfo& info) override; 55 | }; 56 | } 57 | } 58 | 59 | #endif // REALM_LIST_NOTIFIER_HPP 60 | -------------------------------------------------------------------------------- /Pods/Realm/include/impl/notification_wrapper.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2017 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #ifndef REALM_OS_NOTIFICATION_WRAPPER_HPP 20 | #define REALM_OS_NOTIFICATION_WRAPPER_HPP 21 | 22 | #include "collection_notifications.hpp" 23 | 24 | namespace realm { 25 | namespace _impl { 26 | 27 | // A wrapper that stores a value and an associated notification token. 28 | // The point of this type is to keep the notification token alive 29 | // until the value can be properly processed or handled. 30 | template 31 | struct NotificationWrapper : public T { 32 | using T::T; 33 | 34 | NotificationWrapper(T&& object) 35 | : T(object) 36 | { } 37 | 38 | template 39 | void add_notification_callback(F&& callback) 40 | { 41 | m_token = T::add_notification_callback(std::forward(callback)); 42 | } 43 | 44 | private: 45 | NotificationToken m_token; 46 | }; 47 | 48 | } // namespace _impl 49 | } // namespace realm 50 | 51 | #endif // REALM_OS_NOTIFICATION_WRAPPER_HPP 52 | -------------------------------------------------------------------------------- /Pods/Realm/include/impl/object_notifier.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2017 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #ifndef REALM_OS_OBJECT_NOTIFIER_HPP 20 | #define REALM_OS_OBJECT_NOTIFIER_HPP 21 | 22 | #include "impl/collection_notifier.hpp" 23 | 24 | #include 25 | 26 | namespace realm { 27 | namespace _impl { 28 | class ObjectNotifier : public CollectionNotifier { 29 | public: 30 | ObjectNotifier(Row const& row, std::shared_ptr realm); 31 | 32 | private: 33 | std::unique_ptr m_row; 34 | std::unique_ptr> m_handover; 35 | 36 | // The actual change, calculated in run() and delivered in prepare_handover() 37 | CollectionChangeBuilder m_change; 38 | TransactionChangeInfo* m_info; 39 | 40 | void run() override; 41 | 42 | void do_prepare_handover(SharedGroup&) override; 43 | 44 | void do_attach_to(SharedGroup& sg) override; 45 | void do_detach_from(SharedGroup& sg) override; 46 | 47 | void release_data() noexcept override; 48 | bool do_add_required_change_info(TransactionChangeInfo& info) override; 49 | }; 50 | } 51 | } 52 | 53 | #endif // REALM_OS_OBJECT_NOTIFIER_HPP 54 | -------------------------------------------------------------------------------- /Pods/Realm/include/impl/primitive_list_notifier.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2017 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #ifndef REALM_OS_PRIMITIVE_LIST_NOTIFIER_HPP 20 | #define REALM_OS_PRIMITIVE_LIST_NOTIFIER_HPP 21 | 22 | #include "impl/collection_notifier.hpp" 23 | 24 | #include 25 | 26 | namespace realm { 27 | namespace _impl { 28 | class PrimitiveListNotifier : public CollectionNotifier { 29 | public: 30 | PrimitiveListNotifier(TableRef lv, std::shared_ptr realm); 31 | 32 | private: 33 | // The subtable, in handover form if this has not been attached to the main 34 | // SharedGroup yet 35 | TableRef m_table; 36 | std::unique_ptr> m_table_handover; 37 | 38 | // The last-seen size of the Table so that we can report row deletions 39 | // when the Table itself is deleted 40 | size_t m_prev_size; 41 | 42 | // The actual change, calculated in run() and delivered in prepare_handover() 43 | CollectionChangeBuilder m_change; 44 | TransactionChangeInfo* m_info; 45 | 46 | void run() override; 47 | 48 | void do_prepare_handover(SharedGroup&) override; 49 | 50 | void do_attach_to(SharedGroup& sg) override; 51 | void do_detach_from(SharedGroup& sg) override; 52 | 53 | void release_data() noexcept override; 54 | bool do_add_required_change_info(TransactionChangeInfo& info) override; 55 | }; 56 | } 57 | } 58 | 59 | #endif // REALM_OS_PRIMITIVE_LIST_NOTIFIER_HPP 60 | -------------------------------------------------------------------------------- /Pods/Realm/include/sync/impl/apple/network_reachability_observer.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2016 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #ifndef REALM_OS_NETWORK_REACHABILITY_OBSERVER_HPP 20 | #define REALM_OS_NETWORK_REACHABILITY_OBSERVER_HPP 21 | 22 | #include 23 | #include 24 | 25 | #include 26 | #include 27 | 28 | #include "sync/impl/network_reachability.hpp" 29 | 30 | #if NETWORK_REACHABILITY_AVAILABLE 31 | 32 | #include "sync/impl/apple/system_configuration.hpp" 33 | 34 | namespace realm { 35 | namespace _impl { 36 | 37 | enum NetworkReachabilityStatus { 38 | NotReachable, 39 | ReachableViaWiFi, 40 | ReachableViaWWAN 41 | }; 42 | 43 | class NetworkReachabilityObserver { 44 | public: 45 | NetworkReachabilityObserver(util::Optional hostname, 46 | std::function handler); 47 | 48 | ~NetworkReachabilityObserver(); 49 | 50 | NetworkReachabilityStatus reachability_status() const; 51 | 52 | bool start_observing(); 53 | void stop_observing(); 54 | 55 | private: 56 | void reachability_changed(); 57 | 58 | util::CFPtr m_reachability_ref; 59 | NetworkReachabilityStatus m_previous_status; 60 | dispatch_queue_t m_callback_queue; 61 | std::function m_change_handler; 62 | }; 63 | 64 | } // namespace _impl 65 | } // namespace realm 66 | 67 | #endif // NETWORK_REACHABILITY_AVAILABLE 68 | 69 | #endif // REALM_OS_NETWORK_REACHABILITY_OBSERVER_HPP 70 | -------------------------------------------------------------------------------- /Pods/Realm/include/sync/impl/network_reachability.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2017 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #ifndef REALM_OS_NETWORK_REACHABILITY_HPP 20 | #define REALM_OS_NETWORK_REACHABILITY_HPP 21 | 22 | #include 23 | 24 | #if REALM_PLATFORM_APPLE 25 | #define NETWORK_REACHABILITY_AVAILABLE !REALM_WATCHOS 26 | #else 27 | #define NETWORK_REACHABILITY_AVAILABLE 0 28 | #endif 29 | 30 | #endif // REALM_OS_NETWORK_REACHABILITY_HPP 31 | -------------------------------------------------------------------------------- /Pods/Realm/include/sync/impl/work_queue.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2018 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #ifndef REALM_OS_PARTIAL_SYNC_WORK_QUEUE 20 | #define REALM_OS_PARTIAL_SYNC_WORK_QUEUE 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | namespace realm { 29 | namespace _impl { 30 | namespace partial_sync { 31 | 32 | class WorkQueue { 33 | public: 34 | ~WorkQueue(); 35 | void enqueue(std::function function); 36 | 37 | private: 38 | void create_thread(); 39 | 40 | std::mutex m_mutex; 41 | std::condition_variable m_cv; 42 | std::vector> m_queue; 43 | std::thread m_thread; 44 | bool m_stopping = false; 45 | bool m_stopped = true; 46 | }; 47 | 48 | 49 | } // namespace partial_sync 50 | } // namespace _impl 51 | } // namespace realm 52 | 53 | #endif // REALM_OS_PARTIAL_SYNC_WORK_QUEUE 54 | -------------------------------------------------------------------------------- /Pods/Realm/include/sync/subscription_state.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2018 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #ifndef REALM_OS_SUBSCRIPTION_STATE_HPP 20 | #define REALM_OS_SUBSCRIPTION_STATE_HPP 21 | 22 | #include 23 | 24 | namespace realm { 25 | namespace partial_sync { 26 | 27 | // Enum describing the various states a partial sync subscription can have. 28 | enum class SubscriptionState : int8_t { 29 | Error = -1, // An error occurred while creating or processing the partial sync subscription. 30 | Creating = 2, // The subscription is being created. 31 | Pending = 0, // The subscription was created, but has not yet been processed by the sync server. 32 | Complete = 1, // The subscription has been processed by the sync server and data is being synced to the device. 33 | Invalidated = 3, // The subscription has been removed. 34 | }; 35 | 36 | } 37 | } 38 | 39 | #endif // REALM_OS_SUBSCRIPTION_STATE_HPP 40 | -------------------------------------------------------------------------------- /Pods/Realm/include/util/aligned_union.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2016 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or utilied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #ifndef REALM_OS_ALIGNED_UNION_HPP 20 | #define REALM_OS_ALIGNED_UNION_HPP 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | namespace realm { 27 | 28 | // Provide our own implementation of max as GCC 4.9's is not marked as constexpr. 29 | namespace _impl { 30 | 31 | template 32 | static constexpr const T& constexpr_max(const T& a, const T& b) 33 | { 34 | return a > b ? a : b; 35 | } 36 | 37 | template 38 | static constexpr const T& constexpr_max(const T* begin, const T *end) 39 | { 40 | return begin + 1 == end ? *begin : constexpr_max(*begin, constexpr_max(begin + 1, end)); 41 | } 42 | 43 | template 44 | static constexpr const T& constexpr_max(std::initializer_list list) 45 | { 46 | return constexpr_max(list.begin(), list.end()); 47 | } 48 | 49 | } // namespace _impl 50 | 51 | namespace util { 52 | 53 | // Provide our own implementation of `std::aligned_union` as it is missing from GCC 4.9. 54 | template 55 | struct AlignedUnion 56 | { 57 | static constexpr size_t alignment_value = _impl::constexpr_max({alignof(Types)...}); 58 | static constexpr size_t storage_size = _impl::constexpr_max({Len, sizeof(Types)...}); 59 | using type = typename std::aligned_storage::type; 60 | }; 61 | 62 | } // namespace util 63 | } // namespace realm 64 | 65 | #endif // REALM_OS_ALIGNED_UNION_HPP 66 | -------------------------------------------------------------------------------- /Pods/Realm/include/util/event_loop_signal.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2016 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or utilied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #ifndef REALM_EVENT_LOOP_SIGNAL_HPP 20 | #define REALM_EVENT_LOOP_SIGNAL_HPP 21 | 22 | #include 23 | 24 | #if (defined(REALM_HAVE_UV) && REALM_HAVE_UV && !REALM_PLATFORM_APPLE) || (defined(REALM_PLATFORM_NODE) && REALM_PLATFORM_NODE) 25 | #define REALM_USE_UV 1 26 | #else 27 | #define REALM_USE_UV 0 28 | #endif 29 | 30 | #if !defined(REALM_USE_CF) && REALM_PLATFORM_APPLE 31 | #define REALM_USE_CF 1 32 | #elif !defined(REALM_USE_ALOOPER) && REALM_ANDROID 33 | #define REALM_USE_ALOOPER 1 34 | #endif 35 | 36 | #if REALM_USE_UV 37 | #include "util/uv/event_loop_signal.hpp" 38 | #elif REALM_USE_CF 39 | #include "util/apple/event_loop_signal.hpp" 40 | #elif REALM_USE_ALOOPER 41 | #include "util/android/event_loop_signal.hpp" 42 | #else 43 | #include "util/generic/event_loop_signal.hpp" 44 | #endif 45 | 46 | #endif // REALM_EVENT_LOOP_SIGNAL_HPP 47 | -------------------------------------------------------------------------------- /Pods/Realm/include/util/uuid.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2017 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | #ifndef REALM_OS_UTIL_UUID_HPP 20 | #define REALM_OS_UTIL_UUID_HPP 21 | 22 | #include 23 | 24 | namespace realm { 25 | namespace util { 26 | 27 | // Generate a random UUID and return its formatted string representation. 28 | std::string uuid_string(); 29 | 30 | } // namespace util 31 | } // namespace realm 32 | 33 | #endif // REALM_OS_UTIL_UUID_HPP 34 | -------------------------------------------------------------------------------- /Pods/RealmSwift/RealmSwift/Aliases.swift: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2014 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | import Foundation 20 | import Realm 21 | 22 | // These types don't change when wrapping in Swift 23 | // so we just typealias them to remove the 'RLM' prefix 24 | 25 | // MARK: Aliases 26 | 27 | /** 28 | `PropertyType` is an enum describing all property types supported in Realm models. 29 | 30 | For more information, see [Realm Models](https://realm.io/docs/swift/latest/#models). 31 | 32 | ### Primitive types 33 | 34 | * `Int` 35 | * `Bool` 36 | * `Float` 37 | * `Double` 38 | 39 | ### Object types 40 | 41 | * `String` 42 | * `Data` 43 | * `Date` 44 | 45 | ### Relationships: Array (in Swift, `List`) and `Object` types 46 | 47 | * `Object` 48 | * `Array` 49 | */ 50 | public typealias PropertyType = RLMPropertyType 51 | 52 | /** 53 | An opaque token which is returned from methods which subscribe to changes to a Realm. 54 | 55 | - see: `Realm.observe(_:)` 56 | */ 57 | public typealias NotificationToken = RLMNotificationToken 58 | 59 | extension NotificationToken { 60 | @available(*, unavailable, renamed: "invalidate()") 61 | @nonobjc public func stop() { fatalError() } 62 | } 63 | -------------------------------------------------------------------------------- /Pods/RealmSwift/RealmSwift/Optional.swift: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright 2015 Realm Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | //////////////////////////////////////////////////////////////////////////// 18 | 19 | import Realm 20 | 21 | /// A protocol describing types that can parameterize a `RealmOptional`. 22 | public protocol RealmOptionalType { 23 | } 24 | 25 | public extension RealmOptionalType { 26 | /// :nodoc: 27 | public static func className() -> String { 28 | return "" 29 | } 30 | } 31 | extension Int: RealmOptionalType {} 32 | extension Int8: RealmOptionalType {} 33 | extension Int16: RealmOptionalType {} 34 | extension Int32: RealmOptionalType {} 35 | extension Int64: RealmOptionalType {} 36 | extension Float: RealmOptionalType {} 37 | extension Double: RealmOptionalType {} 38 | extension Bool: RealmOptionalType {} 39 | 40 | /** 41 | A `RealmOptional` instance represents an optional value for types that can't be 42 | directly declared as `@objc` in Swift, such as `Int`, `Float`, `Double`, and `Bool`. 43 | 44 | To change the underlying value stored by a `RealmOptional` instance, mutate the instance's `value` property. 45 | */ 46 | public final class RealmOptional: RLMOptionalBase { 47 | /// The value the optional represents. 48 | public var value: Value? { 49 | get { 50 | return RLMGetOptional(self).map(dynamicBridgeCast) 51 | } 52 | set { 53 | RLMSetOptional(self, newValue.map(dynamicBridgeCast)) 54 | } 55 | } 56 | 57 | /** 58 | Creates a `RealmOptional` instance encapsulating the given default value. 59 | 60 | - parameter value: The value to store in the optional, or `nil` if not specified. 61 | */ 62 | public init(_ value: Value? = nil) { 63 | super.init() 64 | self.value = value 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Pods/RealmSwift/RealmSwift/SwiftVersion.swift: -------------------------------------------------------------------------------- 1 | let swiftLanguageVersion = "4.1.2" 2 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Example/Pods-Example-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Example/Pods-Example-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_Example : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_Example 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Example/Pods-Example-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_ExampleVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_ExampleVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Realm" "${PODS_CONFIGURATION_BUILD_DIR}/RealmSwift" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Realm/core" 6 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Realm/Realm.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/RealmSwift/RealmSwift.framework/Headers" 7 | OTHER_LDFLAGS = $(inherited) -ObjC -l"c++" -l"realmcore-ios" -l"z" -framework "Realm" -framework "RealmSwift" -framework "Security" 8 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 9 | PODS_BUILD_DIR = ${BUILD_DIR} 10 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 11 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 12 | PODS_ROOT = ${SRCROOT}/Pods 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Example/Pods-Example.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_Example { 2 | umbrella header "Pods-Example-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Example/Pods-Example.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Realm" "${PODS_CONFIGURATION_BUILD_DIR}/RealmSwift" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Realm/core" 6 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Realm/Realm.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/RealmSwift/RealmSwift.framework/Headers" 7 | OTHER_LDFLAGS = $(inherited) -ObjC -l"c++" -l"realmcore-ios" -l"z" -framework "Realm" -framework "RealmSwift" -framework "Security" 8 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 9 | PODS_BUILD_DIR = ${BUILD_DIR} 10 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 11 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 12 | PODS_ROOT = ${SRCROOT}/Pods 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-RealmSwiftService/Pods-RealmSwiftService-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-RealmSwiftService/Pods-RealmSwiftService-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_RealmSwiftService : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_RealmSwiftService 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-RealmSwiftService/Pods-RealmSwiftService-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_RealmSwiftServiceVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_RealmSwiftServiceVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-RealmSwiftService/Pods-RealmSwiftService.debug.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Realm" "${PODS_CONFIGURATION_BUILD_DIR}/RealmSwift" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' '@executable_path/../../Frameworks' 4 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Realm/core" 5 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Realm/Realm.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/RealmSwift/RealmSwift.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -ObjC -l"c++" -l"realmcore-ios" -l"z" -framework "Realm" -framework "RealmSwift" -framework "Security" 7 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-RealmSwiftService/Pods-RealmSwiftService.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_RealmSwiftService { 2 | umbrella header "Pods-RealmSwiftService-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-RealmSwiftService/Pods-RealmSwiftService.release.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Realm" "${PODS_CONFIGURATION_BUILD_DIR}/RealmSwift" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' '@executable_path/../../Frameworks' 4 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Realm/core" 5 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Realm/Realm.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/RealmSwift/RealmSwift.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -ObjC -l"c++" -l"realmcore-ios" -l"z" -framework "Realm" -framework "RealmSwift" -framework "Security" 7 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-RealmSwiftServiceTests/Pods-RealmSwiftServiceTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-RealmSwiftServiceTests/Pods-RealmSwiftServiceTests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-RealmSwiftServiceTests/Pods-RealmSwiftServiceTests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Generated by CocoaPods - https://cocoapods.org 18 | Title 19 | 20 | Type 21 | PSGroupSpecifier 22 | 23 | 24 | StringsTable 25 | Acknowledgements 26 | Title 27 | Acknowledgements 28 | 29 | 30 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-RealmSwiftServiceTests/Pods-RealmSwiftServiceTests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_RealmSwiftServiceTests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_RealmSwiftServiceTests 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-RealmSwiftServiceTests/Pods-RealmSwiftServiceTests-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_RealmSwiftServiceTestsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_RealmSwiftServiceTestsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-RealmSwiftServiceTests/Pods-RealmSwiftServiceTests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Realm" "${PODS_CONFIGURATION_BUILD_DIR}/RealmSwift" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Realm/Realm.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/RealmSwift/RealmSwift.framework/Headers" 5 | OTHER_LDFLAGS = $(inherited) -l"c++" -l"z" -framework "Realm" -framework "RealmSwift" -framework "Security" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-RealmSwiftServiceTests/Pods-RealmSwiftServiceTests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_RealmSwiftServiceTests { 2 | umbrella header "Pods-RealmSwiftServiceTests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-RealmSwiftServiceTests/Pods-RealmSwiftServiceTests.release.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Realm" "${PODS_CONFIGURATION_BUILD_DIR}/RealmSwift" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Realm/Realm.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/RealmSwift/RealmSwift.framework/Headers" 5 | OTHER_LDFLAGS = $(inherited) -l"c++" -l"z" -framework "Realm" -framework "RealmSwift" -framework "Security" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Realm/Realm-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 3.11.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Realm/Realm-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Realm : NSObject 3 | @end 4 | @implementation PodsDummy_Realm 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Realm/Realm-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Realm/Realm.modulemap: -------------------------------------------------------------------------------- 1 | framework module Realm { 2 | umbrella header "Realm.h" 3 | 4 | export * 5 | module * { export * } 6 | 7 | explicit module Private { 8 | header "RLMAccessor.h" 9 | header "RLMArray_Private.h" 10 | header "RLMCollection_Private.h" 11 | header "RLMListBase.h" 12 | header "RLMObject_Private.h" 13 | header "RLMObjectBase_Dynamic.h" 14 | header "RLMObjectBase_Private.h" 15 | header "RLMObjectSchema_Private.h" 16 | header "RLMObjectStore.h" 17 | header "RLMOptionalBase.h" 18 | header "RLMProperty_Private.h" 19 | header "RLMRealm_Private.h" 20 | header "RLMRealmConfiguration_Private.h" 21 | header "RLMResults_Private.h" 22 | header "RLMSchema_Private.h" 23 | header "RLMSyncConfiguration_Private.h" 24 | header "RLMSyncUtil_Private.h" 25 | } 26 | 27 | explicit module Dynamic { 28 | header "RLMRealm_Dynamic.h" 29 | header "RLMObjectBase_Dynamic.h" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Realm/Realm.xcconfig: -------------------------------------------------------------------------------- 1 | APPLICATION_EXTENSION_API_ONLY = YES 2 | CLANG_CXX_LANGUAGE_STANDARD = c++14 3 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = NO 4 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Realm 5 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 6 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Realm/core" 7 | OTHER_CPLUSPLUSFLAGS = -isystem "${PODS_ROOT}/Realm/include/core" -fvisibility-inlines-hidden 8 | OTHER_LDFLAGS = $(inherited) -l"c++" -l"realmcore-ios" -l"z" -framework "Security" 9 | PODS_BUILD_DIR = ${BUILD_DIR} 10 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 11 | PODS_ROOT = ${SRCROOT} 12 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Realm 13 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 14 | SKIP_INSTALL = YES 15 | USER_HEADER_SEARCH_PATHS = "${PODS_ROOT}/Realm/include" "${PODS_ROOT}/Realm/include/Realm" 16 | -------------------------------------------------------------------------------- /Pods/Target Support Files/RealmSwift/RealmSwift-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 3.11.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/RealmSwift/RealmSwift-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_RealmSwift : NSObject 3 | @end 4 | @implementation PodsDummy_RealmSwift 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/RealmSwift/RealmSwift-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/RealmSwift/RealmSwift-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double RealmSwiftVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char RealmSwiftVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/RealmSwift/RealmSwift.modulemap: -------------------------------------------------------------------------------- 1 | framework module RealmSwift { 2 | umbrella header "RealmSwift-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/RealmSwift/RealmSwift.xcconfig: -------------------------------------------------------------------------------- 1 | APPLICATION_EXTENSION_API_ONLY = YES 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/RealmSwift 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Realm" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | OTHER_LDFLAGS = $(inherited) -l"c++" -l"z" -framework "Realm" -framework "Security" 6 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 7 | PODS_BUILD_DIR = ${BUILD_DIR} 8 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_ROOT = ${SRCROOT} 10 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/RealmSwift 11 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 12 | SKIP_INSTALL = YES 13 | -------------------------------------------------------------------------------- /RealmSwiftService.podspec: -------------------------------------------------------------------------------- 1 | Pod::s.new do |s| 2 | s.name = "RealmSwiftService" 3 | s.version = "0.0.1" 4 | s.summary = "RealmSwiftService Supports Realm standard CRUD functions" 5 | s.description = <<-DESC 6 | RealmService Supports Realm standard CRUD functions. 7 | You can do actions(find, save, delete) to Realm Object. 8 | DESC 9 | s.homepage = "https://github.com/yokurin/RealmSwiftService" 10 | s.license = { :type => "MIT", :file => "LICENSE" } 11 | s.author = { "Tsubasa Hayashi" => "yoku.rin.99@gmail.com" } 12 | s.social_media_url = "https://twitter.com/_yokurin" 13 | s.platform = :ios 14 | s.source = { :git => "http://github.com/yokurin/RealmSwiftService.git", :tag => "#{s.version}" } 15 | s.source_files = "RealmSwiftService", "RealmSwiftService/**/*.{h,swift}" 16 | # s.exclude_files = "RealmSwiftService/Exclude" 17 | s.dependency "RealmSwift", "~> 3.11" 18 | # s.ios.deployment_target = '8.0' 19 | # s.osx.deployment_target = '10.10' 20 | end 21 | -------------------------------------------------------------------------------- /RealmSwiftService.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /RealmSwiftService.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /RealmSwiftService.xcodeproj/xcuserdata/hayashi.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Example.xcscheme 8 | 9 | orderHint 10 | 6 11 | 12 | RealmSwiftService.xcscheme 13 | 14 | orderHint 15 | 5 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /RealmSwiftService.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /RealmSwiftService.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /RealmSwiftService/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | 22 | 23 | -------------------------------------------------------------------------------- /RealmSwiftService/RealmSwiftService.h: -------------------------------------------------------------------------------- 1 | // 2 | // RealmSwiftService.h 3 | // RealmSwiftService 4 | // 5 | // Created by Tsubasa Hayashi on 2018/11/05. 6 | // Copyright © 2018 Tsubasa Hayashi. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for RealmSwiftService. 12 | FOUNDATION_EXPORT double RealmSwiftServiceVersionNumber; 13 | 14 | //! Project version string for RealmSwiftService. 15 | FOUNDATION_EXPORT const unsigned char RealmSwiftServiceVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /RealmSwiftServiceTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /RealmSwiftServiceTests/RealmSwiftServiceTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RealmSwiftServiceTests.swift 3 | // RealmSwiftServiceTests 4 | // 5 | // Created by Tsubasa Hayashi on 2018/11/05. 6 | // Copyright © 2018 Tsubasa Hayashi. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import RealmSwiftService 11 | 12 | class RealmSwiftServiceTests: XCTestCase { 13 | 14 | override func setUp() { 15 | // Put setup code here. This method is called before the invocation of each test method in the class. 16 | } 17 | 18 | override func tearDown() { 19 | // Put teardown code here. This method is called after the invocation of each test method in the class. 20 | } 21 | 22 | func testExample() { 23 | // This is an example of a functional test case. 24 | // Use XCTAssert and related functions to verify your tests produce the correct results. 25 | } 26 | 27 | func testPerformanceExample() { 28 | // This is an example of a performance test case. 29 | self.measure { 30 | // Put the code you want to measure the time of here. 31 | } 32 | } 33 | 34 | } 35 | --------------------------------------------------------------------------------