Fixed Location & Storage issues

This commit is contained in:
2024-05-25 11:05:02 +09:00
parent e55674e1b9
commit 6a49aed98d
861 changed files with 80074 additions and 402 deletions

View File

@ -0,0 +1,20 @@
//
// SqfliteCursor.h
// sqflite
//
// Created by Alexandre Roux on 24/10/2022.
//
#ifndef SqfliteCursor_h
#define SqfliteCursor_h
// Cursor information
@class FMResultSet;
@interface SqfliteCursor : NSObject
@property (atomic, retain) NSNumber* cursorId;
@property (atomic, retain) NSNumber* pageSize;
@property (atomic, retain) FMResultSet *resultSet;
@end
#endif // SqfliteCursor_h

View File

@ -0,0 +1,41 @@
//
// SqfliteDatabase.h
// sqflite
//
// Created by Alexandre Roux on 24/10/2022.
//
#ifndef SqfliteDatabase_h
#define SqfliteDatabase_h
#import "SqfliteCursor.h"
#import "SqfliteOperation.h"
@class FMDatabaseQueue,FMDatabase;
@interface SqfliteDatabase : NSObject
@property (atomic, retain) FMDatabaseQueue *fmDatabaseQueue;
@property (atomic, retain) NSNumber *databaseId;
@property (atomic, retain) NSString* path;
@property (nonatomic) bool singleInstance;
@property (nonatomic) bool inTransaction;
@property (nonatomic) int logLevel;
// Curosr support
@property (nonatomic) int lastCursorId;
@property (atomic, retain) NSMutableDictionary<NSNumber*, SqfliteCursor*>* cursorMap;
// Transaction v2
@property (nonatomic) int lastTransactionId;
@property (atomic, retain) NSNumber *currentTransactionId;
@property (atomic, retain) NSMutableArray<SqfliteQueuedOperation*>* noTransactionOperationQueue;
- (void)closeCursorById:(NSNumber*)cursorId;
- (void)closeCursor:(SqfliteCursor*)cursor;
- (void)inDatabase:(void (^)(FMDatabase *db))block;
- (void)dbBatch:(FMDatabase*)db operation:(SqfliteMethodCallOperation*)mainOperation;
- (void)dbExecute:(FMDatabase*)db operation:(SqfliteOperation*)operation;
- (void)dbInsert:(FMDatabase*)db operation:(SqfliteOperation*)operation;
- (void)dbUpdate:(FMDatabase*)db operation:(SqfliteOperation*)operation;
- (void)dbQuery:(FMDatabase*)db operation:(SqfliteOperation*)operation;
- (void)dbQueryCursorNext:(FMDatabase*)db operation:(SqfliteOperation*)operation;
@end
#endif // SqfliteDatabase_h

View File

@ -0,0 +1,16 @@
//
// SqfliteImport.h
// sqflite
//
// Created by Alexandre Roux on 24/10/2022.
//
#ifndef SqfliteImport_h
#define SqfliteImport_h
#if TARGET_OS_IPHONE
#import <Flutter/Flutter.h>
#else
#import <FlutterMacOS/FlutterMacOS.h>
#endif
#endif // SqfliteImport_h

View File

@ -0,0 +1,62 @@
//
// Operation.h
// sqflite
//
// Created by Alexandre Roux on 09/01/2018.
//
#ifndef SqfliteOperation_h
#define SqfliteOperation_h
#import "SqfliteImport.h"
@class FMDatabase;
@interface SqfliteOperation : NSObject
- (NSString*)getMethod;
- (NSString*)getSql;
- (NSArray*)getSqlArguments;
- (NSNumber*)getInTransactionChange;
- (void)success:(NSObject*)results;
- (void)error:(FlutterError*)error;
- (bool)getNoResult;
- (bool)getContinueOnError;
- (bool)hasNullTransactionId;
- (NSNumber*)getTransactionId;
// Generic way to get any argument
- (id)getArgument:(NSString*)key;
- (bool)hasArgument:(NSString*)key;
@end
@interface SqfliteBatchOperation : SqfliteOperation
@property (atomic, retain) NSDictionary* dictionary;
@property (atomic, retain) NSObject* results;
@property (atomic, retain) FlutterError* error;
@property (atomic, assign) bool noResult;
@property (atomic, assign) bool continueOnError;
- (void)handleSuccess:(NSMutableArray*)results;
- (void)handleErrorContinue:(NSMutableArray*)results;
- (void)handleError:(FlutterResult)result;
@end
@interface SqfliteMethodCallOperation : SqfliteOperation
@property (atomic, retain) FlutterMethodCall* flutterMethodCall;
@property (atomic, copy) FlutterResult flutterResult;
+ (SqfliteMethodCallOperation*)newWithCall:(FlutterMethodCall*)flutterMethodCall result:(FlutterResult)flutterResult;
@end
typedef void(^SqfliteOperationHandler)(FMDatabase* db, SqfliteOperation* operation);
@interface SqfliteQueuedOperation : NSObject
@property (atomic, retain) SqfliteOperation* operation;
@property (atomic, copy) SqfliteOperationHandler handler;
@end
#endif // SqfliteOperation_h

View File

@ -0,0 +1,51 @@
//
// SqflitePlugin.h
// sqflite
//
// Created by Alexandre Roux on 24/10/2022.
//
#ifndef SqflitePlugin_h
#define SqflitePlugin_h
#import "SqfliteImport.h"
@class FMResultSet;
@interface SqflitePlugin : NSObject<FlutterPlugin>
+ (NSArray*)toSqlArguments:(NSArray*)rawArguments;
+ (bool)arrayIsEmpy:(NSArray*)array;
+ (NSMutableDictionary*)resultSetToResults:(FMResultSet*)resultSet cursorPageSize:(NSNumber*)cursorPageSize;
@end
extern NSString *const SqfliteMethodExecute;;
extern NSString *const SqfliteMethodInsert;
extern NSString *const SqfliteMethodUpdate;
extern NSString *const SqfliteMethodQuery;
extern NSString *const SqfliteErrorBadParam;
extern NSString *const SqliteErrorCode;
extern NSString *const SqfliteParamMethod;
extern NSString *const SqfliteParamSql;
extern NSString *const SqfliteParamSqlArguments;
extern NSString *const SqfliteParamInTransactionChange;
extern NSString *const SqfliteParamNoResult;
extern NSString *const SqfliteParamContinueOnError;
extern NSString *const SqfliteParamResult;
extern NSString *const SqfliteParamError;
extern NSString *const SqfliteParamErrorCode;
extern NSString *const SqfliteParamErrorMessage;
extern NSString *const SqfliteParamErrorData;
extern NSString *const SqfliteParamTransactionId;
// Static helpers
static const int sqfliteLogLevelNone = 0;
static const int sqfliteLogLevelSql = 1;
static const int sqfliteLogLevelVerbose = 2;
extern bool sqfliteHasSqlLogLevel(int logLevel);
// True for verbose debugging
extern bool sqfliteHasVerboseLogLevel(int logLevel);
#endif // SqflitePlugin_h

View File

@ -0,0 +1,21 @@
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
#import "SqfliteCursor.h"
#import "SqfliteDatabase.h"
#import "SqfliteImport.h"
#import "SqfliteOperation.h"
#import "SqflitePlugin.h"
FOUNDATION_EXPORT double sqfliteVersionNumber;
FOUNDATION_EXPORT const unsigned char sqfliteVersionString[];

View File

@ -0,0 +1,6 @@
framework module sqflite {
umbrella header "sqflite-umbrella.h"
export *
module * { export * }
}

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrivacyTrackingDomains</key>
<array/>
<key>NSPrivacyAccessedAPITypes</key>
<array/>
<key>NSPrivacyCollectedDataTypes</key>
<array/>
<key>NSPrivacyTracking</key>
<false/>
</dict>
</plist>