|
|
@@ -17,11 +17,11 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
@class FMDatabase;
|
|
|
@class FMStatement;
|
|
|
|
|
|
-/** Represents the results of executing a query on an `<FMDatabase>`.
|
|
|
+/** Represents the results of executing a query on an @c FMDatabase .
|
|
|
|
|
|
- ### See also
|
|
|
+ See also
|
|
|
|
|
|
- - `<FMDatabase>`
|
|
|
+ - @c FMDatabase
|
|
|
*/
|
|
|
|
|
|
@interface FMResultSet : NSObject
|
|
|
@@ -48,17 +48,6 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
/// @name Creating and closing a result set
|
|
|
///------------------------------------
|
|
|
|
|
|
-/** Create result set from `<FMStatement>`
|
|
|
-
|
|
|
- @param statement A `<FMStatement>` to be performed
|
|
|
-
|
|
|
- @param aDB A `<FMDatabase>` to be used
|
|
|
-
|
|
|
- @return A `FMResultSet` on success; `nil` on failure
|
|
|
- */
|
|
|
-
|
|
|
-+ (instancetype)resultSetWithStatement:(FMStatement *)statement usingParentDatabase:(FMDatabase*)aDB shouldAutoClose:(BOOL)shouldAutoClose;
|
|
|
-
|
|
|
/** Close result set */
|
|
|
|
|
|
- (void)close;
|
|
|
@@ -71,7 +60,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
You must always invoke `next` or `nextWithError` before attempting to access the values returned in a query, even if you're only expecting one.
|
|
|
|
|
|
- @return `YES` if row successfully retrieved; `NO` if end of result set reached
|
|
|
+ @return @c YES if row successfully retrieved; @c NO if end of result set reached
|
|
|
|
|
|
@see hasAnotherRow
|
|
|
*/
|
|
|
@@ -117,7 +106,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
@see next
|
|
|
|
|
|
- @warning The `hasAnotherRow` method must follow a call to `<next>`. If the previous database interaction was something other than a call to `next`, then this method may return `NO`, whether there is another row of data or not.
|
|
|
+ @warning The `hasAnotherRow` method must follow a call to `<next>`. If the previous database interaction was something other than a call to `next`, then this method may return @c NO, whether there is another row of data or not.
|
|
|
*/
|
|
|
|
|
|
- (BOOL)hasAnotherRow;
|
|
|
@@ -135,7 +124,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
/** Column index for column name
|
|
|
|
|
|
- @param columnName `NSString` value of the name of the column.
|
|
|
+ @param columnName @c NSString value of the name of the column.
|
|
|
|
|
|
@return Zero-based index for column.
|
|
|
*/
|
|
|
@@ -146,16 +135,16 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
@param columnIdx Zero-based index for column.
|
|
|
|
|
|
- @return columnName `NSString` value of the name of the column.
|
|
|
+ @return columnName @c NSString value of the name of the column.
|
|
|
*/
|
|
|
|
|
|
- (NSString * _Nullable)columnNameForIndex:(int)columnIdx;
|
|
|
|
|
|
/** Result set integer value for column.
|
|
|
|
|
|
- @param columnName `NSString` value of the name of the column.
|
|
|
+ @param columnName @c NSString value of the name of the column.
|
|
|
|
|
|
- @return `int` value of the result set's column.
|
|
|
+ @return @c int value of the result set's column.
|
|
|
*/
|
|
|
|
|
|
- (int)intForColumn:(NSString*)columnName;
|
|
|
@@ -164,16 +153,16 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
@param columnIdx Zero-based index for column.
|
|
|
|
|
|
- @return `int` value of the result set's column.
|
|
|
+ @return @c int value of the result set's column.
|
|
|
*/
|
|
|
|
|
|
- (int)intForColumnIndex:(int)columnIdx;
|
|
|
|
|
|
-/** Result set `long` value for column.
|
|
|
+/** Result set @c long value for column.
|
|
|
|
|
|
- @param columnName `NSString` value of the name of the column.
|
|
|
+ @param columnName @c NSString value of the name of the column.
|
|
|
|
|
|
- @return `long` value of the result set's column.
|
|
|
+ @return @c long value of the result set's column.
|
|
|
*/
|
|
|
|
|
|
- (long)longForColumn:(NSString*)columnName;
|
|
|
@@ -182,14 +171,14 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
@param columnIdx Zero-based index for column.
|
|
|
|
|
|
- @return `long` value of the result set's column.
|
|
|
+ @return @c long value of the result set's column.
|
|
|
*/
|
|
|
|
|
|
- (long)longForColumnIndex:(int)columnIdx;
|
|
|
|
|
|
/** Result set `long long int` value for column.
|
|
|
|
|
|
- @param columnName `NSString` value of the name of the column.
|
|
|
+ @param columnName @c NSString value of the name of the column.
|
|
|
|
|
|
@return `long long int` value of the result set's column.
|
|
|
*/
|
|
|
@@ -207,7 +196,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
/** Result set `unsigned long long int` value for column.
|
|
|
|
|
|
- @param columnName `NSString` value of the name of the column.
|
|
|
+ @param columnName @c NSString value of the name of the column.
|
|
|
|
|
|
@return `unsigned long long int` value of the result set's column.
|
|
|
*/
|
|
|
@@ -225,7 +214,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
/** Result set `BOOL` value for column.
|
|
|
|
|
|
- @param columnName `NSString` value of the name of the column.
|
|
|
+ @param columnName @c NSString value of the name of the column.
|
|
|
|
|
|
@return `BOOL` value of the result set's column.
|
|
|
*/
|
|
|
@@ -243,7 +232,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
/** Result set `double` value for column.
|
|
|
|
|
|
- @param columnName `NSString` value of the name of the column.
|
|
|
+ @param columnName @c NSString value of the name of the column.
|
|
|
|
|
|
@return `double` value of the result set's column.
|
|
|
|
|
|
@@ -261,9 +250,9 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
- (double)doubleForColumnIndex:(int)columnIdx;
|
|
|
|
|
|
-/** Result set `NSString` value for column.
|
|
|
+/** Result set @c NSString value for column.
|
|
|
|
|
|
- @param columnName `NSString` value of the name of the column.
|
|
|
+ @param columnName @c NSString value of the name of the column.
|
|
|
|
|
|
@return String value of the result set's column.
|
|
|
|
|
|
@@ -271,7 +260,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
- (NSString * _Nullable)stringForColumn:(NSString*)columnName;
|
|
|
|
|
|
-/** Result set `NSString` value for column.
|
|
|
+/** Result set @c NSString value for column.
|
|
|
|
|
|
@param columnIdx Zero-based index for column.
|
|
|
|
|
|
@@ -280,16 +269,16 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
- (NSString * _Nullable)stringForColumnIndex:(int)columnIdx;
|
|
|
|
|
|
-/** Result set `NSDate` value for column.
|
|
|
+/** Result set @c NSDate value for column.
|
|
|
|
|
|
- @param columnName `NSString` value of the name of the column.
|
|
|
+ @param columnName @c NSString value of the name of the column.
|
|
|
|
|
|
@return Date value of the result set's column.
|
|
|
*/
|
|
|
|
|
|
- (NSDate * _Nullable)dateForColumn:(NSString*)columnName;
|
|
|
|
|
|
-/** Result set `NSDate` value for column.
|
|
|
+/** Result set @c NSDate value for column.
|
|
|
|
|
|
@param columnIdx Zero-based index for column.
|
|
|
|
|
|
@@ -299,11 +288,11 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
- (NSDate * _Nullable)dateForColumnIndex:(int)columnIdx;
|
|
|
|
|
|
-/** Result set `NSData` value for column.
|
|
|
+/** Result set @c NSData value for column.
|
|
|
|
|
|
This is useful when storing binary data in table (such as image or the like).
|
|
|
|
|
|
- @param columnName `NSString` value of the name of the column.
|
|
|
+ @param columnName @c NSString value of the name of the column.
|
|
|
|
|
|
@return Data value of the result set's column.
|
|
|
|
|
|
@@ -311,7 +300,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
- (NSData * _Nullable)dataForColumn:(NSString*)columnName;
|
|
|
|
|
|
-/** Result set `NSData` value for column.
|
|
|
+/** Result set @c NSData value for column.
|
|
|
|
|
|
@param columnIdx Zero-based index for column.
|
|
|
|
|
|
@@ -322,7 +311,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
/** Result set `(const unsigned char *)` value for column.
|
|
|
|
|
|
- @param columnName `NSString` value of the name of the column.
|
|
|
+ @param columnName @c NSString value of the name of the column.
|
|
|
|
|
|
@return `(const unsigned char *)` value of the result set's column.
|
|
|
*/
|
|
|
@@ -344,7 +333,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
@param columnName Name of the column.
|
|
|
|
|
|
- @return Either `NSNumber`, `NSString`, `NSData`, or `NSNull`. If the column was `NULL`, this returns `[NSNull null]` object.
|
|
|
+ @return Either @c NSNumber , @c NSString , @c NSData , or @c NSNull . If the column was @c NULL , this returns `[NSNull null]` object.
|
|
|
|
|
|
@see objectForKeyedSubscript:
|
|
|
*/
|
|
|
@@ -357,7 +346,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
@param columnIdx Zero-based index for column.
|
|
|
|
|
|
- @return Either `NSNumber`, `NSString`, `NSData`, or `NSNull`. If the column was `NULL`, this returns `[NSNull null]` object.
|
|
|
+ @return Either @c NSNumber , @c NSString , @c NSData , or @c NSNull . If the column was @c NULL , this returns `[NSNull null]` object.
|
|
|
|
|
|
@see objectAtIndexedSubscript:
|
|
|
*/
|
|
|
@@ -367,20 +356,26 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
/** Result set object for column.
|
|
|
|
|
|
This method allows the use of the "boxed" syntax supported in Modern Objective-C. For example, by defining this method, the following syntax is now supported:
|
|
|
-
|
|
|
- id result = rs[@"employee_name"];
|
|
|
-
|
|
|
+
|
|
|
+@code
|
|
|
+id result = rs[@"employee_name"];
|
|
|
+@endcode
|
|
|
+
|
|
|
This simplified syntax is equivalent to calling:
|
|
|
|
|
|
- id result = [rs objectForKeyedSubscript:@"employee_name"];
|
|
|
-
|
|
|
+@code
|
|
|
+id result = [rs objectForKeyedSubscript:@"employee_name"];
|
|
|
+@endcode
|
|
|
+
|
|
|
which is, it turns out, equivalent to calling:
|
|
|
|
|
|
- id result = [rs objectForColumnName:@"employee_name"];
|
|
|
+@code
|
|
|
+id result = [rs objectForColumnName:@"employee_name"];
|
|
|
+@endcode
|
|
|
|
|
|
- @param columnName `NSString` value of the name of the column.
|
|
|
+ @param columnName @c NSString value of the name of the column.
|
|
|
|
|
|
- @return Either `NSNumber`, `NSString`, `NSData`, or `NSNull`. If the column was `NULL`, this returns `[NSNull null]` object.
|
|
|
+ @return Either @c NSNumber , @c NSString , @c NSData , or @c NSNull . If the column was @c NULL , this returns `[NSNull null]` object.
|
|
|
*/
|
|
|
|
|
|
- (id _Nullable)objectForKeyedSubscript:(NSString *)columnName;
|
|
|
@@ -389,26 +384,32 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
This method allows the use of the "boxed" syntax supported in Modern Objective-C. For example, by defining this method, the following syntax is now supported:
|
|
|
|
|
|
- id result = rs[0];
|
|
|
+@code
|
|
|
+id result = rs[0];
|
|
|
+@endcode
|
|
|
|
|
|
This simplified syntax is equivalent to calling:
|
|
|
|
|
|
- id result = [rs objectForKeyedSubscript:0];
|
|
|
+@code
|
|
|
+id result = [rs objectForKeyedSubscript:0];
|
|
|
+@endcode
|
|
|
|
|
|
which is, it turns out, equivalent to calling:
|
|
|
|
|
|
- id result = [rs objectForColumnName:0];
|
|
|
+@code
|
|
|
+id result = [rs objectForColumnName:0];
|
|
|
+@endcode
|
|
|
|
|
|
@param columnIdx Zero-based index for column.
|
|
|
|
|
|
- @return Either `NSNumber`, `NSString`, `NSData`, or `NSNull`. If the column was `NULL`, this returns `[NSNull null]` object.
|
|
|
+ @return Either @c NSNumber , @c NSString , @c NSData , or @c NSNull . If the column was @c NULL , this returns `[NSNull null]` object.
|
|
|
*/
|
|
|
|
|
|
- (id _Nullable)objectAtIndexedSubscript:(int)columnIdx;
|
|
|
|
|
|
-/** Result set `NSData` value for column.
|
|
|
+/** Result set @c NSData value for column.
|
|
|
|
|
|
- @param columnName `NSString` value of the name of the column.
|
|
|
+ @param columnName @c NSString value of the name of the column.
|
|
|
|
|
|
@return Data value of the result set's column.
|
|
|
|
|
|
@@ -420,7 +421,7 @@ If you don't, you're going to be in a world of hurt when you try and use the dat
|
|
|
|
|
|
- (NSData * _Nullable)dataNoCopyForColumn:(NSString *)columnName NS_RETURNS_NOT_RETAINED;
|
|
|
|
|
|
-/** Result set `NSData` value for column.
|
|
|
+/** Result set @c NSData value for column.
|
|
|
|
|
|
@param columnIdx Zero-based index for column.
|
|
|
|
|
|
@@ -434,20 +435,20 @@ If you don't, you're going to be in a world of hurt when you try and use the dat
|
|
|
|
|
|
- (NSData * _Nullable)dataNoCopyForColumnIndex:(int)columnIdx NS_RETURNS_NOT_RETAINED;
|
|
|
|
|
|
-/** Is the column `NULL`?
|
|
|
+/** Is the column @c NULL ?
|
|
|
|
|
|
@param columnIdx Zero-based index for column.
|
|
|
|
|
|
- @return `YES` if column is `NULL`; `NO` if not `NULL`.
|
|
|
+ @return @c YES if column is @c NULL ; @c NO if not @c NULL .
|
|
|
*/
|
|
|
|
|
|
- (BOOL)columnIndexIsNull:(int)columnIdx;
|
|
|
|
|
|
-/** Is the column `NULL`?
|
|
|
+/** Is the column @c NULL ?
|
|
|
|
|
|
- @param columnName `NSString` value of the name of the column.
|
|
|
+ @param columnName @c NSString value of the name of the column.
|
|
|
|
|
|
- @return `YES` if column is `NULL`; `NO` if not `NULL`.
|
|
|
+ @return @c YES if column is @c NULL ; @c NO if not @c NULL .
|
|
|
*/
|
|
|
|
|
|
- (BOOL)columnIsNull:(NSString*)columnName;
|