GSWAssociation.h/m

+ bindingInComponent

GSWPrivate.h
+ _setValueNoValidation: inComponent: 

GSWBindingNameAssociation.m
* re-wrote initWithKeyPath:


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@26330 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Dave Wetzel 2008-03-17 11:48:57 +00:00
parent aeab0d5b58
commit 3816157075
5 changed files with 50 additions and 24 deletions

View file

@ -1,3 +1,13 @@
2008-03-17 David Wetzel <dave@turbocat.de>
GSWeb.framework/GSWAssociation.h/m
+ bindingInComponent
GSWeb.framework/GSWPrivate.h
+ _setValueNoValidation: inComponent:
GSWeb.framework/GSWBindingNameAssociation.m
* re-wrote initWithKeyPath:
2008-03-11 David Wetzel <dave@turbocat.de>
GSWAdaptors/Apache2/mod_gsw.c
* fixed http status bug

View file

@ -103,16 +103,9 @@ NEW FEATURE: negate. add a "!" in front of your key path and the result will be
//NDFN
+(GSWAssociation*)associationFromString:(NSString*)string;
/*
//====================================================================
@interface GSWAssociation (GSWAssociationOldFn)
-(void)setValue:(id)value;
-(id)value;
@end
*/
//====================================================================
// returns the binding String as in the wod.
- (NSString*) bindingInComponent:(GSWComponent*) component;
-(BOOL)isImplementedForComponent:(NSObject*)component;

View file

@ -496,6 +496,14 @@ static Class NSStringClass = Nil;
*/
//====================================================================
// returns the binding String as in the wod.
// override in subclasses
- (NSString*) bindingInComponent:(GSWComponent*) component
{
return nil;
}
//--------------------------------------------------------------------
-(BOOL)isImplementedForComponent:(NSObject*)component
{

View file

@ -32,6 +32,9 @@
RCS_ID("$Id$")
#include "GSWeb.h"
#include "GSWPrivate.h"
#define DOTSTRING @"."
//====================================================================
@implementation GSWBindingNameAssociation
@ -40,22 +43,31 @@ RCS_ID("$Id$")
-(id)initWithKeyPath:(NSString*)aKeyPath
{
if ((self=[super init]))
{
NSArray* keys=nil;
int keyCount = 0;
if ([aKeyPath hasPrefix:@"^"]) {
aKeyPath = [aKeyPath substringFromIndex:1];
}
keys=[aKeyPath componentsSeparatedByString:@"."];
ASSIGN(_parentBindingName,[[keys objectAtIndex:0] stringByDeletingPrefix:@"^"]);
keyCount = [keys count];
if (keyCount > 1) {
ASSIGN(_keyPath,[[keys subarrayWithRange:NSMakeRange(1,keyCount-1)] componentsJoinedByString:@"."]);
}
{
NSArray* keys=nil;
NSRange dotRange;
if ([aKeyPath hasPrefix:@"^"]) {
aKeyPath = [aKeyPath substringFromIndex:1];
}
// TODO: check if ~ was used in here in WO 4.x
keys=[aKeyPath componentsSeparatedByString:@"."];
dotRange = [aKeyPath rangeOfString:DOTSTRING];
if (dotRange.length) {
ASSIGN(_parentBindingName, [aKeyPath substringToIndex:dotRange.location]);
// it makes no sense to try empty strings
if ([aKeyPath length] > (dotRange.length + dotRange.location)) {
ASSIGN(_keyPath,[aKeyPath substringFromIndex:dotRange.location+1]);
}
} else {
// no "." in the string use it as _parentBindingName
ASSIGN(_parentBindingName, aKeyPath);
}
}
return self;
}
@ -212,7 +224,7 @@ RCS_ID("$Id$")
{
return @"<none>";
}
- (NSString*) bindingInComponent:(GSWComponent*) component
{
GSWComponent * parentcomp = [component parent];

View file

@ -66,6 +66,9 @@ static inline void GSWeb_appendStringWithImpPtr(NSMutableString* object,IMP* imp
- (BOOL)_hasBindingInParent:(GSWComponent*) parent;
- (void) _setValueNoValidation:(id) aValue
inComponent:(GSWComponent*) component;
@end
@interface GSWInput (PrivateDeclarations)