123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- #import <Foundation/Foundation.h>
- #ifdef NS_HEADER_AUDIT_BEGIN
- #define RLM_HEADER_AUDIT_BEGIN NS_HEADER_AUDIT_BEGIN
- #define RLM_HEADER_AUDIT_END NS_HEADER_AUDIT_END
- #else
- #define RLM_HEADER_AUDIT_BEGIN(...) NS_ASSUME_NONNULL_BEGIN
- #define RLM_HEADER_AUDIT_END(...) NS_ASSUME_NONNULL_END
- #endif
- #ifdef NS_SWIFT_SENDABLE
- #define RLM_SWIFT_SENDABLE NS_SWIFT_SENDABLE
- #else
- #define RLM_SWIFT_SENDABLE
- #endif
- #define RLM_FINAL __attribute__((objc_subclassing_restricted))
- RLM_HEADER_AUDIT_BEGIN(nullability, sendability)
- #ifdef NS_CLOSED_ENUM
- #define RLM_CLOSED_ENUM NS_CLOSED_ENUM
- #else
- #define RLM_CLOSED_ENUM NS_ENUM
- #endif
- #if __has_attribute(ns_error_domain) && (!defined(__cplusplus) || !__cplusplus || __cplusplus >= 201103L)
- #define RLM_ERROR_ENUM(type, name, domain) \
- _Pragma("clang diagnostic push") \
- _Pragma("clang diagnostic ignored \"-Wignored-attributes\"") \
- NS_ENUM(type, __attribute__((ns_error_domain(domain))) name) \
- _Pragma("clang diagnostic pop")
- #else
- #define RLM_ERROR_ENUM(type, name, domain) NS_ENUM(type, name)
- #endif
- #define REALM_HIDDEN __attribute__((visibility("hidden")))
- #pragma mark - Enums
- typedef RLM_CLOSED_ENUM(int32_t, RLMPropertyType) {
- #pragma mark - Primitive types
-
- RLMPropertyTypeInt = 0,
-
- RLMPropertyTypeBool = 1,
-
- RLMPropertyTypeFloat = 5,
-
- RLMPropertyTypeDouble = 6,
-
- RLMPropertyTypeUUID = 12,
- #pragma mark - Object types
-
- RLMPropertyTypeString = 2,
-
- RLMPropertyTypeData = 3,
-
- RLMPropertyTypeAny = 9,
-
- RLMPropertyTypeDate = 4,
- #pragma mark - Linked object types
-
- RLMPropertyTypeObject = 7,
-
- RLMPropertyTypeLinkingObjects = 8,
- RLMPropertyTypeObjectId = 10,
- RLMPropertyTypeDecimal128 = 11
- };
- #pragma mark - Notification Constants
- typedef NSString * RLMNotification NS_EXTENSIBLE_STRING_ENUM;
- extern RLMNotification const RLMRealmRefreshRequiredNotification NS_SWIFT_NAME(RefreshRequired);
- extern RLMNotification const RLMRealmDidChangeNotification NS_SWIFT_NAME(DidChange);
- #pragma mark - Error keys
- extern NSString * const RLMBackupRealmConfigurationErrorKey;
- #pragma mark - Other Constants
- extern const uint64_t RLMNotVersioned;
- extern NSString * const RLMExceptionName;
- extern NSString * const RLMRealmVersionKey;
- extern NSString * const RLMRealmCoreVersionKey;
- extern NSString * const RLMInvalidatedKey;
- RLM_HEADER_AUDIT_END(nullability, sendability)
|