PageRenderTime 29ms CodeModel.GetById 22ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/MapView/Map/FMDB/FMResultSet.h

http://github.com/route-me/route-me
C Header | 75 lines | 46 code | 24 blank | 5 comment | 0 complexity | 00785bbb4e52f61a346886afff43f345 MD5 | raw file
 1#import <Foundation/Foundation.h>
 2#import "sqlite3.h"
 3
 4@class FMDatabase;
 5@class FMStatement;
 6
 7@interface FMResultSet : NSObject {
 8    FMDatabase *parentDB;
 9    FMStatement *statement;
10    
11    NSString *query;
12    NSMutableDictionary *columnNameToIndexMap;
13    BOOL columnNamesSetup;
14}
15
16
17+ (id) resultSetWithStatement:(FMStatement *)statement usingParentDatabase:(FMDatabase*)aDB;
18
19- (void) close;
20
21- (NSString *)query;
22- (void)setQuery:(NSString *)value;
23
24- (FMStatement *)statement;
25- (void)setStatement:(FMStatement *)value;
26
27- (void)setParentDB:(FMDatabase *)newDb;
28
29- (BOOL) next;
30- (BOOL) hasAnotherRow;
31
32- (int) columnIndexForName:(NSString*)columnName;
33- (NSString*) columnNameForIndex:(int)columnIdx;
34
35- (int) intForColumn:(NSString*)columnName;
36- (int) intForColumnIndex:(int)columnIdx;
37
38- (long) longForColumn:(NSString*)columnName;
39- (long) longForColumnIndex:(int)columnIdx;
40
41- (long long int) longLongIntForColumn:(NSString*)columnName;
42- (long long int) longLongIntForColumnIndex:(int)columnIdx;
43
44- (BOOL) boolForColumn:(NSString*)columnName;
45- (BOOL) boolForColumnIndex:(int)columnIdx;
46
47- (double) doubleForColumn:(NSString*)columnName;
48- (double) doubleForColumnIndex:(int)columnIdx;
49
50- (NSString*) stringForColumn:(NSString*)columnName;
51- (NSString*) stringForColumnIndex:(int)columnIdx;
52
53- (NSDate*) dateForColumn:(NSString*)columnName;
54- (NSDate*) dateForColumnIndex:(int)columnIdx;
55
56- (NSData*) dataForColumn:(NSString*)columnName;
57- (NSData*) dataForColumnIndex:(int)columnIdx;
58
59- (const unsigned char *) UTF8StringForColumnIndex:(int)columnIdx;
60- (const unsigned char *) UTF8StringForColumnName:(NSString*)columnName;
61
62/*
63If you are going to use this data after you iterate over the next row, or after you close the
64result set, make sure to make a copy of the data first (or just use dataForColumn:/dataForColumnIndex:)
65If you don't, you're going to be in a world of hurt when you try and use the data.
66*/
67- (NSData*) dataNoCopyForColumn:(NSString*)columnName;
68- (NSData*) dataNoCopyForColumnIndex:(int)columnIdx;
69
70- (BOOL) columnIndexIsNull:(int)columnIdx;
71- (BOOL) columnIsNull:(NSString*)columnName;
72
73- (void) kvcMagic:(id)object;
74
75@end