Open Ullas9 opened 7 years ago
FFS man don't just throw code in issues like that... Do it the right way, you fork the repo, do your change locally, sent a pull-request to the main repo. We can't even cut & past from the above...
And this codes doesn't compile with latest 3.x
But this one does compile : https://github.com/wififer/SwiftData/blob/swift3/SwiftData.swift
// // SwiftData.swift // // Copyright (c) 2015 Ryan Fowler // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE.
import Foundation import UIKit
// MARK: - SwiftData
public struct SwiftData {
// let key = "helloworld".cString(using: String.Encoding.utf8) // sqlite3_key(sqliteDB, key!, Int32((key?.count)!)) // if (sqlite3_exec(sqliteDB, "SELECT count(*) FROM sqlite_master".cString(using: String.Encoding.utf8), nil, nil, nil) == SQLITE_OK) // { // //print("Password is correct, or a new database has been initialized") // } // else{ // //print("Incorrect password") // } isConnected = true return nil
// if(fileManager .fileExists(atPath: dbPath) == false) { // do{ // try fileManager.copyItem(atPath: Sourcepath!, toPath: dbPath) // } // catch { //
// } // } print(dbPath) return "(dbPath)"
// let dateFormatter = DateFormatter() // dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss" // let text = (sqlite3_column_text(statement, index)) // if text != nil // { // let mystring = String(cString: text!) as String? // return dateFormatter.date(from: mystring!) as AnyObject? // }
}
// MARK: - Threading
extension SwiftData {
}
// MARK: - Escaping And Binding Functions
extension SwiftData.SQLiteDB {
}
// MARK: - SQL Creation Functions
extension SwiftData {
}
extension SwiftData.SQLiteDB {
}
// MARK: - SDError Functions
extension SwiftData.SDError {
}
public typealias SD = SwiftData