Adjust to recent ObjFW changes

FossilOrigin-Name: fc8e42990e7f6476b8b806521222620bbac0496c61a91b20f9e3787fc20fdbb4
This commit is contained in:
Jonathan Schleifer 2017-05-09 23:19:19 +00:00
parent 6d64ce5a68
commit ae918f26c4
12 changed files with 88 additions and 65 deletions

View file

@ -1,14 +1,18 @@
#import "PGException.h"
OF_ASSUME_NONNULL_BEGIN
@interface PGCommandFailedException: PGException
{
OFString *_command;
}
@property (readonly, copy) OFString *command;
@property (readonly, nonatomic) OFString *command;
+ (instancetype)exceptionWithConnection: (PGConnection*)connection
command: (OFString*)command;
- initWithConnection: (PGConnection*)connection
command: (OFString*)command;
+ (instancetype)exceptionWithConnection: (PGConnection *)connection
command: (OFString *)command;
- initWithConnection: (PGConnection *)connection
command: (OFString *)command;
@end
OF_ASSUME_NONNULL_END

View file

@ -3,15 +3,15 @@
@implementation PGCommandFailedException
@synthesize command = _command;
+ (instancetype)exceptionWithConnection: (PGConnection*)connection
command: (OFString*)command
+ (instancetype)exceptionWithConnection: (PGConnection *)connection
command: (OFString *)command
{
return [[[self alloc] initWithConnection: connection
command: command] autorelease];
}
- initWithConnection: (PGConnection*)connection
command: (OFString*)command
- initWithConnection: (PGConnection *)connection
command: (OFString *)command
{
self = [super initWithConnection: connection];
@ -32,7 +32,7 @@
[super dealloc];
}
- (OFString*)description
- (OFString *)description
{
return [OFString stringWithFormat: @"A PostgreSQL command failed: %@\n"
@"Command: %@", _error, _command];

View file

@ -1,4 +1,8 @@
#import "PGException.h"
OF_ASSUME_NONNULL_BEGIN
@interface PGConnectionFailedException: PGException
@end
OF_ASSUME_NONNULL_END

View file

@ -1,7 +1,7 @@
#import "PGConnectionFailedException.h"
@implementation PGConnectionFailedException
- (OFString*)description
- (OFString *)description
{
return [OFString stringWithFormat:
@"Establishing a PostgreSQL connection failed:\n%@\n"

View file

@ -2,14 +2,18 @@
#import "PGConnection.h"
OF_ASSUME_NONNULL_BEGIN
@interface PGException: OFException
{
PGConnection *_connection;
OFString *_error;
}
@property (readonly, retain) PGConnection *connection;
@property (readonly, nonatomic) PGConnection *connection;
+ (instancetype)exceptionWithConnection: (PGConnection*)connection;
- initWithConnection: (PGConnection*)connection;
+ (instancetype)exceptionWithConnection: (PGConnection *)connection;
- initWithConnection: (PGConnection *)connection;
@end
OF_ASSUME_NONNULL_END

View file

@ -3,12 +3,12 @@
@implementation PGException
@synthesize connection = _connection;
+ (instancetype)exceptionWithConnection: (PGConnection*)connection
+ (instancetype)exceptionWithConnection: (PGConnection *)connection
{
return [[[self alloc] initWithConnection: connection] autorelease];
}
- initWithConnection: (PGConnection*)connection
- initWithConnection: (PGConnection *)connection
{
self = [super init];
@ -33,7 +33,7 @@
[super dealloc];
}
- (OFString*)description
- (OFString *)description
{
return [OFString stringWithFormat: @"A PostgreSQL operation failed: %@",
_error];