ObjSQLite3  Diff

Differences From Artifact [2b5e97d424]:

To Artifact [ae1450d339]:


168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
		@throw [SL3ExecuteStatementFailedException
		    exceptionWithStatement: self
				 errorCode: code];

	return (code == SQLITE_ROW);
}

- (id)objectForColumn: (size_t)column
{
	if (column > INT_MAX)
		@throw [OFOutOfRangeException exception];

	switch (sqlite3_column_type(_stmt, column)) {
	case SQLITE_INTEGER:
		return [OFNumber numberWithLongLong:







|







168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
		@throw [SL3ExecuteStatementFailedException
		    exceptionWithStatement: self
				 errorCode: code];

	return (code == SQLITE_ROW);
}

- (id)objectForCurrentRowAtColumn: (size_t)column
{
	if (column > INT_MAX)
		@throw [OFOutOfRangeException exception];

	switch (sqlite3_column_type(_stmt, column)) {
	case SQLITE_INTEGER:
		return [OFNumber numberWithLongLong:
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246

	if ((name = sqlite3_column_name(_stmt, column)) == NULL)
		@throw [OFOutOfMemoryException exception];

	return [OFString stringWithUTF8String: name];
}

- (OFArray *)rowArray
{
	size_t count = [self columnCount];
	OFMutableArray *array = [OFMutableArray arrayWithCapacity: count];

	for (size_t i = 0; i < count; i++)
		[array addObject: [self objectForColumn: i]];

	[array makeImmutable];

	return array;
}

- (OFDictionary OF_GENERIC(OFString *, id) *)rowDictionary
{
	size_t count = [self columnCount];
	OFMutableDictionary *dictionary =
	    [OFMutableDictionary dictionaryWithCapacity: count];

	for (size_t i = 0; i < count; i++)
		[dictionary setObject: [self objectForColumn: i]
			       forKey: [self nameForColumn: i]];

	[dictionary makeImmutable];

	return dictionary;
}








|





|






|






|







212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246

	if ((name = sqlite3_column_name(_stmt, column)) == NULL)
		@throw [OFOutOfMemoryException exception];

	return [OFString stringWithUTF8String: name];
}

- (OFArray *)currentRowArray
{
	size_t count = [self columnCount];
	OFMutableArray *array = [OFMutableArray arrayWithCapacity: count];

	for (size_t i = 0; i < count; i++)
		[array addObject: [self objectForCurrentRowAtColumn: i]];

	[array makeImmutable];

	return array;
}

- (OFDictionary OF_GENERIC(OFString *, id) *)currentRowDictionary
{
	size_t count = [self columnCount];
	OFMutableDictionary *dictionary =
	    [OFMutableDictionary dictionaryWithCapacity: count];

	for (size_t i = 0; i < count; i++)
		[dictionary setObject: [self objectForCurrentRowAtColumn: i]
			       forKey: [self nameForColumn: i]];

	[dictionary makeImmutable];

	return dictionary;
}