mirror of
https://github.com/gnustep/libs-gdl2.git
synced 2025-04-25 13:50:54 +00:00
* EOAdaptors/Postgres95/Postgres95Values.m: Remove dependency
on EOAccess/EOAttributePriv.h and EOControl/EONSAddOns.h. (attrRespondsToValueClass, attrRespondsToValueTypeChar): New static locals. (+initialize, +newValueForNumberType:length:attribute:): Remove dependency and used static locals instead. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20751 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
7c80ffaf65
commit
3bd48d095d
2 changed files with 24 additions and 4 deletions
|
@ -37,6 +37,13 @@
|
||||||
(+newValueForDateType:length:attribute:): Do not depend on
|
(+newValueForDateType:length:attribute:): Do not depend on
|
||||||
EOControl/EOPriv.m/h but on own private files. Improve
|
EOControl/EOPriv.m/h but on own private files. Improve
|
||||||
optimizations.
|
optimizations.
|
||||||
|
|
||||||
|
* EOAdaptors/Postgres95/Postgres95Values.m: Remove dependency
|
||||||
|
on EOAccess/EOAttributePriv.h and EOControl/EONSAddOns.h.
|
||||||
|
(attrRespondsToValueClass, attrRespondsToValueTypeChar): New
|
||||||
|
static locals.
|
||||||
|
(+initialize, +newValueForNumberType:length:attribute:): Remove
|
||||||
|
dependency and used static locals instead.
|
||||||
|
|
||||||
2005-02-18 Matt Rice <ratmice@yahoo.com>
|
2005-02-18 Matt Rice <ratmice@yahoo.com>
|
||||||
|
|
||||||
|
|
|
@ -54,8 +54,6 @@ RCS_ID("$Id$")
|
||||||
|
|
||||||
|
|
||||||
#include <EOAccess/EOAttribute.h>
|
#include <EOAccess/EOAttribute.h>
|
||||||
#include <EOAccess/EOAttributePriv.h>
|
|
||||||
#include <EOControl/EONSAddOns.h>
|
|
||||||
|
|
||||||
#include "Postgres95EOAdaptor/Postgres95Adaptor.h"
|
#include "Postgres95EOAdaptor/Postgres95Adaptor.h"
|
||||||
#include "Postgres95EOAdaptor/Postgres95Channel.h"
|
#include "Postgres95EOAdaptor/Postgres95Channel.h"
|
||||||
|
@ -70,8 +68,15 @@ void __postgres95_values_linking_function (void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static BOOL attrRespondsToValueClass = NO;
|
||||||
|
static BOOL attrRespondsToValueTypeChar = NO;
|
||||||
static NSStringEncoding LPSQLA_StringDefaultCStringEncoding;
|
static NSStringEncoding LPSQLA_StringDefaultCStringEncoding;
|
||||||
|
|
||||||
|
@interface EOAttribute (private)
|
||||||
|
- (Class)_valueClass;
|
||||||
|
- (char)_valueTypeChar;
|
||||||
|
@end
|
||||||
|
|
||||||
@implementation Postgres95Values
|
@implementation Postgres95Values
|
||||||
|
|
||||||
+ (void) initialize
|
+ (void) initialize
|
||||||
|
@ -81,6 +86,10 @@ static NSStringEncoding LPSQLA_StringDefaultCStringEncoding;
|
||||||
{
|
{
|
||||||
PSQLA_PrivInit();
|
PSQLA_PrivInit();
|
||||||
|
|
||||||
|
attrRespondsToValueClass
|
||||||
|
= [EOAttribute instancesRespondToSelector: @selector(_valueClass)];
|
||||||
|
attrRespondsToValueTypeChar
|
||||||
|
= [EOAttribute instancesRespondToSelector: @selector(_valueTypeChar)];
|
||||||
LPSQLA_StringDefaultCStringEncoding = [NSString defaultCStringEncoding];
|
LPSQLA_StringDefaultCStringEncoding = [NSString defaultCStringEncoding];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -142,7 +151,9 @@ to strlen(bytes)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Class valueClass=[attribute _valueClass];
|
Class valueClass = attrRespondsToValueClass
|
||||||
|
? [attribute _valueClass]
|
||||||
|
: NSClassFromString ([attribute valueClassName]);
|
||||||
|
|
||||||
if (valueClass==PSQLA_NSDecimalNumberClass)
|
if (valueClass==PSQLA_NSDecimalNumberClass)
|
||||||
{
|
{
|
||||||
|
@ -156,7 +167,9 @@ to strlen(bytes)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char valueTypeChar=[attribute _valueTypeChar];
|
char valueTypeChar = attrRespondsToValueTypeChar
|
||||||
|
? [attribute _valueTypeChar]
|
||||||
|
: [[attribute valueType] cString][0];
|
||||||
switch(valueTypeChar)
|
switch(valueTypeChar)
|
||||||
{
|
{
|
||||||
case 'i':
|
case 'i':
|
||||||
|
|
Loading…
Reference in a new issue