+2005-08-04 Helge Hess <helge.hess@skyrix.com>
+
+ * v4.5.55
+
+ * EOSortOrdering.m, EOFetchSpecification.m: added EOKeyValueArchiving
+
+ * EO*Qualifier.m: added EOKeyValueArchiving to EOQualifier classes
+
+ * NSObject+EOQualifierOps.m: fixed gcc 4.0 warnings
+
2005-08-04 Helge Hess <helge.hess@opengroupware.org>
* EOKeyValueArchiver.m: process class names containing a dot by
return [aq autorelease];
}
+/* key/value archiving */
+
+- (id)initWithKeyValueUnarchiver:(EOKeyValueUnarchiver *)_unarchiver {
+ if ((self = [super initWithKeyValueUnarchiver:_unarchiver]) != nil) {
+ self->qualifiers = [[_unarchiver decodeObjectForKey:@"qualifiers"] copy];
+ self->count = [self->qualifiers count];
+ }
+ return self;
+}
+- (void)encodeWithKeyValueArchiver:(EOKeyValueArchiver *)_archiver {
+ [super encodeWithKeyValueArchiver:_archiver];
+ [_archiver encodeObject:[self qualifiers] forKey:@"qualifiers"];
+}
+
/* description */
- (NSString *)description {
return [fs autorelease];
}
+/* key/value archiving */
+
+- (id)initWithKeyValueUnarchiver:(EOKeyValueUnarchiver *)_unarchiver {
+ if ((self = [super init]) != nil) {
+ self->entityName = [[_unarchiver decodeObjectForKey:@"entityName"] copy];
+ self->qualifier = [[_unarchiver decodeObjectForKey:@"qualifier"] retain];
+ self->hints = [[_unarchiver decodeObjectForKey:@"hints"] copy];
+ self->sortOrderings =
+ [[_unarchiver decodeObjectForKey:@"sortOrderings"] retain];
+
+ self->fetchLimit = [_unarchiver decodeIntForKey:@"fetchLimit"];
+
+ self->fsFlags.usesDistinct =
+ [_unarchiver decodeBoolForKey:@"usesDistinct"] ? 1 : 0;
+ self->fsFlags.locksObjects =
+ [_unarchiver decodeBoolForKey:@"locksObjects"] ? 1 : 0;
+ self->fsFlags.deep =
+ [_unarchiver decodeBoolForKey:@"deep"] ? 1 : 0;
+ }
+ return self;
+}
+- (void)encodeWithKeyValueArchiver:(EOKeyValueArchiver *)_archiver {
+ [_archiver encodeObject:[self entityName] forKey:@"entityName"];
+ [_archiver encodeObject:[self qualifier] forKey:@"qualifier"];
+ [_archiver encodeObject:[self hints] forKey:@"hints"];
+ [_archiver encodeObject:[self sortOrderings] forKey:@"sortOrderings"];
+
+ [_archiver encodeInt:[self fetchLimit] forKey:@"fetchLimit"];
+
+ [_archiver encodeBool:self->fsFlags.usesDistinct forKey:@"usesDistinct"];
+ [_archiver encodeBool:self->fsFlags.locksObjects forKey:@"locksObjects"];
+ [_archiver encodeBool:self->fsFlags.deep forKey:@"deep"];
+}
+
/* description */
- (NSString *)description {
return [kcq autorelease];
}
+/* key/value archiving */
+
+- (id)initWithKeyValueUnarchiver:(EOKeyValueUnarchiver *)_unarchiver {
+ if ((self = [super initWithKeyValueUnarchiver:_unarchiver]) != nil) {
+ NSString *s;
+
+ self->leftKey = [[_unarchiver decodeObjectForKey:@"leftKey"] retain];
+ self->rightKey = [[_unarchiver decodeObjectForKey:@"rightKey"] retain];
+
+ if ((s = [_unarchiver decodeObjectForKey:@"selectorName"]) != nil) {
+ if (![s hasSuffix:@":"]) s = [s stringByAppendingString:@":"];
+ self->operator = NSSelectorFromString(s);
+ }
+ else if ((s = [_unarchiver decodeObjectForKey:@"selector"]) != nil)
+ self->operator = NSSelectorFromString(s);
+ }
+ return self;
+}
+- (void)encodeWithKeyValueArchiver:(EOKeyValueArchiver *)_archiver {
+ NSString *s;
+
+ [super encodeWithKeyValueArchiver:_archiver];
+
+ [_archiver encodeObject:[self leftKey] forKey:@"leftKey"];
+ [_archiver encodeObject:[self rightKey] forKey:@"rightKey"];
+
+ s = NSStringFromSelector([self selector]);
+ if ([s hasSuffix:@":"]) s = [s substringToIndex:[s length] - 1];
+ [_archiver encodeObject:s forKey:@"selectorName"];
+}
+
/* description */
- (NSString *)description {
return [kvq autorelease];
}
+/* key/value archiving */
+
+- (id)initWithKeyValueUnarchiver:(EOKeyValueUnarchiver *)_unarchiver {
+ if ((self = [super initWithKeyValueUnarchiver:_unarchiver]) != nil) {
+ NSString *s;
+
+ self->key = [[_unarchiver decodeObjectForKey:@"key"] copy];
+ self->value = [[_unarchiver decodeObjectForKey:@"value"] retain];
+
+ if ((s = [_unarchiver decodeObjectForKey:@"selectorName"]) != nil) {
+ if (![s hasSuffix:@":"]) s = [s stringByAppendingString:@":"];
+ self->operator = NSSelectorFromString(s);
+ }
+ else if ((s = [_unarchiver decodeObjectForKey:@"selector"]) != nil)
+ self->operator = NSSelectorFromString(s);
+ }
+ return self;
+}
+- (void)encodeWithKeyValueArchiver:(EOKeyValueArchiver *)_archiver {
+ NSString *s;
+
+ [super encodeWithKeyValueArchiver:_archiver];
+
+ [_archiver encodeObject:[self key] forKey:@"key"];
+ [_archiver encodeObject:[self value] forKey:@"value"];
+
+ s = NSStringFromSelector([self selector]);
+ if ([s hasSuffix:@":"]) s = [s substringToIndex:[s length] - 1];
+ [_archiver encodeObject:s forKey:@"selectorName"];
+}
+
/* description */
- (NSString *)description {
return [nq autorelease];
}
+/* key/value archiving */
+
+- (id)initWithKeyValueUnarchiver:(EOKeyValueUnarchiver *)_unarchiver {
+ if ((self = [super initWithKeyValueUnarchiver:_unarchiver]) != nil) {
+ self->qualifier = [[_unarchiver decodeObjectForKey:@"qualifier"] copy];
+ }
+ return self;
+}
+- (void)encodeWithKeyValueArchiver:(EOKeyValueArchiver *)_archiver {
+ [super encodeWithKeyValueArchiver:_archiver];
+ [_archiver encodeObject:[self qualifier] forKey:@"qualifier"];
+}
+
/* description */
- (NSString *)description {
return [aq autorelease];
}
+/* key/value archiving */
+
+- (id)initWithKeyValueUnarchiver:(EOKeyValueUnarchiver *)_unarchiver {
+ if ((self = [super initWithKeyValueUnarchiver:_unarchiver]) != nil) {
+ self->qualifiers = [[_unarchiver decodeObjectForKey:@"qualifiers"] copy];
+ self->count = [self->qualifiers count];
+ }
+ return self;
+}
+- (void)encodeWithKeyValueArchiver:(EOKeyValueArchiver *)_archiver {
+ [super encodeWithKeyValueArchiver:_archiver];
+ [_archiver encodeObject:[self qualifiers] forKey:@"qualifiers"];
+}
+
/* description */
- (NSString *)description {
#ifndef __EOQualifier_h__
#define __EOQualifier_h__
-#import <Foundation/NSObject.h>
+#import <Foundation/NSObject.h>
+#include <EOControl/EOKeyValueArchiver.h>
/*
EOQualifier
- (BOOL)evaluateWithObject:(id)_object;
@end
-@interface EOQualifier : NSObject
+@interface EOQualifier : NSObject < EOKeyValueArchiving >
+ (EOQualifier *)qualifierToMatchAnyValue:(NSDictionary *)_values;
+ (EOQualifier *)qualifierToMatchAllValues:(NSDictionary *)_values;
/* variable qualifier content */
-@interface EOQualifierVariable : NSObject < NSCoding >
+@interface EOQualifierVariable : NSObject < NSCoding, EOKeyValueArchiving >
{
NSString *varKey;
}
return evalDebug ? YES : NO;
}
-@end /* EOQualifier */
-
-@implementation EOQualifier(QuickEval)
+/* QuickEval */
- (BOOL)evaluateWithObject:(id)_object inEvalContext:(id)_ctx {
return [(id<EOQualifierEvaluation>)self evaluateWithObject:_object];
}
-@end /* EOQualifier(QuickEval) */
+/* key/value archiving */
+
+- (id)initWithKeyValueUnarchiver:(EOKeyValueUnarchiver *)_unarchiver {
+ return [super init];
+}
+- (void)encodeWithKeyValueArchiver:(EOKeyValueArchiver *)_archiver {
+}
+
+@end /* EOQualifier */
return [self->varKey isEqual:[_obj key]];
}
+/* key/value archiving */
+
+- (id)initWithKeyValueUnarchiver:(EOKeyValueUnarchiver *)_unarchiver {
+ if ((self = [super init]) != nil) {
+ self->varKey = [[_unarchiver decodeObjectForKey:@"key"] copy];
+ }
+ return self;
+}
+- (void)encodeWithKeyValueArchiver:(EOKeyValueArchiver *)_archiver {
+ [_archiver encodeObject:[self key] forKey:@"key"];
+}
+
/* description */
- (NSString *)qualifierDescription {
#import <Foundation/NSObject.h>
#include <EOControl/EOControlDecls.h>
+#include <EOControl/EOKeyValueArchiver.h>
@class NSDictionary, NSString;
EOControl_EXPORT SEL EOCompareCaseInsensitiveDescending;
#endif
-@interface EOSortOrdering : NSObject
+@interface EOSortOrdering : NSObject < EOKeyValueArchiving >
{
NSString *key;
SEL selector;
selector:self->selector];
}
+/* key/value archiving */
+
+- (id)initWithKeyValueUnarchiver:(EOKeyValueUnarchiver *)_unarchiver {
+ if ((self = [super init]) != nil) {
+ self->key = [[_unarchiver decodeObjectForKey:@"key"] copy];
+ self->selector =
+ NSSelectorFromString([_unarchiver decodeObjectForKey:@"selector"]);
+ }
+ return self;
+}
+- (void)encodeWithKeyValueArchiver:(EOKeyValueArchiver *)_archiver {
+ [_archiver encodeObject:[self key] forKey:@"key"];
+ [_archiver encodeObject:NSStringFromSelector([self selector])
+ forKey:@"selector"];
+}
+
/* description */
- (NSString *)description {
@implementation NSString(ImplementedQualifierComparisons)
-- (BOOL)isLike:(id)_pattern {
+- (BOOL)isLike:(NSString *)_pattern {
NSArray *cs;
unsigned count;
#if 0
return NO;
}
-- (BOOL)isCaseInsensitiveLike:(id)_pattern {
+- (BOOL)isCaseInsensitiveLike:(NSString *)_pattern {
return [[self lowercaseString] isLike:[_pattern lowercaseString]];
}
# version file
-SUBMINOR_VERSION:=54
+SUBMINOR_VERSION:=55