Adjust to ObjFW changes

FossilOrigin-Name: b80a03bd2fd4ff11dc0d9c7ce330695ebc060f78034b9ade2d7eb53d88c7bb80
This commit is contained in:
Jonathan Schleifer 2016-02-21 11:08:17 +00:00
parent f9d637e7be
commit 3c16f110f5
6 changed files with 8 additions and 32 deletions

View file

@ -10,12 +10,8 @@
OFDictionary *_parameters; OFDictionary *_parameters;
} }
#ifdef OF_HAVE_PROPERTIES
@property (copy) OFDictionary *parameters; @property (copy) OFDictionary *parameters;
#endif
- (void)setParameters: (OFDictionary*)parameters;
- (OFDictionary*)parameters;
- (void)connect; - (void)connect;
- (void)reset; - (void)reset;
- (void)close; - (void)close;

View file

@ -4,6 +4,8 @@
#import "PGCommandFailedException.h" #import "PGCommandFailedException.h"
@implementation PGConnection @implementation PGConnection
@synthesize parameters = _parameters;
- (void)dealloc - (void)dealloc
{ {
[_parameters release]; [_parameters release];
@ -13,16 +15,6 @@
[super dealloc]; [super dealloc];
} }
- (void)setParameters: (OFDictionary*)parameters
{
OF_SETTER(_parameters, parameters, YES, YES)
}
- (OFDictionary*)parameters
{
OF_GETTER(_parameters, YES)
}
- (void)connect - (void)connect
{ {
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];

View file

@ -5,13 +5,10 @@
OFString *_command; OFString *_command;
} }
#ifdef OF_HAVE_PROPERTIES @property (readonly, copy) OFString *command;
@property (readonly, copy, nonatomic) OFString *command;
#endif
+ (instancetype)exceptionWithConnection: (PGConnection*)connection + (instancetype)exceptionWithConnection: (PGConnection*)connection
command: (OFString*)command; command: (OFString*)command;
- initWithConnection: (PGConnection*)connection - initWithConnection: (PGConnection*)connection
command: (OFString*)command; command: (OFString*)command;
- (OFString*)command;
@end @end

View file

@ -1,6 +1,8 @@
#import "PGCommandFailedException.h" #import "PGCommandFailedException.h"
@implementation PGCommandFailedException @implementation PGCommandFailedException
@synthesize command = _command;
+ (instancetype)exceptionWithConnection: (PGConnection*)connection + (instancetype)exceptionWithConnection: (PGConnection*)connection
command: (OFString*)command command: (OFString*)command
{ {
@ -35,9 +37,4 @@
return [OFString stringWithFormat: @"A PostgreSQL command failed: %@\n" return [OFString stringWithFormat: @"A PostgreSQL command failed: %@\n"
@"Command: %@", _error, _command]; @"Command: %@", _error, _command];
} }
- (OFString*)command
{
OF_GETTER(_command, NO)
}
@end @end

View file

@ -8,11 +8,8 @@
OFString *_error; OFString *_error;
} }
#ifdef OF_HAVE_PROPERTIES @property (readonly, retain) PGConnection *connection;
@property (readonly, retain, nonatomic) PGConnection *connection;
#endif
+ (instancetype)exceptionWithConnection: (PGConnection*)connection; + (instancetype)exceptionWithConnection: (PGConnection*)connection;
- initWithConnection: (PGConnection*)connection; - initWithConnection: (PGConnection*)connection;
- (PGConnection*)connection;
@end @end

View file

@ -1,6 +1,8 @@
#import "PGException.h" #import "PGException.h"
@implementation PGException @implementation PGException
@synthesize connection = _connection;
+ (instancetype)exceptionWithConnection: (PGConnection*)connection + (instancetype)exceptionWithConnection: (PGConnection*)connection
{ {
return [[[self alloc] initWithConnection: connection] autorelease]; return [[[self alloc] initWithConnection: connection] autorelease];
@ -36,9 +38,4 @@
return [OFString stringWithFormat: @"A PostgreSQL operation failed: %@", return [OFString stringWithFormat: @"A PostgreSQL operation failed: %@",
_error]; _error];
} }
- (PGConnection*)connection
{
OF_GETTER(_connection, NO)
}
@end @end