Skip to content

Commit

Permalink
adapt to support framework
Browse files Browse the repository at this point in the history
  • Loading branch information
welkiner committed Jul 26, 2016
1 parent 731f091 commit b548df8
Show file tree
Hide file tree
Showing 8 changed files with 496 additions and 7 deletions.
46 changes: 46 additions & 0 deletions CTFramework/CTFramework.h
@@ -0,0 +1,46 @@
//
// CTFramework.h
// CTFramework
//
// Created by tl on 16/7/26.
// Copyright © 2016年 casa. All rights reserved.
//

#import <UIKit/UIKit.h>

#import "CTPersistanceAsyncExecutor.h"
#import "NSArray+CTPersistanceRecordTransform.h"
#import "NSString+ReqularExpression.h"
#import "NSString+SQL.h"
#import "CTPersistanceCriteria.h"
#import "CTPersistance.h"
#import "CTPersistanceConfiguration.h"
#import "CTPersistanceMarcos.h"
#import "CTPersistanceDataBase.h"
#import "CTPersistanceDatabasePool.h"
#import "CTPersistanceMigrator.h"
#import "CTPersistanceVersionTable.h"
#import "CTPersistanceVersionRecord.h"
#import "CTPersistanceQueryCommand+DataManipulations.h"
#import "CTPersistanceQueryCommand+ReadMethods.h"
#import "CTPersistanceQueryCommand+SchemaManipulations.h"
#import "CTPersistanceQueryCommand+Status.h"
#import "CTPersistanceQueryCommand.h"
#import "CTPersistanceRecord.h"
#import "CTPersistanceRecordProtocol.h"
#import "CTPersistanceTable+Delete.h"
#import "CTPersistanceTable+Find.h"
#import "CTPersistanceTable+Insert.h"
#import "CTPersistanceTable+Update.h"
#import "CTPersistanceTable.h"
#import "CTPersistanceTransaction.h"


//! Project version number for CTFramework.
FOUNDATION_EXPORT double CTFrameworkVersionNumber;

//! Project version string for CTFramework.
FOUNDATION_EXPORT const unsigned char CTFrameworkVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <CTFramework/PublicHeader.h>

26 changes: 26 additions & 0 deletions CTFramework/Info.plist
@@ -0,0 +1,26 @@
<?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>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
364 changes: 364 additions & 0 deletions CTPersistance.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions CTPersistance/CTPersistance/Database/CTPersistanceDataBase.h
Expand Up @@ -7,17 +7,17 @@
//

#import <Foundation/Foundation.h>
#import <sqlite3.h>


/**
* CTPersistanceDataBase is a wrapper of sqlite3 database
*/
@interface CTPersistanceDataBase : NSObject

/**
* the database used for SQLite library
* the database used for SQLite library,'sqlite3' pointer
*/
@property (nonatomic, assign, readonly) sqlite3 *database;
@property (nonatomic, assign, readonly) void *database;

/**
* name of database file.
Expand Down
6 changes: 3 additions & 3 deletions CTPersistance/CTPersistance/Database/CTPersistanceDataBase.m
Expand Up @@ -10,10 +10,10 @@
#import "CTPersistanceConfiguration.h"
#import "CTPersistanceMigrator.h"
#import "NSString+ReqularExpression.h"

#import <sqlite3.h>
@interface CTPersistanceDataBase ()

@property (nonatomic, assign) sqlite3 *database;
@property (nonatomic, assign) void *database;
@property (nonatomic, copy) NSString *databaseName;
@property (nonatomic, copy) NSString *databaseFilePath;
@property (nonatomic, strong) CTPersistanceMigrator *migrator;
Expand All @@ -39,7 +39,7 @@ - (instancetype)initWithDatabaseName:(NSString *)databaseName error:(NSError *__
BOOL isFileExists = [defaultFileManager fileExistsAtPath:self.databaseFilePath];

const char *path = [self.databaseFilePath UTF8String];
int result = sqlite3_open_v2(path, &_database,
int result = sqlite3_open_v2(path, (sqlite3**)&_database,
SQLITE_OPEN_CREATE |
SQLITE_OPEN_READWRITE |
SQLITE_OPEN_FULLMUTEX |
Expand Down
Expand Up @@ -10,7 +10,7 @@
#import "CTPersistanceDataBase.h"
#import "CTPersistanceDatabasePool.h"
#import "CTPersistanceConfiguration.h"

#import <sqlite3.h>
@interface CTPersistanceQueryCommand ()

@property (nonatomic, weak) CTPersistanceDataBase *database;
Expand Down
40 changes: 40 additions & 0 deletions SwiftDemo/Info.plist
@@ -0,0 +1,40 @@
<?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>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
13 changes: 13 additions & 0 deletions SwiftDemo/main.swift
@@ -0,0 +1,13 @@
//
// main.swift
// CTPersistance
//
// Created by tl on 16/7/26.
// Copyright © 2016年 casa. All rights reserved.
//

import Foundation
import CTFramework



0 comments on commit b548df8

Please sign in to comment.