Prefix all ivars with an underscore.
FossilOrigin-Name: 8c8a4313228bba7114d582a6802a2df53a1fb357f5c0805ae58531dd4c799d8c
This commit is contained in:
parent
7b323460a5
commit
b3eaf2f272
11 changed files with 114 additions and 129 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
@interface PGCommandFailedException: PGException
|
||||
{
|
||||
OFString *command;
|
||||
OFString *_command;
|
||||
}
|
||||
|
||||
#ifdef OF_HAVE_PROPERTIES
|
||||
|
|
|
@ -10,15 +10,15 @@
|
|||
command: command] autorelease];
|
||||
}
|
||||
|
||||
- initWithClass: (Class)class_
|
||||
connection: (PGConnection*)connection_
|
||||
command: (OFString*)command_
|
||||
- initWithClass: (Class)class
|
||||
connection: (PGConnection*)connection
|
||||
command: (OFString*)command
|
||||
{
|
||||
self = [super initWithClass: class_
|
||||
connection: connection_];
|
||||
self = [super initWithClass: class
|
||||
connection: connection];
|
||||
|
||||
@try {
|
||||
command = [command_ copy];
|
||||
_command = [command copy];
|
||||
} @catch (id e) {
|
||||
[self release];
|
||||
@throw e;
|
||||
|
@ -29,25 +29,21 @@
|
|||
|
||||
- (void)dealloc
|
||||
{
|
||||
[command release];
|
||||
[_command release];
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (OFString*)description
|
||||
{
|
||||
if (description != nil)
|
||||
return description;
|
||||
|
||||
description = [[OFString alloc] initWithFormat:
|
||||
return [OFString stringWithFormat:
|
||||
@"A PostgreSQL command in class %@ failed: %s\nCommand: %@",
|
||||
inClass, PQerrorMessage([connection PG_connection]), command];
|
||||
|
||||
return description;
|
||||
[self inClass], PQerrorMessage([_connection PG_connection]),
|
||||
_command];
|
||||
}
|
||||
|
||||
- (OFString*)command
|
||||
{
|
||||
OF_GETTER(command, NO)
|
||||
OF_GETTER(_command, NO)
|
||||
}
|
||||
@end
|
||||
|
|
|
@ -3,19 +3,10 @@
|
|||
@implementation PGConnectionFailedException
|
||||
- (OFString*)description
|
||||
{
|
||||
OFAutoreleasePool *pool;
|
||||
|
||||
if (description != nil)
|
||||
return description;
|
||||
|
||||
pool = [[OFAutoreleasePool alloc] init];
|
||||
description = [[OFString alloc] initWithFormat:
|
||||
return [OFString stringWithFormat:
|
||||
@"Establishing a PostgreSQL connection in class %@ failed:\n%s\n"
|
||||
"Parameters: %@", inClass,
|
||||
PQerrorMessage([connection PG_connection]),
|
||||
[connection parameters]];
|
||||
[pool release];
|
||||
|
||||
return description;
|
||||
"Parameters: %@", [self inClass],
|
||||
PQerrorMessage([_connection PG_connection]),
|
||||
[_connection parameters]];
|
||||
}
|
||||
@end
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
@interface PGException: OFException
|
||||
{
|
||||
PGConnection *connection;
|
||||
PGConnection *_connection;
|
||||
}
|
||||
|
||||
#ifdef OF_HAVE_PROPERTIES
|
||||
|
|
|
@ -8,37 +8,32 @@
|
|||
connection: connection] autorelease];
|
||||
}
|
||||
|
||||
- initWithClass: (Class)class_
|
||||
connection: (PGConnection*)connection_
|
||||
- initWithClass: (Class)class
|
||||
connection: (PGConnection*)connection
|
||||
{
|
||||
self = [super initWithClass: class_];
|
||||
self = [super initWithClass: class];
|
||||
|
||||
connection = [connection_ retain];
|
||||
_connection = [connection retain];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[connection release];
|
||||
[_connection release];
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (OFString*)description
|
||||
{
|
||||
if (description != nil)
|
||||
return description;
|
||||
|
||||
description = [[OFString alloc] initWithFormat:
|
||||
@"A PostgreSQL operation in class %@ failed: %s", inClass,
|
||||
PQerrorMessage([connection PG_connection])];
|
||||
|
||||
return description;
|
||||
return [OFString stringWithFormat:
|
||||
@"A PostgreSQL operation in class %@ failed: %s", [self inClass],
|
||||
PQerrorMessage([_connection PG_connection])];
|
||||
}
|
||||
|
||||
- (PGConnection*)connection
|
||||
{
|
||||
OF_GETTER(connection, NO)
|
||||
OF_GETTER(_connection, NO)
|
||||
}
|
||||
@end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue