mirror of
https://github.com/gnustep/libs-gsweb.git
synced 2025-02-22 03:01:27 +00:00
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:
parent
954dfae5e0
commit
3fd738d065
5 changed files with 50 additions and 24 deletions
10
ChangeLog
10
ChangeLog
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue