Browse Source

Added methods that expose va_list arguments

ccgus 12 years ago
parent
commit
f62b8d798d
3 changed files with 24 additions and 1 deletions
  1. 4 1
      CHANGES_AND_TODO_LIST.txt
  2. 12 0
      src/FMDatabase.h
  3. 8 0
      src/FMDatabase.m

+ 4 - 1
CHANGES_AND_TODO_LIST.txt

@@ -3,7 +3,10 @@ Zip, nada, zilch.  Got any ideas?
 
 
 If you would like to contribute some code- awesome!  I just ask that you make it conform to the coding conventions already set in here, and to add a couple of tests for your new code to fmdb.m.  And of course, the code should be of general use to more than just a couple of folks.  Send your patches to gus@flyingmeat.com.
 If you would like to contribute some code- awesome!  I just ask that you make it conform to the coding conventions already set in here, and to add a couple of tests for your new code to fmdb.m.  And of course, the code should be of general use to more than just a couple of folks.  Send your patches to gus@flyingmeat.com.
 
 
-2013.10.26
+2013.10.16
+    Added methods that expose va_list arguments.  Thanks to Ibrahim Ennafaa for the patch.
+    
+2013.09.26
     Logs errors is now turned on by default.  It's easy to turn off, and if you're seeing errors then you should probably fix those.
     Logs errors is now turned on by default.  It's easy to turn off, and if you're seeing errors then you should probably fix those.
 
 
 2013.06.26
 2013.06.26

+ 12 - 0
src/FMDatabase.h

@@ -347,6 +347,12 @@
 
 
 - (BOOL)executeUpdate:(NSString*)sql withParameterDictionary:(NSDictionary *)arguments;
 - (BOOL)executeUpdate:(NSString*)sql withParameterDictionary:(NSDictionary *)arguments;
 
 
+
+
+// Documentation forthcoming.
+- (BOOL)executeUpdate:(NSString*)sql withVAList: (va_list)args;
+
+
 /** Last insert rowid
 /** Last insert rowid
  
  
  Each entry in an SQLite table has a unique 64-bit signed integer key called the "rowid". The rowid is always available as an undeclared column named `ROWID`, `OID`, or `_ROWID_` as long as those names are not also used by explicitly declared columns. If the table has a column of type `INTEGER PRIMARY KEY` then that column is another alias for the rowid.
  Each entry in an SQLite table has a unique 64-bit signed integer key called the "rowid". The rowid is always available as an undeclared column named `ROWID`, `OID`, or `_ROWID_` as long as those names are not also used by explicitly declared columns. If the table has a column of type `INTEGER PRIMARY KEY` then that column is another alias for the rowid.
@@ -453,6 +459,12 @@
 
 
 - (FMResultSet *)executeQuery:(NSString *)sql withParameterDictionary:(NSDictionary *)arguments;
 - (FMResultSet *)executeQuery:(NSString *)sql withParameterDictionary:(NSDictionary *)arguments;
 
 
+
+// Documentation forthcoming.
+- (FMResultSet *)executeQuery:(NSString*)sql withVAList: (va_list)args;
+
+
+
 ///-------------------
 ///-------------------
 /// @name Transactions
 /// @name Transactions
 ///-------------------
 ///-------------------

+ 8 - 0
src/FMDatabase.m

@@ -752,6 +752,10 @@ - (FMResultSet *)executeQuery:(NSString *)sql withArgumentsInArray:(NSArray *)ar
     return [self executeQuery:sql withArgumentsInArray:arguments orDictionary:nil orVAList:nil];
     return [self executeQuery:sql withArgumentsInArray:arguments orDictionary:nil orVAList:nil];
 }
 }
 
 
+- (FMResultSet *)executeQuery:(NSString*)sql withVAList:(va_list)args {
+    return [self executeQuery:sql withArgumentsInArray:nil orDictionary:nil orVAList:args];
+}
+
 - (BOOL)executeUpdate:(NSString*)sql error:(NSError**)outErr withArgumentsInArray:(NSArray*)arrayArgs orDictionary:(NSDictionary *)dictionaryArgs orVAList:(va_list)args {
 - (BOOL)executeUpdate:(NSString*)sql error:(NSError**)outErr withArgumentsInArray:(NSArray*)arrayArgs orDictionary:(NSDictionary *)dictionaryArgs orVAList:(va_list)args {
     
     
     if (![self databaseExists]) {
     if (![self databaseExists]) {
@@ -1003,6 +1007,10 @@ - (BOOL)executeUpdate:(NSString*)sql withParameterDictionary:(NSDictionary *)arg
     return [self executeUpdate:sql error:nil withArgumentsInArray:nil orDictionary:arguments orVAList:nil];
     return [self executeUpdate:sql error:nil withArgumentsInArray:nil orDictionary:arguments orVAList:nil];
 }
 }
 
 
+- (BOOL)executeUpdate:(NSString*)sql withVAList:(va_list)args {
+    return [self executeUpdate:sql error:nil withArgumentsInArray:nil orDictionary:nil orVAList:args];
+}
+
 - (BOOL)executeUpdateWithFormat:(NSString*)format, ... {
 - (BOOL)executeUpdateWithFormat:(NSString*)format, ... {
     va_list args;
     va_list args;
     va_start(args, format);
     va_start(args, format);