34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
- (instancetype)initWithPath: (OFString *)path
flags: (int)flags
{
self = [super init];
@try {
int errorCode = sqlite3_open_v2(path.UTF8String, &_database,
flags, NULL);
if (errorCode != SQLITE_OK)
@throw [SL3OpenFailedException
exceptionWithPath: path
flags: flags
errorCode: errorCode];
} @catch (id e) {
[self release];
@throw e;
}
return self;
}
- (void)dealloc
{
sqlite3_close(_database);
[super dealloc];
}
@end
|
|
<
|
|
<
|
|
|
|
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
- (instancetype)initWithPath: (OFString *)path
flags: (int)flags
{
self = [super init];
@try {
int code = sqlite3_open_v2(path.UTF8String, &_db, flags, NULL);
if (code != SQLITE_OK)
@throw [SL3OpenFailedException exceptionWithPath: path
flags: flags
errorCode: code];
} @catch (id e) {
[self release];
@throw e;
}
return self;
}
- (void)dealloc
{
sqlite3_close(_db);
[super dealloc];
}
@end
|