Skip to content
Newer
Older
100644 90 lines (62 sloc) 2.48 KB
280d9f9 @atg Big improvements in startup time
authored
1 #import <Foundation/Foundation.h>
2 #import "sqlite3.h"
3
4 #ifndef __has_feature // Optional.
5 #define __has_feature(x) 0 // Compatibility with non-clang compilers.
6 #endif
7
8 #ifndef NS_RETURNS_NOT_RETAINED
9 #if __has_feature(attribute_ns_returns_not_retained)
10 #define NS_RETURNS_NOT_RETAINED __attribute__((ns_returns_not_retained))
11 #else
12 #define NS_RETURNS_NOT_RETAINED
13 #endif
14 #endif
15
16 @class FMDatabase;
17 @class FMStatement;
18
19 @interface FMResultSet : NSObject {
20 FMDatabase *parentDB;
21 FMStatement *statement;
22
23 NSString *query;
24 NSMutableDictionary *columnNameToIndexMap;
25 BOOL columnNamesSetup;
26 }
27
28
29 + (id)resultSetWithStatement:(FMStatement *)statement usingParentDatabase:(FMDatabase*)aDB;
30
31 - (void)close;
32
33 - (NSString *)query;
34 - (void)setQuery:(NSString *)value;
35
36 - (FMStatement *)statement;
37 - (void)setStatement:(FMStatement *)value;
38
39 - (void)setParentDB:(FMDatabase *)newDb;
40
41 - (BOOL)next;
42 - (BOOL)hasAnotherRow;
43
44 - (int)columnIndexForName:(NSString*)columnName;
45 - (NSString*)columnNameForIndex:(int)columnIdx;
46
47 - (int)intForColumn:(NSString*)columnName;
48 - (int)intForColumnIndex:(int)columnIdx;
49
50 - (long)longForColumn:(NSString*)columnName;
51 - (long)longForColumnIndex:(int)columnIdx;
52
53 - (long long int)longLongIntForColumn:(NSString*)columnName;
54 - (long long int)longLongIntForColumnIndex:(int)columnIdx;
55
56 - (BOOL)boolForColumn:(NSString*)columnName;
57 - (BOOL)boolForColumnIndex:(int)columnIdx;
58
59 - (double)doubleForColumn:(NSString*)columnName;
60 - (double)doubleForColumnIndex:(int)columnIdx;
61
62 - (NSString*)stringForColumn:(NSString*)columnName;
63 - (NSString*)stringForColumnIndex:(int)columnIdx;
64
65 - (NSDate*)dateForColumn:(NSString*)columnName;
66 - (NSDate*)dateForColumnIndex:(int)columnIdx;
67
68 - (NSData*)dataForColumn:(NSString*)columnName;
69 - (NSData*)dataForColumnIndex:(int)columnIdx;
70
71 - (const unsigned char *)UTF8StringForColumnIndex:(int)columnIdx;
72 - (const unsigned char *)UTF8StringForColumnName:(NSString*)columnName;
73
74 /*
75 If you are going to use this data after you iterate over the next row, or after you close the
76 result set, make sure to make a copy of the data first (or just use dataForColumn:/dataForColumnIndex:)
77 If you don't, you're going to be in a world of hurt when you try and use the data.
78 */
79 - (NSData*)dataNoCopyForColumn:(NSString*)columnName NS_RETURNS_NOT_RETAINED;
80 - (NSData*)dataNoCopyForColumnIndex:(int)columnIdx NS_RETURNS_NOT_RETAINED;
81
82
83 - (BOOL)columnIndexIsNull:(int)columnIdx;
84 - (BOOL)columnIsNull:(NSString*)columnName;
85
86 - (void)kvcMagic:(id)object;
87 - (NSDictionary *)resultDict;
88
89 @end
Something went wrong with that request. Please try again.