Artifact b80f854ff0170c88485fff7cec0b413154054cd31ea48373d8c587e6c5b735dd:
- File
src/PGResult.m
— part of check-in
[6307a38198]
at
2017-05-10 23:46:05
on branch trunk
— Move private methods to separate headers
Also fixes a typo and adds two missing nullability annotations. (user: js, size: 711) [annotate] [blame] [check-ins using]
#import "PGResult.h" #import "PGResultRow.h" #import "PGResultRow+Private.h" @implementation PGResult + (instancetype)PG_resultWithResult: (PGresult *)result { return [[[self alloc] PG_initWithResult: result] autorelease]; } - (instancetype)PG_initWithResult: (PGresult *)result { self = [super init]; _result = result; return self; } - (void)dealloc { if (_result != NULL) PQclear(_result); [super dealloc]; } - (size_t)count { return PQntuples(_result); } - (id)objectAtIndex: (size_t)index { if (index > PQntuples(_result)) @throw [OFOutOfRangeException exception]; return [PGResultRow PG_rowWithResult: self row: (int)index]; } - (PGresult *)PG_result { return _result; } @end