mirror of
https://github.com/gnustep/libs-gdl2.git
synced 2025-02-19 09:40:59 +00:00
OSX fixes.
Addes eoutil. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@15870 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
75e5869bb6
commit
c5706ff137
21 changed files with 268 additions and 78 deletions
57
ChangeLog
57
ChangeLog
|
@ -1,3 +1,60 @@
|
|||
2003-02-04 Stephane Corthesy <stephane@sente.ch>
|
||||
|
||||
* Tools/eoutil.m: implemented.
|
||||
|
||||
* EOAndQualifier.m: replaced autorelease by AUTORELEASE
|
||||
* EOClassDescription.m: added #include <gnustep/base/objc-gnu2next.h>
|
||||
and note about subclassing NSClassDescription
|
||||
* EOEditingContext.m: removed EOAccess inclusion; note that we need to
|
||||
rewrite -faultForRawRow:entityNamed:editingContext: to break dependency
|
||||
to EOAccess
|
||||
* EOFault.m: implemented +doesNotRecognizeSelector:
|
||||
* EOFaultHandler.m: added #include <objc/objc-class.h> and #include
|
||||
<objc/Protocol.h>
|
||||
* EOFetchSpecification.m: added #import <Foundation/NSDictionary.h>
|
||||
* EOGenericRecord.h: declaration of -valueForKey: and
|
||||
-takeValue:forKey: needs to be done only when !FOUNDATION_HAS_KVC
|
||||
* EOGenericRecord.m: removed #import <EOAccess/EOEntity.h> and #import
|
||||
<EOAccess/EORelationship.h>; added #include <objc/objc-class.h>;
|
||||
declared +eoCalculateSizeWith:forArray:; corrected +initialize (doesn't
|
||||
return a value); renamed +removeDestoyedObject: to
|
||||
+removeDestroyedObject:; modified
|
||||
-initWithEditingContext:classDescription:globalID: to no longer depend
|
||||
on EOAccess via EOEntity; some methods need to be implemented only when
|
||||
!FOUNDATION_HAS_KVC (else they are already correctly implemented in
|
||||
NSObject), some others only when FOUNDATION_HAS_KVC
|
||||
(-handleQueryWithUnboundKey: and handleTakeValue:forUnboundKey:); in
|
||||
-smartTakeValue:forKey:, removed dependency to EOAccess via
|
||||
EORelationship; corrected problem with macro NSDebugMLog, which should
|
||||
be replaced by other macro anyway; modified -eoCalculateSizeWith: to no
|
||||
longer depend on EOAccess via EOEntity
|
||||
* EOGlobalID.m: added #include <stdio.h> and #include <string.h>; added
|
||||
cast in +assignGloballyUniqueBytes:
|
||||
* EOKeyComparisonQualifier.m: added casts
|
||||
* EOKeyGlobalID.m: replaced retain by RETAIN
|
||||
* EOKeyValueCoding.h: removed #import
|
||||
<EOControl/EOKeyValueCodingBase.h>; added - (id)storedValueForKeyPath:
|
||||
(NSString *)key; declared some methods only when !FOUNDATION_HAS_KVC;
|
||||
declared hidden methods for MacOS X.
|
||||
* EOKeyValueCoding.m: added #include <ctype.h>; implemented some
|
||||
methods only when !FOUNDATION_HAS_KVC; corrected problem with macros
|
||||
NSDebugMLog/NSWarnLog, which should be replaced by other macro anyway;
|
||||
declared -[NSMutableDictionary(EOKeyValueCodingPrivate)
|
||||
takeValue:forKeyPath:isSmart:]; corrected zombie in
|
||||
-[NSMutableDictionary(EOKeyValueCoding) takeValue:forKeyPath:isSmart:]
|
||||
* EOKeyValueQualifier: added casts
|
||||
* EOMutableKnownKeyDictionary.m: added #warning about missing method;
|
||||
moved method implementation to avoid warning
|
||||
* EONSAddOns.m: added casts
|
||||
* EOObjectStoreCoordinator.m: corrected problem with macro NSDebugMLog,
|
||||
which should be replaced by other macro anyway
|
||||
* EOQualifier.m: added #include <gnustep/base/GSObjCRuntime.h>;
|
||||
corrected problem with macro NSDebugLog, which should be replaced by
|
||||
other macro anyway; replaced retain by RETAIN; in -doesContain:, no
|
||||
need to test against NSMutableArray class
|
||||
* EOSortOrdering.m: replaced retain by RETAIN; avoid autoreleased
|
||||
objects; replaced mutableCopy by initWithArray:copyItems:
|
||||
|
||||
2003-02-03 Stephane Corthesy <stephane@sente.ch>
|
||||
|
||||
* Postgres95Adaptor.m: made some changes to externalTypeNames (needs
|
||||
|
|
|
@ -51,7 +51,7 @@ RCS_ID("$Id$")
|
|||
|
||||
+ (EOQualifier *)qualifierWithQualifierArray: (NSArray *)array
|
||||
{
|
||||
return [[[self alloc] initWithQualifierArray: array] autorelease];
|
||||
return AUTORELEASE([[self alloc] initWithQualifierArray: array]);
|
||||
}
|
||||
|
||||
+ (EOQualifier *)qualifierWithQualifiers: (EOQualifier *)qualifiers, ...
|
||||
|
@ -70,7 +70,7 @@ RCS_ID("$Id$")
|
|||
|
||||
va_end(ap);
|
||||
|
||||
return [[[self alloc] initWithQualifierArray: qualArray] autorelease];
|
||||
return AUTORELEASE([[self alloc] initWithQualifierArray: qualArray]);
|
||||
}
|
||||
|
||||
- (id) initWithQualifiers: (EOQualifier *)qualifiers, ...
|
||||
|
|
|
@ -47,8 +47,12 @@ RCS_ID("$Id$")
|
|||
#import <EOControl/EOCheapArray.h>
|
||||
#import <EOControl/EODebug.h>
|
||||
|
||||
#include <gnustep/base/objc-gnu2next.h>
|
||||
|
||||
|
||||
//?? #define NOT_FOUND_CLASS_DESCRIPTION ([NSObject class]) //we use NSObject class as a "not found" value*******
|
||||
// NOTE: (stephane@sente.ch) Should we subclass NSClassDescription?
|
||||
|
||||
@implementation EOClassDescription
|
||||
|
||||
|
||||
|
|
|
@ -48,7 +48,8 @@ RCS_ID("$Id$")
|
|||
#import <EOControl/EONSAddOns.h>
|
||||
#import <EOControl/EODebug.h>
|
||||
|
||||
#import <EOAccess/EOEntity.h>
|
||||
|
||||
@class EOEntityClassDescription;
|
||||
|
||||
|
||||
@implementation EOEditingContext
|
||||
|
@ -2487,6 +2488,7 @@ modified state of the object.**/
|
|||
|
||||
classDesc = (id)[EOClassDescription classDescriptionForEntityName:
|
||||
entityName];
|
||||
#warning (stephane@sente.ch) ERROR: trying to use EOEntity/EOEntityDescription which are defined in EOAccess
|
||||
globalID = [[classDesc entity] globalIDForRow: row];
|
||||
object = [self objectForGlobalID: globalID];
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@ typedef struct {
|
|||
|
||||
+ (BOOL)isKindOfClass: (Class)aClass
|
||||
{
|
||||
if(aClass == [EOFault class])
|
||||
if (aClass == [EOFault class])
|
||||
return YES;
|
||||
|
||||
return NO;
|
||||
|
@ -126,8 +126,12 @@ typedef struct {
|
|||
|
||||
+ (void)doesNotRecognizeSelector: (SEL)sel
|
||||
{
|
||||
return;
|
||||
[self notImplemented: _cmd];
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"%@ -- %@ 0x%x: selector \"%@\" not recognized",
|
||||
NSStringFromSelector(_cmd),
|
||||
NSStringFromClass([self class]),
|
||||
self,
|
||||
NSStringFromSelector(sel)];
|
||||
}
|
||||
|
||||
+ (BOOL)respondsToSelector: (SEL)sel
|
||||
|
|
|
@ -49,6 +49,12 @@ RCS_ID("$Id$")
|
|||
#import <EOControl/EOFault.h>
|
||||
#import <EOControl/EODebug.h>
|
||||
|
||||
#ifndef GNU_RUNTIME
|
||||
#include <objc/objc-class.h>
|
||||
#endif
|
||||
|
||||
#include <objc/Protocol.h>
|
||||
|
||||
|
||||
BOOL __isGCEnabled(Class class_)
|
||||
{
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
RCS_ID("$Id$")
|
||||
|
||||
#import <Foundation/NSCoder.h>
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSValue.h>
|
||||
#import <Foundation/NSDebug.h>
|
||||
|
||||
|
|
|
@ -51,9 +51,11 @@
|
|||
classDescription: (EOClassDescription *)classDesc
|
||||
globalID: (EOGlobalID *)globalID;
|
||||
|
||||
#if !FOUNDATION_HAS_KVC
|
||||
- (id)valueForKey: (NSString *)key;
|
||||
- (void)takeValue: (id)value
|
||||
forKey: (NSString *)key;
|
||||
#endif
|
||||
|
||||
+ (void)eoCalculateAllSizeWith: (NSMutableDictionary*)dict;
|
||||
- (unsigned int)eoCalculateSizeWith: (NSMutableDictionary*)dict;
|
||||
|
|
|
@ -49,9 +49,6 @@ RCS_ID("$Id$")
|
|||
|
||||
#import <gnustep/base/GSObjCRuntime.h>
|
||||
|
||||
#import <EOAccess/EOEntity.h>
|
||||
#import <EOAccess/EORelationship.h>
|
||||
|
||||
#import <EOControl/EOClassDescription.h>
|
||||
#import <EOControl/EOGenericRecord.h>
|
||||
#import <EOControl/EONull.h>
|
||||
|
@ -61,6 +58,10 @@ RCS_ID("$Id$")
|
|||
#import <EOControl/EODebug.h>
|
||||
#import <EOControl/EOKeyValueCoding.h>
|
||||
|
||||
#ifndef GNU_RUNTIME
|
||||
#include <objc/objc-class.h>
|
||||
#endif
|
||||
|
||||
|
||||
@interface NSObject (EOCalculateSize)
|
||||
- (unsigned int)eoGetSize;
|
||||
|
@ -84,6 +85,11 @@ RCS_ID("$Id$")
|
|||
forFault: (id)object;
|
||||
@end
|
||||
|
||||
@interface EOGenericRecord(EOCalculateSize)
|
||||
+ (unsigned int)eoCalculateSizeWith: (NSMutableDictionary *)dict
|
||||
forArray: (NSArray *)array;
|
||||
@end
|
||||
|
||||
|
||||
static NSHashTable *allGenericRecords = NULL;
|
||||
static NSRecursiveLock *allGenericRecordsLock = nil;
|
||||
|
@ -93,14 +99,13 @@ static NSRecursiveLock *allGenericRecordsLock = nil;
|
|||
|
||||
+ (void) initialize
|
||||
{
|
||||
if ([[super superclass] initialize])
|
||||
[[super superclass] initialize];
|
||||
|
||||
if (self == [EOGenericRecord class] && !allGenericRecords)
|
||||
{
|
||||
if (self == [EOGenericRecord class])
|
||||
{
|
||||
allGenericRecords = NSCreateHashTable(NSNonOwnedPointerHashCallBacks,
|
||||
1000);
|
||||
allGenericRecordsLock = [NSRecursiveLock new];
|
||||
}
|
||||
allGenericRecords = NSCreateHashTable(NSNonOwnedPointerHashCallBacks,
|
||||
1000);
|
||||
allGenericRecordsLock = [NSRecursiveLock new];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -111,7 +116,7 @@ static NSRecursiveLock *allGenericRecordsLock = nil;
|
|||
[allGenericRecordsLock unlock];
|
||||
}
|
||||
|
||||
+ (void)removeDestoyedObject: (EOGenericRecord *)o
|
||||
+ (void)removeDestroyedObject: (EOGenericRecord *)o
|
||||
{
|
||||
[allGenericRecordsLock lock];
|
||||
NSHashRemove(allGenericRecords, o);
|
||||
|
@ -134,7 +139,7 @@ static NSRecursiveLock *allGenericRecordsLock = nil;
|
|||
{
|
||||
if ((self = [self init]))
|
||||
{
|
||||
EOEntity *entity = nil;
|
||||
NSMutableArray *classPropertyNames = nil;
|
||||
EOMutableKnownKeyDictionary *entityMKKD = nil;
|
||||
|
||||
if (!classDesc)
|
||||
|
@ -151,14 +156,25 @@ static NSRecursiveLock *allGenericRecordsLock = nil;
|
|||
|
||||
ASSIGN(classDescription, classDesc);
|
||||
|
||||
entity = [(EOEntityClassDescription*)classDesc entity];
|
||||
NSAssert(entity, @"No entity");
|
||||
// Get class properties (attributes + relationships)
|
||||
classPropertyNames = [[NSMutableArray alloc]
|
||||
initWithArray: [classDesc attributeKeys]];
|
||||
[classPropertyNames addObjectsFromArray:
|
||||
[classDesc toOneRelationshipKeys]];
|
||||
[classPropertyNames addObjectsFromArray:
|
||||
[classDesc toManyRelationshipKeys]];
|
||||
|
||||
entityMKKD = [entity _dictionaryForProperties];
|
||||
NSAssert1([classPropertyNames count] > 0,
|
||||
@"No classPropertyNames in %@", classDesc);
|
||||
|
||||
entityMKKD = [EOMutableKnownKeyDictionary
|
||||
dictionaryWithInitializer:
|
||||
[[EOMKKDInitializer newWithKeyArray: classPropertyNames] autorelease]];
|
||||
|
||||
ASSIGN(dictionary,entityMKKD);
|
||||
EOFLOGObjectLevelArgs(@"EOGenericRecord", @"Record %p: dictionary=%@",
|
||||
self, dictionary);
|
||||
[classPropertyNames release];
|
||||
}
|
||||
|
||||
return self;
|
||||
|
@ -170,7 +186,7 @@ static NSRecursiveLock *allGenericRecordsLock = nil;
|
|||
@"Deallocate EOGenericRecord %p (dict=%p)",
|
||||
self, dictionary);
|
||||
|
||||
[[self class] removeDestoyedObject: self];
|
||||
[[self class] removeDestroyedObject: self];
|
||||
|
||||
DESTROY(classDescription);
|
||||
DESTROY(dictionary);
|
||||
|
@ -183,6 +199,8 @@ static NSRecursiveLock *allGenericRecordsLock = nil;
|
|||
return classDescription;
|
||||
}
|
||||
|
||||
#if !FOUNDATION_HAS_KVC
|
||||
|
||||
static const char _c_id[2] = { _C_ID, NULL };
|
||||
|
||||
//used to allow derived object implementation
|
||||
|
@ -601,17 +619,21 @@ static const char _c_id[2] = { _C_ID, NULL };
|
|||
|
||||
EOFLOGObjectFnStopCond(@"EOGenericRecordKVC");
|
||||
}
|
||||
#endif /* !FOUNDATION_HAS_KVC */
|
||||
|
||||
/** if key is a bidirectional rel, use addObject:toBothSidesOfRelationship otherwise call takeValue:forKey: **/
|
||||
- (void)smartTakeValue: (id)anObject
|
||||
forKey: (NSString *)aKey
|
||||
{
|
||||
EORelationship *rel = [classDescription relationshipNamed: aKey];
|
||||
BOOL isToMany = [[classDescription toManyRelationshipKeys]
|
||||
containsObject: aKey];
|
||||
|
||||
//NSDebugMLog(@"aKey=%@ rel=%@ anObject=%@", aKey, rel, anObject);
|
||||
//NSDebugMLog(@"[rel isBidirectional]=%d", [rel isBidirectional]);
|
||||
|
||||
if (rel && [rel isBidirectional])
|
||||
if ((isToMany
|
||||
|| [[classDescription toOneRelationshipKeys] containsObject: aKey])
|
||||
&& [classDescription inverseForRelationshipKey: aKey] != nil)
|
||||
{
|
||||
if (isNilOrEONull(anObject))
|
||||
{
|
||||
|
@ -619,7 +641,7 @@ static const char _c_id[2] = { _C_ID, NULL };
|
|||
|
||||
if (isNilOrEONull(oldObj))
|
||||
{
|
||||
if (![rel isToMany])
|
||||
if (!isToMany)
|
||||
[self takeValue: anObject
|
||||
forKey: aKey];
|
||||
}
|
||||
|
@ -636,6 +658,7 @@ static const char _c_id[2] = { _C_ID, NULL };
|
|||
forKey: aKey];
|
||||
}
|
||||
|
||||
#if !FOUNDATION_HAS_KVC
|
||||
- (void) takeValue: (id)anObject forKey: (NSString*)aKey
|
||||
{
|
||||
SEL sel;
|
||||
|
@ -788,6 +811,54 @@ static const char _c_id[2] = { _C_ID, NULL };
|
|||
return value;
|
||||
}
|
||||
|
||||
#else /* FOUNDATION_HAS_KVC */
|
||||
|
||||
- (id) handleQueryWithUnboundKey: (NSString *)key
|
||||
{
|
||||
id value;
|
||||
|
||||
EOFLOGObjectFnStartCond(@"EOGenericRecordKVC");
|
||||
EOFLOGObjectLevelArgs(@"EOGenericRecordKVC",
|
||||
@"Unbound key named %@",
|
||||
key);
|
||||
|
||||
if (![dictionary hasKey: key])
|
||||
return [super handleQueryWithUnboundKey: key];
|
||||
|
||||
value = [dictionary objectForKey: key];
|
||||
|
||||
EOFLOGObjectLevelArgs(@"EOGenericRecordKVC", @"value %p (class=%@)",
|
||||
value, [value class]);
|
||||
EOFLOGObjectFnStopCond(@"EOGenericRecordKVC");
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
- (void) handleTakeValue: (id)value forUnboundKey: (NSString *)key
|
||||
{
|
||||
EOFLOGObjectFnStartCond(@"EOGenericRecordKVC");
|
||||
EOFLOGObjectLevelArgs(@"EOGenericRecordKVC",
|
||||
@"Unbound key named %@",
|
||||
key);
|
||||
|
||||
[self willChange];
|
||||
|
||||
if (![dictionary hasKey:key])
|
||||
[super handleTakeValue:value forUnboundKey: key];
|
||||
|
||||
if (value)
|
||||
[dictionary setObject: value
|
||||
forKey: key];
|
||||
else
|
||||
// [dictionary setObject: [EONull null]
|
||||
// forKey: key];
|
||||
[dictionary removeObjectForKey: key];
|
||||
|
||||
EOFLOGObjectFnStopCond(@"EOGenericRecordKVC");
|
||||
}
|
||||
|
||||
#endif /* FOUNDATION_HAS_KVC */
|
||||
|
||||
|
||||
/** used in -decription for self toOne or toMany objects to avoid
|
||||
infinite loop in description **/
|
||||
|
@ -901,7 +972,7 @@ infinite loop in description **/
|
|||
stringWithFormat: @"<%p %@: classDescription=%@>",
|
||||
obj,
|
||||
NSStringFromClass([obj class]),
|
||||
[obj classDescription]]
|
||||
[(EOGenericRecord *)obj classDescription]]
|
||||
forKey: key];
|
||||
}
|
||||
}
|
||||
|
@ -967,7 +1038,7 @@ infinite loop in description **/
|
|||
|
||||
[allGenericRecordsLock unlock];
|
||||
|
||||
NSDebugMLog(@"CALCULATE STOPEXC");
|
||||
NSDebugMLog(@"CALCULATE STOPEXC", "");
|
||||
[localException raise];
|
||||
}
|
||||
NS_ENDHANDLER;
|
||||
|
@ -1017,8 +1088,12 @@ infinite loop in description **/
|
|||
|
||||
//NSDebugMLog(@"classDescription=%@", classDescription);
|
||||
|
||||
props = [[(EOEntityClassDescription *)classDescription entity]
|
||||
classPropertyNames];
|
||||
// Get class properties (attributes + relationships)
|
||||
props = [NSMutableArray arrayWithArray: [classDescription attributeKeys]];
|
||||
[(NSMutableArray *)props addObjectsFromArray:
|
||||
[classDescription toOneRelationshipKeys]];
|
||||
[(NSMutableArray *)props addObjectsFromArray:
|
||||
[classDescription toManyRelationshipKeys]];
|
||||
size += [self eoGetSize];
|
||||
size += [dictionary eoGetSize];
|
||||
|
||||
|
|
|
@ -41,6 +41,8 @@ RCS_ID("$Id$")
|
|||
#import <EOControl/EOGlobalID.h>
|
||||
#import <EOControl/EODebug.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
@ -114,7 +116,7 @@ static unsigned long sequenceRev = 0;
|
|||
sequence-- % 0xff,
|
||||
getpid() % 0xff,
|
||||
(unsigned int)time( NULL ) % 0xffff,
|
||||
sequenceRev++ % 0xffff);
|
||||
(unsigned int)sequenceRev++ % 0xffff);
|
||||
|
||||
if (sequence == 0)
|
||||
sequence = 65535;
|
||||
|
|
|
@ -122,19 +122,19 @@ RCS_ID("$Id$")
|
|||
}
|
||||
else if (sel_eq(_selector, EOQualifierOperatorLessThan) == YES)
|
||||
{
|
||||
return [leftKey compare: rightKey] == NSOrderedAscending;
|
||||
return [(NSObject *)leftKey compare: rightKey] == NSOrderedAscending;
|
||||
}
|
||||
else if (sel_eq(_selector, EOQualifierOperatorGreaterThan) == YES)
|
||||
{
|
||||
return [leftKey compare: rightKey] == NSOrderedDescending;
|
||||
return [(NSObject *)leftKey compare: rightKey] == NSOrderedDescending;
|
||||
}
|
||||
else if (sel_eq(_selector, EOQualifierOperatorLessThanOrEqualTo) == YES)
|
||||
{
|
||||
return [leftKey compare: rightKey] != NSOrderedDescending;
|
||||
return [(NSObject *)leftKey compare: rightKey] != NSOrderedDescending;
|
||||
}
|
||||
else if (sel_eq(_selector, EOQualifierOperatorGreaterThanOrEqualTo) == YES)
|
||||
{
|
||||
return [leftKey compare: rightKey] != NSOrderedAscending;
|
||||
return [(NSObject *)leftKey compare: rightKey] != NSOrderedAscending;
|
||||
}
|
||||
else if (sel_eq(_selector, EOQualifierOperatorContains) == YES)
|
||||
{
|
||||
|
|
|
@ -160,7 +160,7 @@ RCS_ID("$Id$")
|
|||
self = [super init];
|
||||
|
||||
[coder decodeValueOfObjCType: @encode(unsigned short) at: &_keyCount];
|
||||
_entityName = [[coder decodeObject] retain];
|
||||
_entityName = RETAIN([coder decodeObject]);
|
||||
|
||||
_keyValues = NSZoneMalloc([coder objectZone], _keyCount);
|
||||
[coder decodeArrayOfObjCType: @encode(id) count: _keyCount at: _keyValues];
|
||||
|
|
|
@ -32,8 +32,6 @@
|
|||
#import <Foundation/NSKeyValueCoding.h>
|
||||
#import <Foundation/NSDictionary.h>
|
||||
|
||||
#import <EOControl/EOKeyValueCodingBase.h>
|
||||
|
||||
|
||||
@interface NSObject (EOKVCPAdditions2)
|
||||
- (void)smartTakeValue: (id)anObject
|
||||
|
@ -42,11 +40,19 @@
|
|||
forKeyPath: (NSString *)aKeyPath;
|
||||
- (void)takeStoredValue: value
|
||||
forKeyPath: (NSString *)key;
|
||||
- (id)storedValueForKeyPath: (NSString *)key;
|
||||
#if !FOUNDATION_HAS_KVC
|
||||
- (void)takeStoredValuesFromDictionary: (NSDictionary *)dictionary;
|
||||
#endif
|
||||
- (NSDictionary *)valuesForKeyPaths: (NSArray *)keyPaths;
|
||||
- (NSDictionary *)storedValuesForKeyPaths: (NSArray *)keyPaths;
|
||||
@end
|
||||
|
||||
#if NeXT_Foundation_LIBRARY
|
||||
@interface NSObject (MacOSXRevealed)
|
||||
- (void)takeStoredValuesFromDictionary: (NSDictionary *)dictionary;
|
||||
@end
|
||||
#endif
|
||||
|
||||
@interface NSArray (EOKeyValueCoding)
|
||||
- (id)valueForKey: (NSString *)key;
|
||||
|
@ -61,6 +67,7 @@
|
|||
|
||||
|
||||
|
||||
#if !FOUNDATION_HAS_KVC
|
||||
@interface NSDictionary (EOKeyValueCoding)
|
||||
- (id)valueForKey: (NSString *)key;
|
||||
@end
|
||||
|
@ -70,6 +77,7 @@
|
|||
- (void)takeValue: (id)value
|
||||
forKey: (NSString*)key;
|
||||
@end
|
||||
#endif
|
||||
|
||||
extern NSString *EOUnknownKeyException;
|
||||
extern NSString *EOTargetObjectUserInfoKey;
|
||||
|
|
|
@ -55,6 +55,7 @@ RCS_ID("$Id$")
|
|||
#import <Foundation/NSDebug.h>
|
||||
|
||||
#include <objc/objc-api.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#import <EOControl/EOKeyValueCoding.h>
|
||||
#import <EOControl/EONSAddOns.h>
|
||||
|
@ -145,6 +146,7 @@ RCS_ID("$Id$")
|
|||
return obj;
|
||||
}
|
||||
|
||||
#if !FOUNDATION_HAS_KVC
|
||||
- (void)takeStoredValuesFromDictionary: (NSDictionary *)dictionary
|
||||
{
|
||||
NSEnumerator *keyEnum;
|
||||
|
@ -167,6 +169,7 @@ RCS_ID("$Id$")
|
|||
|
||||
EOFLOGObjectFnStopCond(@"EOKVC");
|
||||
}
|
||||
#endif /* !FOUNDATION_HAS_KVC */
|
||||
|
||||
- (NSDictionary *)storedValuesForKeyPaths: (NSArray *)keyPaths
|
||||
{
|
||||
|
@ -315,7 +318,7 @@ RCS_ID("$Id$")
|
|||
if (warnedCount == NO)
|
||||
{
|
||||
warnedCount = YES;
|
||||
NSWarnLog(@"use of special 'count' key may works differently with only foundation base");
|
||||
NSWarnLog(@"use of special 'count' key may works differently with only foundation base", "");
|
||||
}
|
||||
result = [super valueForKey: key];
|
||||
}
|
||||
|
@ -396,7 +399,7 @@ RCS_ID("$Id$")
|
|||
if (warnedCount == NO)
|
||||
{
|
||||
warnedCount = YES;
|
||||
NSWarnLog(@"use of special 'count' key may works differently with only foundation base");
|
||||
NSWarnLog(@"use of special 'count' key may works differently with only foundation base", "");
|
||||
}
|
||||
result = [super valueForKeyPath: keyPath];
|
||||
}
|
||||
|
@ -518,6 +521,7 @@ RCS_ID("$Id$")
|
|||
|
||||
@implementation NSDictionary (EOKeyValueCoding)
|
||||
|
||||
#if !FOUNDATION_HAS_KVC
|
||||
- (id)valueForKey:(NSString *)key
|
||||
{
|
||||
id value;
|
||||
|
@ -536,7 +540,7 @@ RCS_ID("$Id$")
|
|||
if (warnedAllValues == NO)
|
||||
{
|
||||
warnedAllValues = YES;
|
||||
NSWarnLog(@"use of special 'allValues' key works differently with only foundation base");
|
||||
NSWarnLog(@"use of special 'allValues' key works differently with only foundation base", "");
|
||||
}
|
||||
|
||||
value = [self allValues];
|
||||
|
@ -547,7 +551,7 @@ RCS_ID("$Id$")
|
|||
if (warnedAllKeys == NO)
|
||||
{
|
||||
warnedAllKeys = YES;
|
||||
NSWarnLog(@"use of special 'allKeys' key works differently with only foundation base");
|
||||
NSWarnLog(@"use of special 'allKeys' key works differently with only foundation base", "");
|
||||
}
|
||||
|
||||
value = [self allKeys];
|
||||
|
@ -558,7 +562,7 @@ RCS_ID("$Id$")
|
|||
if (warnedCount == NO)
|
||||
{
|
||||
warnedCount = YES;
|
||||
NSWarnLog(@"use of special 'count' key works differently with only foundation base");
|
||||
NSWarnLog(@"use of special 'count' key works differently with only foundation base", "");
|
||||
}
|
||||
|
||||
value = [NSNumber numberWithInt: [self count]];
|
||||
|
@ -681,6 +685,7 @@ RCS_ID("$Id$")
|
|||
|
||||
return value;
|
||||
}
|
||||
#endif /* !FOUNDATION_HAS_KVC */
|
||||
|
||||
- (id)storedValueForKeyPath: (NSString*)keyPath
|
||||
{
|
||||
|
@ -768,8 +773,15 @@ RCS_ID("$Id$")
|
|||
@end
|
||||
|
||||
|
||||
@interface NSMutableDictionary(EOKeyValueCodingPrivate)
|
||||
- (void)takeValue: (id)value
|
||||
forKeyPath: (NSString *)keyPath
|
||||
isSmart: (BOOL)smartFlag;
|
||||
@end
|
||||
|
||||
@implementation NSMutableDictionary (EOKeyValueCoding)
|
||||
|
||||
#if !FOUNDATION_HAS_KVC
|
||||
- (void)takeValue: (id)value
|
||||
forKey: (NSString *)key
|
||||
{
|
||||
|
@ -797,6 +809,7 @@ RCS_ID("$Id$")
|
|||
|
||||
EOFLOGObjectFnStopCond(@"EOKVC");
|
||||
}
|
||||
#endif /* !FOUNDATION_HAS_KVC */
|
||||
|
||||
- (void)smartTakeValue: (id)value
|
||||
forKeyPath: (NSString*)keyPath
|
||||
|
@ -806,6 +819,7 @@ RCS_ID("$Id$")
|
|||
isSmart:YES];
|
||||
}
|
||||
|
||||
#if !FOUNDATION_HAS_KVC
|
||||
- (void)takeValue: (id)value
|
||||
forKeyPath: (NSString *)keyPath
|
||||
{
|
||||
|
@ -813,6 +827,7 @@ RCS_ID("$Id$")
|
|||
forKeyPath:keyPath
|
||||
isSmart:NO];
|
||||
}
|
||||
#endif /* !FOUNDATION_HAS_KVC */
|
||||
|
||||
- (void)takeValue: (id)value
|
||||
forKeyPath: (NSString *)keyPath
|
||||
|
@ -837,7 +852,7 @@ RCS_ID("$Id$")
|
|||
|
||||
//EOFLOGObjectLevelArgs(@"EOKVC", @"keyPathArray=%@", keyPathArray);
|
||||
|
||||
tmpKey = [keyPathArray objectAtIndex: 0];
|
||||
tmpKey = RETAIN([keyPathArray objectAtIndex: 0]);
|
||||
//EOFLOGObjectLevelArgs(@"EOKVC", @"tmpKey=%@", tmpKey);
|
||||
|
||||
[keyPathArray removeObjectAtIndex: 0];
|
||||
|
@ -846,13 +861,15 @@ RCS_ID("$Id$")
|
|||
[key appendString: @"."];
|
||||
if ([tmpKey hasSuffix: @"'"])
|
||||
{
|
||||
tmpKey = [tmpKey stringByDeletingSuffix: @"'"];
|
||||
ASSIGN(tmpKey, [tmpKey stringByDeletingSuffix: @"'"]);
|
||||
[key appendString: tmpKey];
|
||||
break;
|
||||
}
|
||||
else
|
||||
[key appendString: tmpKey];
|
||||
|
||||
RELEASE(tmpKey);
|
||||
|
||||
//EOFLOGObjectLevelArgs(@"EOKVC", @"key=%@", key);
|
||||
}
|
||||
|
||||
|
|
|
@ -116,27 +116,27 @@ operatorSelector: (SEL)selector
|
|||
|
||||
if (sel_eq(_selector, EOQualifierOperatorEqual) == YES)
|
||||
{
|
||||
return [key compare: _value] == NSOrderedSame;
|
||||
return [(NSString *)key compare: _value] == NSOrderedSame;
|
||||
}
|
||||
else if (sel_eq(_selector, EOQualifierOperatorNotEqual) == YES)
|
||||
{
|
||||
return [key compare: _value] != NSOrderedSame;
|
||||
return [(NSString *)key compare: _value] != NSOrderedSame;
|
||||
}
|
||||
else if (sel_eq(_selector, EOQualifierOperatorLessThan) == YES)
|
||||
{
|
||||
return [key compare: _value] == NSOrderedAscending;
|
||||
return [(NSString *)key compare: _value] == NSOrderedAscending;
|
||||
}
|
||||
else if (sel_eq(_selector, EOQualifierOperatorGreaterThan) == YES)
|
||||
{
|
||||
return [key compare: _value] == NSOrderedDescending;
|
||||
return [(NSString *)key compare: _value] == NSOrderedDescending;
|
||||
}
|
||||
else if (sel_eq(_selector, EOQualifierOperatorLessThanOrEqualTo) == YES)
|
||||
{
|
||||
return [key compare: _value] != NSOrderedDescending;
|
||||
return [(NSString *)key compare: _value] != NSOrderedDescending;
|
||||
}
|
||||
else if (sel_eq(_selector, EOQualifierOperatorGreaterThanOrEqualTo) == YES)
|
||||
{
|
||||
return [key compare: _value] != NSOrderedAscending;
|
||||
return [(NSString *)key compare: _value] != NSOrderedAscending;
|
||||
}
|
||||
else if (sel_eq(_selector, EOQualifierOperatorContains) == YES)
|
||||
{
|
||||
|
|
|
@ -472,6 +472,7 @@ RCS_ID("$Id$")
|
|||
+ (id)dictionaryFromDictionary: (NSDictionary *)dict
|
||||
subsetMapping: (EOMKKDSubsetMapping *)subsetMapping
|
||||
{
|
||||
#warning (stephane@sente.ch) Method is really not implemented!
|
||||
return [[self newDictionaryFromDictionary: dict
|
||||
subsetMapping: subsetMapping
|
||||
zone: NULL] autorelease];
|
||||
|
@ -518,14 +519,6 @@ RCS_ID("$Id$")
|
|||
|
||||
@implementation EOMutableKnownKeyDictionary
|
||||
|
||||
+ (id)dictionaryFromDictionary: (NSDictionary *)dict
|
||||
subsetMapping: (EOMKKDSubsetMapping *)subsetMapping
|
||||
{
|
||||
return [[self newDictionaryFromDictionary: dict
|
||||
subsetMapping: subsetMapping
|
||||
zone: NULL] autorelease];
|
||||
}
|
||||
|
||||
+ (id)newDictionaryFromDictionary: (NSDictionary*)dict
|
||||
subsetMapping: (EOMKKDSubsetMapping*)subsetMapping
|
||||
zone: (NSZone*)zone
|
||||
|
@ -584,6 +577,14 @@ RCS_ID("$Id$")
|
|||
return newDict;
|
||||
}
|
||||
|
||||
+ (id)dictionaryFromDictionary: (NSDictionary *)dict
|
||||
subsetMapping: (EOMKKDSubsetMapping *)subsetMapping
|
||||
{
|
||||
return [[self newDictionaryFromDictionary: dict
|
||||
subsetMapping: subsetMapping
|
||||
zone: NULL] autorelease];
|
||||
}
|
||||
|
||||
+ (id)newDictionaryWithObjects: (id*)objects
|
||||
arrayMapping: (id)mapping
|
||||
zone: (NSZone*)zone
|
||||
|
|
|
@ -422,7 +422,7 @@ RCS_ID("$Id$")
|
|||
|
||||
- (NSComparisonResult)eoCompareOnName: (id)object
|
||||
{
|
||||
return [[self name] compare: [object name]];
|
||||
return [(NSString *)[(id)self name] compare: [object name]];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -62,12 +62,12 @@ NSString *EOCooperatingObjectStoreNeeded = @"EOCooperatingObjectStoreNeeded";
|
|||
|
||||
- (void)dealloc
|
||||
{
|
||||
NSDebugMLog(@"dealloc coordinator");
|
||||
NSDebugMLog(@"dealloc coordinator", "");
|
||||
DESTROY(_stores);
|
||||
DESTROY(_userInfo);
|
||||
|
||||
[super dealloc];
|
||||
NSDebugMLog(@"dealloc coordinator end");
|
||||
NSDebugMLog(@"dealloc coordinator end", "");
|
||||
}
|
||||
|
||||
- (void)addCooperatingObjectStore: (EOCooperatingObjectStore *)store
|
||||
|
|
|
@ -49,6 +49,8 @@ RCS_ID("$Id$")
|
|||
#import <EOControl/EOQualifier.h>
|
||||
#import <EOControl/EODebug.h>
|
||||
|
||||
#include <gnustep/base/GSObjCRuntime.h>
|
||||
|
||||
|
||||
@implementation NSNumber (EOQualifierExtras)
|
||||
|
||||
|
@ -127,7 +129,7 @@ static NSString *getOperator(const char **cFormat, const char **s)
|
|||
{
|
||||
while (**s && !isalnum(**s) && !isspace(**s) && **s != '%' && **s != '\'')
|
||||
{
|
||||
NSDebugLog(@"avoid gcc 3.1.1 bug which optimizes to segfault");
|
||||
NSDebugLog(@"avoid gcc 3.1.1 bug which optimizes to segfault", "");
|
||||
(*s)++;
|
||||
}
|
||||
|
||||
|
@ -811,7 +813,7 @@ static Class whichQualifier(const char **cFormat, const char **s)
|
|||
{
|
||||
if ((self = [super init]))
|
||||
{
|
||||
_key = [[coder decodeObject] retain];
|
||||
_key = RETAIN([coder decodeObject]);
|
||||
}
|
||||
|
||||
return self;
|
||||
|
@ -873,13 +875,12 @@ static Class whichQualifier(const char **cFormat, const char **s)
|
|||
|
||||
- (BOOL)isNotEqualTo: (id)object
|
||||
{
|
||||
return ([self isEqual: object] ? NO : YES);
|
||||
return ([self isEqualTo: object] ? NO : YES);
|
||||
}
|
||||
|
||||
- (BOOL)doesContain: (id)object
|
||||
{
|
||||
if ([self isKindOfClass: [NSArray class]]
|
||||
|| [self isKindOfClass: [NSMutableArray class]])
|
||||
if ([self isKindOfClass: [NSArray class]])
|
||||
return [(NSArray *)self containsObject: object];
|
||||
|
||||
return NO;
|
||||
|
|
|
@ -65,7 +65,7 @@ RCS_ID("$Id$")
|
|||
self = [super init];
|
||||
|
||||
[coder decodeValueOfObjCType: @encode(SEL) at: &_selector];
|
||||
_key = [[coder decodeObject] retain];
|
||||
_key = RETAIN([coder decodeObject]);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
@ -129,12 +129,17 @@ RCS_ID("$Id$")
|
|||
return self;
|
||||
else
|
||||
{
|
||||
NSMutableArray *sortedArray = [[self mutableCopy] autorelease];
|
||||
NSMutableArray *sortedArray = [[NSMutableArray alloc]
|
||||
initWithArray: self copyItems: NO];
|
||||
NSArray *result;
|
||||
|
||||
[sortedArray sortUsingKeyOrderArray: orderArray];
|
||||
|
||||
// make array immutable but don't copy as mutable arrays copy deep
|
||||
return [NSArray arrayWithArray: sortedArray];
|
||||
result = [NSArray arrayWithArray: sortedArray];
|
||||
[sortedArray release];
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -275,18 +280,18 @@ RCS_ID("$Id$")
|
|||
|
||||
if (count > 1)
|
||||
{
|
||||
EOSortOrdering *order;
|
||||
NSEnumerator *orderEnum;
|
||||
int i, max;
|
||||
//NSString *key;
|
||||
|
||||
orderEnum = [orderArray objectEnumerator];
|
||||
if ((order = [orderEnum nextObject]))
|
||||
{
|
||||
|
||||
max = [orderArray count];
|
||||
for (i = 0; i < max; i++)
|
||||
{
|
||||
EOSortOrdering *order = [orderArray objectAtIndex: i];
|
||||
//id a, b;
|
||||
|
||||
|
||||
[self _sortUsingKeyOrder: order
|
||||
fromIndex: 0
|
||||
count: [self count]];
|
||||
count: count];
|
||||
#if 0
|
||||
key = [order key];
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ include $(GNUSTEP_MAKEFILES)/common.make
|
|||
include ../Version
|
||||
|
||||
# The library to be compiled
|
||||
TOOL_NAME=gdlgsdoc
|
||||
TOOL_NAME=gdlgsdoc eoutil
|
||||
|
||||
LIBRARIES_DEPEND_UPON=-lgnustep-base -lgnustep-db2control -lgnustep-db2
|
||||
|
||||
|
@ -81,6 +81,11 @@ gdl2gsdoc_AGSDOC_FLAGS = \
|
|||
}' -Up gdl2gsdoc
|
||||
|
||||
|
||||
eoutil_OBJC_FILES = eoutil.m
|
||||
|
||||
eoutil_HEADER_FILES =
|
||||
|
||||
|
||||
-include Makefile.preamble
|
||||
|
||||
-include GNUmakefile.local
|
||||
|
|
Loading…
Reference in a new issue