Skip to content

Commit

Permalink
Refactor: apply method chaining for SQLConditionBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
wving5 committed May 23, 2019
1 parent 6a19812 commit 36cfd7f
Show file tree
Hide file tree
Showing 29 changed files with 803 additions and 885 deletions.
64 changes: 39 additions & 25 deletions Demo-iOS/iOS-Demo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@
366B23441CFD8A63006743C0 /* LKTestModels.m in Sources */ = {isa = PBXBuildFile; fileRef = 366B23421CFD8A63006743C0 /* LKTestModels.m */; };
366B23461CFD8CEB006743C0 /* Snip20130620_6.png in Resources */ = {isa = PBXBuildFile; fileRef = 366B23451CFD8CEB006743C0 /* Snip20130620_6.png */; };
6BCE93B2428F3E6E81B59859 /* libPods-iOS-Demo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A05ED3193E536326FFEB6E6B /* libPods-iOS-Demo.a */; };
B61E1DF32296A3BF00D34103 /* LKDBSQLBuilderTest.m in Sources */ = {isa = PBXBuildFile; fileRef = B61E1DF22296A3BF00D34103 /* LKDBSQLBuilderTest.m */; };
B6617501229035B900285B6E /* FMDatabase+Debug.m in Sources */ = {isa = PBXBuildFile; fileRef = B66174FF229035B900285B6E /* FMDatabase+Debug.m */; };
B661751A22903FA000285B6E /* LKDBTransaction.m in Sources */ = {isa = PBXBuildFile; fileRef = B661750A22903FA000285B6E /* LKDBTransaction.m */; };
B661751B22903FA000285B6E /* LKDBSQLite.m in Sources */ = {isa = PBXBuildFile; fileRef = B661750B22903FA000285B6E /* LKDBSQLite.m */; };
B661751C22903FA000285B6E /* LKDBPersistenceObject.m in Sources */ = {isa = PBXBuildFile; fileRef = B661750E22903FA000285B6E /* LKDBPersistenceObject.m */; };
B661751D22903FA000285B6E /* LKDBSelect.m in Sources */ = {isa = PBXBuildFile; fileRef = B661750F22903FA000285B6E /* LKDBSelect.m */; };
B661751E22903FA000285B6E /* LKDBQueryBuilder.m in Sources */ = {isa = PBXBuildFile; fileRef = B661751322903FA000285B6E /* LKDBQueryBuilder.m */; };
B661751E22903FA000285B6E /* LKDBStringBuilder.m in Sources */ = {isa = PBXBuildFile; fileRef = B661751322903FA000285B6E /* LKDBStringBuilder.m */; };
B661751F22903FA000285B6E /* LKDBDelete.m in Sources */ = {isa = PBXBuildFile; fileRef = B661751522903FA000285B6E /* LKDBDelete.m */; };
B661752022903FA000285B6E /* LKDBConditionGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = B661751622903FA000285B6E /* LKDBConditionGroup.m */; };
B661752122903FA000285B6E /* LKDBSQLCondition.m in Sources */ = {isa = PBXBuildFile; fileRef = B661751922903FA000285B6E /* LKDBSQLCondition.m */; };
B661752022903FA000285B6E /* LKSQLCompositeCondition.m in Sources */ = {isa = PBXBuildFile; fileRef = B661751622903FA000285B6E /* LKSQLCompositeCondition.m */; };
B661752122903FA000285B6E /* LKSQLCondition.m in Sources */ = {isa = PBXBuildFile; fileRef = B661751922903FA000285B6E /* LKSQLCondition.m */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -39,25 +40,27 @@
366B23451CFD8CEB006743C0 /* Snip20130620_6.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Snip20130620_6.png; path = ../../screenshot/Snip20130620_6.png; sourceTree = "<group>"; };
A05ED3193E536326FFEB6E6B /* libPods-iOS-Demo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-iOS-Demo.a"; sourceTree = BUILT_PRODUCTS_DIR; };
AC46E909280B6824E099951C /* Pods-iOS-Demo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iOS-Demo.release.xcconfig"; path = "Pods/Target Support Files/Pods-iOS-Demo/Pods-iOS-Demo.release.xcconfig"; sourceTree = "<group>"; };
B61E1DF12296A3BF00D34103 /* LKDBSQLBuilderTest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LKDBSQLBuilderTest.h; sourceTree = "<group>"; };
B61E1DF22296A3BF00D34103 /* LKDBSQLBuilderTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LKDBSQLBuilderTest.m; sourceTree = "<group>"; };
B66174FF229035B900285B6E /* FMDatabase+Debug.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "FMDatabase+Debug.m"; sourceTree = "<group>"; };
B6617500229035B900285B6E /* FMDatabase+Debug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "FMDatabase+Debug.h"; sourceTree = "<group>"; };
B661750922903FA000285B6E /* LKDBQueryBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LKDBQueryBuilder.h; sourceTree = "<group>"; };
B661750922903FA000285B6E /* LKDBStringBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LKDBStringBuilder.h; sourceTree = "<group>"; };
B661750A22903FA000285B6E /* LKDBTransaction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LKDBTransaction.m; sourceTree = "<group>"; };
B661750B22903FA000285B6E /* LKDBSQLite.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LKDBSQLite.m; sourceTree = "<group>"; };
B661750C22903FA000285B6E /* LKDBDelete.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LKDBDelete.h; sourceTree = "<group>"; };
B661750D22903FA000285B6E /* LKDBSQLCondition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LKDBSQLCondition.h; sourceTree = "<group>"; };
B661750D22903FA000285B6E /* LKSQLCondition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LKSQLCondition.h; sourceTree = "<group>"; };
B661750E22903FA000285B6E /* LKDBPersistenceObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LKDBPersistenceObject.m; sourceTree = "<group>"; };
B661750F22903FA000285B6E /* LKDBSelect.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LKDBSelect.m; sourceTree = "<group>"; };
B661751022903FA000285B6E /* LKDBConditionGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LKDBConditionGroup.h; sourceTree = "<group>"; };
B661751022903FA000285B6E /* LKSQLCompositeCondition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LKSQLCompositeCondition.h; sourceTree = "<group>"; };
B661751122903FA000285B6E /* LKDBSearchHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LKDBSearchHelper.h; sourceTree = "<group>"; };
B661751222903FA000285B6E /* LKDBTransaction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LKDBTransaction.h; sourceTree = "<group>"; };
B661751322903FA000285B6E /* LKDBQueryBuilder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LKDBQueryBuilder.m; sourceTree = "<group>"; };
B661751322903FA000285B6E /* LKDBStringBuilder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LKDBStringBuilder.m; sourceTree = "<group>"; };
B661751422903FA000285B6E /* LKDBSQLite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LKDBSQLite.h; sourceTree = "<group>"; };
B661751522903FA000285B6E /* LKDBDelete.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LKDBDelete.m; sourceTree = "<group>"; };
B661751622903FA000285B6E /* LKDBConditionGroup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LKDBConditionGroup.m; sourceTree = "<group>"; };
B661751622903FA000285B6E /* LKSQLCompositeCondition.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LKSQLCompositeCondition.m; sourceTree = "<group>"; };
B661751722903FA000285B6E /* LKDBSelect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LKDBSelect.h; sourceTree = "<group>"; };
B661751822903FA000285B6E /* LKDBPersistenceObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LKDBPersistenceObject.h; sourceTree = "<group>"; };
B661751922903FA000285B6E /* LKDBSQLCondition.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LKDBSQLCondition.m; sourceTree = "<group>"; };
B661751922903FA000285B6E /* LKSQLCondition.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LKSQLCondition.m; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -134,26 +137,36 @@
name = Frameworks;
sourceTree = "<group>";
};
B661750822903FA000285B6E /* LKDBSearchHelper */ = {
B61E1DED22962B5500D34103 /* ignored */ = {
isa = PBXGroup;
children = (
B661751722903FA000285B6E /* LKDBSelect.h */,
B661750F22903FA000285B6E /* LKDBSelect.m */,
B661750C22903FA000285B6E /* LKDBDelete.h */,
B661751522903FA000285B6E /* LKDBDelete.m */,
B661751222903FA000285B6E /* LKDBTransaction.h */,
B661750A22903FA000285B6E /* LKDBTransaction.m */,
B661751122903FA000285B6E /* LKDBSearchHelper.h */,
B661751822903FA000285B6E /* LKDBPersistenceObject.h */,
B661750E22903FA000285B6E /* LKDBPersistenceObject.m */,
B661751422903FA000285B6E /* LKDBSQLite.h */,
B661750B22903FA000285B6E /* LKDBSQLite.m */,
B661751222903FA000285B6E /* LKDBTransaction.h */,
B661750A22903FA000285B6E /* LKDBTransaction.m */,
B661750922903FA000285B6E /* LKDBQueryBuilder.h */,
B661751322903FA000285B6E /* LKDBQueryBuilder.m */,
B661750D22903FA000285B6E /* LKDBSQLCondition.h */,
B661751922903FA000285B6E /* LKDBSQLCondition.m */,
B661751022903FA000285B6E /* LKDBConditionGroup.h */,
B661751622903FA000285B6E /* LKDBConditionGroup.m */,
B661751722903FA000285B6E /* LKDBSelect.h */,
B661750F22903FA000285B6E /* LKDBSelect.m */,
B661750C22903FA000285B6E /* LKDBDelete.h */,
B661751522903FA000285B6E /* LKDBDelete.m */,
);
path = ignored;
sourceTree = "<group>";
};
B661750822903FA000285B6E /* LKDBSearchHelper */ = {
isa = PBXGroup;
children = (
B61E1DED22962B5500D34103 /* ignored */,
B61E1DF12296A3BF00D34103 /* LKDBSQLBuilderTest.h */,
B61E1DF22296A3BF00D34103 /* LKDBSQLBuilderTest.m */,
B661750922903FA000285B6E /* LKDBStringBuilder.h */,
B661751322903FA000285B6E /* LKDBStringBuilder.m */,
B661750D22903FA000285B6E /* LKSQLCondition.h */,
B661751922903FA000285B6E /* LKSQLCondition.m */,
B661751022903FA000285B6E /* LKSQLCompositeCondition.h */,
B661751622903FA000285B6E /* LKSQLCompositeCondition.m */,
);
path = LKDBSearchHelper;
sourceTree = "<group>";
Expand Down Expand Up @@ -283,16 +296,17 @@
buildActionMask = 2147483647;
files = (
B661751C22903FA000285B6E /* LKDBPersistenceObject.m in Sources */,
B661751E22903FA000285B6E /* LKDBQueryBuilder.m in Sources */,
B661751E22903FA000285B6E /* LKDBStringBuilder.m in Sources */,
366B23441CFD8A63006743C0 /* LKTestModels.m in Sources */,
B661751A22903FA000285B6E /* LKDBTransaction.m in Sources */,
366B23301CFD87F5006743C0 /* AppDelegate.m in Sources */,
B661752122903FA000285B6E /* LKDBSQLCondition.m in Sources */,
B661752122903FA000285B6E /* LKSQLCondition.m in Sources */,
B661751D22903FA000285B6E /* LKDBSelect.m in Sources */,
366B232D1CFD87F5006743C0 /* main.m in Sources */,
B661752022903FA000285B6E /* LKDBConditionGroup.m in Sources */,
B661752022903FA000285B6E /* LKSQLCompositeCondition.m in Sources */,
B661751F22903FA000285B6E /* LKDBDelete.m in Sources */,
B661751B22903FA000285B6E /* LKDBSQLite.m in Sources */,
B61E1DF32296A3BF00D34103 /* LKDBSQLBuilderTest.m in Sources */,
B6617501229035B900285B6E /* FMDatabase+Debug.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
7 changes: 4 additions & 3 deletions Demo-iOS/iOS-Demo/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ @interface AppDelegate()<UITextViewDelegate>
@end

@implementation AppDelegate
-(void)scrollViewDidScroll:(UIScrollView *)scrollView
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
[self.window endEditing:YES];
}
-(void)add:(NSString*)txt
- (void)add:(NSString*)txt
{
dispatch_async(dispatch_get_main_queue(), ^{
[_ms appendString:@"\n"];
Expand Down Expand Up @@ -52,7 +52,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
});
return YES;
}
-(void)test

- (void)test
{
NSLog(@"DBPath: %@", [LKTest getUsingLKDBHelper].dbPath);
addText(@"示例 开始 example start \n\n");
Expand Down
41 changes: 0 additions & 41 deletions Demo-iOS/iOS-Demo/LKDBSearchHelper/LKDBConditionGroup.h

This file was deleted.

177 changes: 0 additions & 177 deletions Demo-iOS/iOS-Demo/LKDBSearchHelper/LKDBConditionGroup.m

This file was deleted.

28 changes: 0 additions & 28 deletions Demo-iOS/iOS-Demo/LKDBSearchHelper/LKDBDelete.h

This file was deleted.

Loading

0 comments on commit 36cfd7f

Please sign in to comment.