mirror of
https://github.com/gnustep/libs-gsweb.git
synced 2025-02-22 11:11:21 +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
aeab0d5b58
commit
3816157075
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>
|
2008-03-11 David Wetzel <dave@turbocat.de>
|
||||||
GSWAdaptors/Apache2/mod_gsw.c
|
GSWAdaptors/Apache2/mod_gsw.c
|
||||||
* fixed http status bug
|
* 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
|
//NDFN
|
||||||
+(GSWAssociation*)associationFromString:(NSString*)string;
|
+(GSWAssociation*)associationFromString:(NSString*)string;
|
||||||
|
|
||||||
/*
|
|
||||||
//====================================================================
|
|
||||||
@interface GSWAssociation (GSWAssociationOldFn)
|
|
||||||
|
|
||||||
-(void)setValue:(id)value;
|
// returns the binding String as in the wod.
|
||||||
-(id)value;
|
- (NSString*) bindingInComponent:(GSWComponent*) component;
|
||||||
|
|
||||||
@end
|
|
||||||
*/
|
|
||||||
//====================================================================
|
|
||||||
|
|
||||||
-(BOOL)isImplementedForComponent:(NSObject*)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
|
-(BOOL)isImplementedForComponent:(NSObject*)component
|
||||||
{
|
{
|
||||||
|
|
|
@ -32,6 +32,9 @@
|
||||||
RCS_ID("$Id$")
|
RCS_ID("$Id$")
|
||||||
|
|
||||||
#include "GSWeb.h"
|
#include "GSWeb.h"
|
||||||
|
#include "GSWPrivate.h"
|
||||||
|
|
||||||
|
#define DOTSTRING @"."
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@implementation GSWBindingNameAssociation
|
@implementation GSWBindingNameAssociation
|
||||||
|
@ -40,22 +43,31 @@ RCS_ID("$Id$")
|
||||||
-(id)initWithKeyPath:(NSString*)aKeyPath
|
-(id)initWithKeyPath:(NSString*)aKeyPath
|
||||||
{
|
{
|
||||||
if ((self=[super init]))
|
if ((self=[super init]))
|
||||||
{
|
{
|
||||||
NSArray* keys=nil;
|
NSArray* keys=nil;
|
||||||
int keyCount = 0;
|
NSRange dotRange;
|
||||||
|
|
||||||
if ([aKeyPath hasPrefix:@"^"]) {
|
if ([aKeyPath hasPrefix:@"^"]) {
|
||||||
aKeyPath = [aKeyPath substringFromIndex:1];
|
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:@"."]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
// 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;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -212,7 +224,7 @@ RCS_ID("$Id$")
|
||||||
{
|
{
|
||||||
return @"<none>";
|
return @"<none>";
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString*) bindingInComponent:(GSWComponent*) component
|
- (NSString*) bindingInComponent:(GSWComponent*) component
|
||||||
{
|
{
|
||||||
GSWComponent * parentcomp = [component parent];
|
GSWComponent * parentcomp = [component parent];
|
||||||
|
|
|
@ -66,6 +66,9 @@ static inline void GSWeb_appendStringWithImpPtr(NSMutableString* object,IMP* imp
|
||||||
|
|
||||||
- (BOOL)_hasBindingInParent:(GSWComponent*) parent;
|
- (BOOL)_hasBindingInParent:(GSWComponent*) parent;
|
||||||
|
|
||||||
|
- (void) _setValueNoValidation:(id) aValue
|
||||||
|
inComponent:(GSWComponent*) component;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface GSWInput (PrivateDeclarations)
|
@interface GSWInput (PrivateDeclarations)
|
||||||
|
|
Loading…
Reference in a new issue