forked from FahimF/SQLiteDB
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for returning data by its stored data type - or String …
…if type couldn't be determined, Modified the Singleton code to ensure that init() cannot be called more than once, Added a bridging class to handle the string escape functionality since I could not figure out how to call the necessary C API from Swift directly, Integrated multiple bugfixes from rschmukler/bug-fixes
- Loading branch information
Showing
5 changed files
with
99 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// Bridge.h | ||
// TasksGalore | ||
// | ||
// Created by Fahim Farook on 15/6/14. | ||
// Copyright (c) 2014 RookSoft Pte. Ltd. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
@interface Bridge : NSObject | ||
|
||
+(NSString *)esc:(NSString *)str; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// Bridge.m | ||
// TasksGalore | ||
// | ||
// Created by Fahim Farook on 15/6/14. | ||
// Copyright (c) 2014 RookSoft Pte. Ltd. All rights reserved. | ||
// | ||
|
||
#import "Bridge.h" | ||
#import "sqlite3.h" | ||
|
||
@implementation Bridge | ||
|
||
+(NSString *)esc:(NSString *)str { | ||
if (!str || [str length] == 0) { | ||
return @""; | ||
} | ||
NSString *buf = @(sqlite3_mprintf("%q", [str cStringUsingEncoding:NSUTF8StringEncoding])); | ||
return buf; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// | ||
// Bridging-Header.h | ||
// TasksGalore | ||
// | ||
// Created by Fahim Farook on 12/6/14. | ||
// Copyright (c) 2014 RookSoft Pte. Ltd. All rights reserved. | ||
// | ||
|
||
#import "sqlite3.h" | ||
#import <time.h> | ||
#import "Bridge.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters