bug fix
This commit is contained in:
140
ios/Pods/FMDB/src/fmdb/FMDatabasePool.h
generated
Normal file → Executable file
140
ios/Pods/FMDB/src/fmdb/FMDatabasePool.h
generated
Normal file → Executable file
@@ -8,6 +8,8 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class FMDatabase;
|
||||
|
||||
/** Pool of `<FMDatabase>` objects.
|
||||
@@ -28,27 +30,15 @@
|
||||
in the main.m file.
|
||||
*/
|
||||
|
||||
@interface FMDatabasePool : NSObject {
|
||||
NSString *_path;
|
||||
|
||||
dispatch_queue_t _lockQueue;
|
||||
|
||||
NSMutableArray *_databaseInPool;
|
||||
NSMutableArray *_databaseOutPool;
|
||||
|
||||
__unsafe_unretained id _delegate;
|
||||
|
||||
NSUInteger _maximumNumberOfDatabasesToCreate;
|
||||
int _openFlags;
|
||||
}
|
||||
@interface FMDatabasePool : NSObject
|
||||
|
||||
/** Database path */
|
||||
|
||||
@property (atomic, retain) NSString *path;
|
||||
@property (atomic, copy, nullable) NSString *path;
|
||||
|
||||
/** Delegate object */
|
||||
|
||||
@property (atomic, assign) id delegate;
|
||||
@property (atomic, assign, nullable) id delegate;
|
||||
|
||||
/** Maximum number of databases to create */
|
||||
|
||||
@@ -58,73 +48,140 @@
|
||||
|
||||
@property (atomic, readonly) int openFlags;
|
||||
|
||||
/** Custom virtual file system name */
|
||||
|
||||
@property (atomic, copy, nullable) NSString *vfsName;
|
||||
|
||||
|
||||
///---------------------
|
||||
/// @name Initialization
|
||||
///---------------------
|
||||
|
||||
/** Create pool using path.
|
||||
|
||||
|
||||
@param aPath The file path of the database.
|
||||
|
||||
|
||||
@return The `FMDatabasePool` object. `nil` on error.
|
||||
*/
|
||||
|
||||
+ (instancetype)databasePoolWithPath:(NSString*)aPath;
|
||||
+ (instancetype)databasePoolWithPath:(NSString * _Nullable)aPath;
|
||||
|
||||
/** Create pool using file URL.
|
||||
|
||||
@param url The file `NSURL` of the database.
|
||||
|
||||
@return The `FMDatabasePool` object. `nil` on error.
|
||||
*/
|
||||
|
||||
+ (instancetype)databasePoolWithURL:(NSURL * _Nullable)url;
|
||||
|
||||
/** Create pool using path and specified flags
|
||||
|
||||
|
||||
@param aPath The file path of the database.
|
||||
@param openFlags Flags passed to the openWithFlags method of the database
|
||||
|
||||
@param openFlags Flags passed to the openWithFlags method of the database.
|
||||
|
||||
@return The `FMDatabasePool` object. `nil` on error.
|
||||
*/
|
||||
|
||||
+ (instancetype)databasePoolWithPath:(NSString*)aPath flags:(int)openFlags;
|
||||
+ (instancetype)databasePoolWithPath:(NSString * _Nullable)aPath flags:(int)openFlags;
|
||||
|
||||
/** Create pool using file URL and specified flags
|
||||
|
||||
@param url The file `NSURL` of the database.
|
||||
@param openFlags Flags passed to the openWithFlags method of the database.
|
||||
|
||||
@return The `FMDatabasePool` object. `nil` on error.
|
||||
*/
|
||||
|
||||
+ (instancetype)databasePoolWithURL:(NSURL * _Nullable)url flags:(int)openFlags;
|
||||
|
||||
/** Create pool using path.
|
||||
|
||||
|
||||
@param aPath The file path of the database.
|
||||
|
||||
|
||||
@return The `FMDatabasePool` object. `nil` on error.
|
||||
*/
|
||||
|
||||
- (instancetype)initWithPath:(NSString*)aPath;
|
||||
- (instancetype)initWithPath:(NSString * _Nullable)aPath;
|
||||
|
||||
/** Create pool using file URL.
|
||||
|
||||
@param url The file `NSURL of the database.
|
||||
|
||||
@return The `FMDatabasePool` object. `nil` on error.
|
||||
*/
|
||||
|
||||
- (instancetype)initWithURL:(NSURL * _Nullable)url;
|
||||
|
||||
/** Create pool using path and specified flags.
|
||||
|
||||
|
||||
@param aPath The file path of the database.
|
||||
@param openFlags Flags passed to the openWithFlags method of the database
|
||||
|
||||
|
||||
@return The `FMDatabasePool` object. `nil` on error.
|
||||
*/
|
||||
|
||||
- (instancetype)initWithPath:(NSString*)aPath flags:(int)openFlags;
|
||||
- (instancetype)initWithPath:(NSString * _Nullable)aPath flags:(int)openFlags;
|
||||
|
||||
/** Create pool using file URL and specified flags.
|
||||
|
||||
@param url The file `NSURL` of the database.
|
||||
@param openFlags Flags passed to the openWithFlags method of the database
|
||||
|
||||
@return The `FMDatabasePool` object. `nil` on error.
|
||||
*/
|
||||
|
||||
- (instancetype)initWithURL:(NSURL * _Nullable)url flags:(int)openFlags;
|
||||
|
||||
/** Create pool using path and specified flags.
|
||||
|
||||
@param aPath The file path of the database.
|
||||
@param openFlags Flags passed to the openWithFlags method of the database
|
||||
@param vfsName The name of a custom virtual file system
|
||||
|
||||
@return The `FMDatabasePool` object. `nil` on error.
|
||||
*/
|
||||
|
||||
- (instancetype)initWithPath:(NSString * _Nullable)aPath flags:(int)openFlags vfs:(NSString * _Nullable)vfsName;
|
||||
|
||||
/** Create pool using file URL and specified flags.
|
||||
|
||||
@param url The file `NSURL` of the database.
|
||||
@param openFlags Flags passed to the openWithFlags method of the database
|
||||
@param vfsName The name of a custom virtual file system
|
||||
|
||||
@return The `FMDatabasePool` object. `nil` on error.
|
||||
*/
|
||||
|
||||
- (instancetype)initWithURL:(NSURL * _Nullable)url flags:(int)openFlags vfs:(NSString * _Nullable)vfsName;
|
||||
|
||||
/** Returns the Class of 'FMDatabase' subclass, that will be used to instantiate database object.
|
||||
|
||||
Subclasses can override this method to return specified Class of 'FMDatabase' subclass.
|
||||
|
||||
@return The Class of 'FMDatabase' subclass, that will be used to instantiate database object.
|
||||
*/
|
||||
|
||||
+ (Class)databaseClass;
|
||||
|
||||
///------------------------------------------------
|
||||
/// @name Keeping track of checked in/out databases
|
||||
///------------------------------------------------
|
||||
|
||||
/** Number of checked-in databases in pool
|
||||
|
||||
@returns Number of databases
|
||||
*/
|
||||
|
||||
- (NSUInteger)countOfCheckedInDatabases;
|
||||
@property (nonatomic, readonly) NSUInteger countOfCheckedInDatabases;
|
||||
|
||||
/** Number of checked-out databases in pool
|
||||
|
||||
@returns Number of databases
|
||||
*/
|
||||
|
||||
- (NSUInteger)countOfCheckedOutDatabases;
|
||||
@property (nonatomic, readonly) NSUInteger countOfCheckedOutDatabases;
|
||||
|
||||
/** Total number of databases in pool
|
||||
|
||||
@returns Number of databases
|
||||
*/
|
||||
|
||||
- (NSUInteger)countOfOpenDatabases;
|
||||
@property (nonatomic, readonly) NSUInteger countOfOpenDatabases;
|
||||
|
||||
/** Release all databases in pool */
|
||||
|
||||
@@ -139,21 +196,21 @@
|
||||
@param block The code to be run on the `FMDatabasePool` pool.
|
||||
*/
|
||||
|
||||
- (void)inDatabase:(void (^)(FMDatabase *db))block;
|
||||
- (void)inDatabase:(__attribute__((noescape)) void (^)(FMDatabase *db))block;
|
||||
|
||||
/** Synchronously perform database operations in pool using transaction.
|
||||
|
||||
@param block The code to be run on the `FMDatabasePool` pool.
|
||||
*/
|
||||
|
||||
- (void)inTransaction:(void (^)(FMDatabase *db, BOOL *rollback))block;
|
||||
- (void)inTransaction:(__attribute__((noescape)) void (^)(FMDatabase *db, BOOL *rollback))block;
|
||||
|
||||
/** Synchronously perform database operations in pool using deferred transaction.
|
||||
|
||||
@param block The code to be run on the `FMDatabasePool` pool.
|
||||
*/
|
||||
|
||||
- (void)inDeferredTransaction:(void (^)(FMDatabase *db, BOOL *rollback))block;
|
||||
- (void)inDeferredTransaction:(__attribute__((noescape)) void (^)(FMDatabase *db, BOOL *rollback))block;
|
||||
|
||||
/** Synchronously perform database operations in pool using save point.
|
||||
|
||||
@@ -164,7 +221,7 @@
|
||||
@warning You can not nest these, since calling it will pull another database out of the pool and you'll get a deadlock. If you need to nest, use `<[FMDatabase startSavePointWithName:error:]>` instead.
|
||||
*/
|
||||
|
||||
- (NSError*)inSavePoint:(void (^)(FMDatabase *db, BOOL *rollback))block;
|
||||
- (NSError * _Nullable)inSavePoint:(__attribute__((noescape)) void (^)(FMDatabase *db, BOOL *rollback))block;
|
||||
|
||||
@end
|
||||
|
||||
@@ -198,3 +255,4 @@
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
Reference in New Issue
Block a user