self->key = WOExtGetProperty(_config, @"key");
self->value = WOExtGetProperty(_config, @"value");
self->negate = WOExtGetProperty(_config, @"negate");
- self->template = RETAIN(_c);
+ self->template = [_c retain];
}
return self;
}
-#if !LIB_FOUNDATION_BOEHM_GC
- (void)dealloc {
- RELEASE(self->template);
- RELEASE(self->value);
- RELEASE(self->key);
+ [self->template release];
+ [self->value release];
+ [self->key release];
[super dealloc];
}
-#endif
-// accessors
+/* accessors */
- (WOElement *)template {
return self->template;
}
-// state
+/* state */
static inline BOOL _doShow(WOKeyValueConditional *self, WOContext *_ctx) {
WOComponent *c = [_ctx component];
return doNegate ? !doShow : doShow;
}
-// ******************** responder ********************
+/* handling requests */
-- (void)takeValuesFromRequest:(WORequest *)_request
- inContext:(WOContext *)_ctx
-{
+- (void)takeValuesFromRequest:(WORequest *)_rq inContext:(WOContext *)_ctx {
if (_doShow(self, _ctx)) {
[_ctx appendElementIDComponent:@"1"];
- [self->template takeValuesFromRequest:_request inContext:_ctx];
+ [self->template takeValuesFromRequest:_rq inContext:_ctx];
[_ctx deleteLastElementIDComponent];
}
#if 0
#endif
}
-- (id)invokeActionForRequest:(WORequest *)_request inContext:(WOContext *)_ctx {
+- (id)invokeActionForRequest:(WORequest *)_rq inContext:(WOContext *)_ctx {
NSString *state;
state = [[_ctx currentElementID] stringValue];
id result;
[_ctx appendElementIDComponent:state];
- result = [self->template invokeActionForRequest:_request inContext:_ctx];
+ result = [self->template invokeActionForRequest:_rq inContext:_ctx];
[_ctx deleteLastElementIDComponent];
return result;
/* description */
- (NSString *)associationDescription {
- NSMutableString *str = [[NSMutableString alloc] init];
+ NSMutableString *str;
+ str = [NSMutableString stringWithCapacity:64];
if (self->key) [str appendFormat:@" key=%@", self->key];
if (self->value) [str appendFormat:@" value=%@", self->value];
if (self->negate) [str appendFormat:@" negate=%@", self->negate];
if (self->template) [str appendFormat:@" template=%@", self->template];
-
- return AUTORELEASE(str);
+ return str;
}
@end /* WOKeyValueConditional */