- 授权协议: MIT
- 开发语言: Swift
- 操作系统: iOS
- 软件首页: https://github.com/colatusso/canDB.swift
软件介绍
canDB.swift 是一个框架,作用类似 nonSQL 的数据库,但运作在 sqlite(FMDB) 。
// loading the json
let filePath = NSBundle.mainBundle().pathForResource("data", ofType:"json") let data = NSData(contentsOfFile:filePath!, options:NSDataReadingOptions.DataReadingUncached, error:nil) let dataArray:Array = NSJSONSerialization.JSONObjectWithData(data!, options: NSJSONReadingOptions.allZeros, error: nil) as! Array<Dictionary<String, String>>
// singleton instance
let storeInstance = canDB.sharedInstance // saving the data, the can is automatically created if not exists
storeInstance.saveData("Person", data: dataArray, idString: kCanDBDefaultIdString, error: nil) // adding the index for future queries and reindexing the table
storeInstance.addIndex("Person", indexes: ["Name"], error: nil)
storeInstance.reIndex("Person", idString: kCanDBDefaultIdString) let result = storeInstance.loadData("Person") for item in result { for (key, value) in (item as! NSDictionary) {
println("\(key): \(value)")
}
} // custom query using the previous created index "Name"
let resultWithQuery = storeInstance.loadDataWithQuery("SELECT * FROM Person WHERE Name='John'") for item in resultWithQuery { for (key, value) in (item as! NSDictionary) {
println("\(key): \(value)")
}
}
storeInstance.removeDataForId("Person", idString: kCanDBDefaultIdString, idsToDelete: ["17", "19"], error: nil)
C Primer Plus
Stephen Prata、云巅工作室 / 云巅工作室 / 人民邮电出版社 / 2005-2-1 / 60.00元
《C Primer Plus(第5版)(中文版)》共17章。第1、2章学习C语言编程所需的预备知识。第3到15章介绍了C语言的相关知识,包括数据类型、格式化输入输出、运算符、表达式、流程控制语句、函数、数组和指针、字符串操作、内存管理、位操作等等,知识内容都针对C99标准;另外,第10章强化了对指针的讨论,第12章引入了动态内存分配的概念,这些内容更加适合读者的需求。第16章和第17章讨论了C预处......一起来看看 《C Primer Plus》 这本书的介绍吧!
