From 052448b2f76febb6d6748d6d562bc8ea92980594 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Thu, 24 Sep 2015 08:22:02 +0200 Subject: [PATCH] Documentation --- GRDB/Core/Blob.swift | 8 +++++++- GRDB/Core/Protocols/MetalType.swift | 11 +++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/GRDB/Core/Blob.swift b/GRDB/Core/Blob.swift index b514ba754..f80cd1541 100644 --- a/GRDB/Core/Blob.swift +++ b/GRDB/Core/Blob.swift @@ -71,8 +71,14 @@ public final class Blob : Equatable { /// Blob adopts DatabaseValueConvertible and MetalType. extension Blob : DatabaseValueConvertible, MetalType { - /// Metal Blob does not copy, does not take ownership of statement bytes. + /** + Returns an instance initialized from a raw SQLite statement pointer. + + - parameter sqliteStatement: A pointer to a SQLite statement. + - parameter index: The column index. + */ public convenience init(sqliteStatement: SQLiteStatement, index: Int32) { + // Metal Blob does not copy and does not take ownership of the statement bytes. let bytes = sqlite3_column_blob(sqliteStatement, index) let length = sqlite3_column_bytes(sqliteStatement, index) self.init(bytesNoCopy: bytes, length: Int(length), freeWhenDone: false)! diff --git a/GRDB/Core/Protocols/MetalType.swift b/GRDB/Core/Protocols/MetalType.swift index 37f070e23..98cb67763 100644 --- a/GRDB/Core/Protocols/MetalType.swift +++ b/GRDB/Core/Protocols/MetalType.swift @@ -1,3 +1,14 @@ +/** +TODO +*/ public protocol MetalType { + + /** + Returns an instance initialized from a raw SQLite statement pointer. + + - parameter sqliteStatement: A pointer to a SQLite statement. + - parameter index: The column index. + */ init(sqliteStatement: SQLiteStatement, index: Int32) + }