From 64dd7baf3188df7ec476d198b1fd52101584bce5 Mon Sep 17 00:00:00 2001 From: avenjamin Date: Sat, 15 Nov 2008 14:34:15 +0000 Subject: General clean up.... more to come --- CMMCPResult.m | 166 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 84 insertions(+), 82 deletions(-) (limited to 'CMMCPResult.m') diff --git a/CMMCPResult.m b/CMMCPResult.m index a41ce84d..f80ff5c3 100644 --- a/CMMCPResult.m +++ b/CMMCPResult.m @@ -27,16 +27,16 @@ @implementation CMMCPResult -- (id) fetchRowAsType:(MCPReturnType) aType -/*" +/* modified version for use with sequel-pro -"*/ +*/ +- (id)fetchRowAsType:(MCPReturnType)aType { - MYSQL_ROW theRow; - unsigned long *theLengths; - MYSQL_FIELD *theField; + MYSQL_ROW theRow; + unsigned long *theLengths; + MYSQL_FIELD *theField; int i; - id theReturn; + id theReturn; if (mResult == NULL) { // If there is no results, returns nil, as after the last row... @@ -48,98 +48,100 @@ modified version for use with sequel-pro return nil; } - switch (aType) { - case MCPTypeArray: - theReturn = [NSMutableArray arrayWithCapacity:mNumOfFields]; - break; - case MCPTypeDictionary: - if (mNames == nil) { - [self fetchFieldNames]; - } - theReturn = [NSMutableDictionary dictionaryWithCapacity:mNumOfFields]; - break; - default : - NSLog (@"Unknown type : %d, will return an Array!\n", aType); - theReturn = [NSMutableArray arrayWithCapacity:mNumOfFields]; - break; - } + switch (aType) { + case MCPTypeArray: + theReturn = [NSMutableArray arrayWithCapacity:mNumOfFields]; + break; + case MCPTypeDictionary: + if (mNames == nil) { + [self fetchFieldNames]; + } + theReturn = [NSMutableDictionary dictionaryWithCapacity:mNumOfFields]; + break; + default : + NSLog (@"Unknown type : %d, will return an Array!\n", aType); + theReturn = [NSMutableArray arrayWithCapacity:mNumOfFields]; + break; + } - theLengths = mysql_fetch_lengths(mResult); - theField = mysql_fetch_fields(mResult); + theLengths = mysql_fetch_lengths(mResult); + theField = mysql_fetch_fields(mResult); - for (i=0; i