123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203 |
- #import <Foundation/Foundation.h>
- NS_ASSUME_NONNULL_BEGIN
- #ifdef NS_EXTENSIBLE_STRING_ENUM
- #define RLM_EXTENSIBLE_STRING_ENUM NS_EXTENSIBLE_STRING_ENUM
- #define RLM_EXTENSIBLE_STRING_ENUM_CASE_SWIFT_NAME(_, extensible_string_enum) NS_SWIFT_NAME(extensible_string_enum)
- #else
- #define RLM_EXTENSIBLE_STRING_ENUM
- #define RLM_EXTENSIBLE_STRING_ENUM_CASE_SWIFT_NAME(fully_qualified, _) NS_SWIFT_NAME(fully_qualified)
- #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
- #pragma mark - Enums
- typedef NS_ENUM(int32_t, RLMPropertyType) {
- #pragma mark - Primitive types
-
- RLMPropertyTypeInt = 0,
-
- RLMPropertyTypeBool = 1,
-
- RLMPropertyTypeFloat = 5,
-
- RLMPropertyTypeDouble = 6,
- #pragma mark - Object types
-
- RLMPropertyTypeString = 2,
-
- RLMPropertyTypeData = 3,
-
- RLMPropertyTypeAny = 9,
-
- RLMPropertyTypeDate = 4,
- #pragma mark - Array/Linked object types
-
- RLMPropertyTypeObject = 7,
-
- RLMPropertyTypeArray = 128,
-
- RLMPropertyTypeLinkingObjects = 8,
- };
- extern NSString * const RLMErrorDomain;
- extern NSString * const RLMUnknownSystemErrorDomain;
- typedef RLM_ERROR_ENUM(NSInteger, RLMError, RLMErrorDomain) {
-
- RLMErrorFail = 1,
-
- RLMErrorFileAccess = 2,
-
- RLMErrorFilePermissionDenied = 3,
-
- RLMErrorFileExists = 4,
-
- RLMErrorFileNotFound = 5,
-
- RLMErrorFileFormatUpgradeRequired = 6,
-
- RLMErrorIncompatibleLockFile = 8,
-
- RLMErrorAddressSpaceExhausted = 9,
-
- RLMErrorSchemaMismatch = 10,
- };
- #pragma mark - Constants
- #pragma mark - Notification Constants
- typedef NSString * RLMNotification RLM_EXTENSIBLE_STRING_ENUM;
- extern RLMNotification const RLMRealmRefreshRequiredNotification
- RLM_EXTENSIBLE_STRING_ENUM_CASE_SWIFT_NAME(RLMRealmRefreshRequiredNotification, RefreshRequired);
- extern RLMNotification const RLMRealmDidChangeNotification
- RLM_EXTENSIBLE_STRING_ENUM_CASE_SWIFT_NAME(RLMRealmDidChangeNotification, DidChange);
- #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;
- NS_ASSUME_NONNULL_END
|