Monotone-Parent: 2b7803f8e993e96ff4490197722ef0a2a5faad70
Monotone-Revision: 7d9ee580367f7631b0793eae0e55ae9255d331bc Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-04-19T02:49:25maint-2.0.2
parent
dbd99fac84
commit
5753cf3384
|
@ -106,6 +106,9 @@
|
|||
|
||||
- (void) addType: (NSString *) aType;
|
||||
|
||||
- (NSArray *) orderOfAttributeKeys;
|
||||
- (NSArray *) orderOfValueKeys;
|
||||
|
||||
- (NSString *) versitString;
|
||||
|
||||
- (CardGroup *) searchParentOfClass: (Class) parentClass;
|
||||
|
|
|
@ -471,6 +471,16 @@ _orderedValuesAreVoid (NSArray *orderedValues)
|
|||
return result;
|
||||
}
|
||||
|
||||
- (NSArray *) orderOfAttributeKeys
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (NSArray *) orderOfValueKeys
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (NSString *) versitString
|
||||
{
|
||||
NSString *string;
|
||||
|
|
|
@ -78,13 +78,17 @@
|
|||
if ([attributes count])
|
||||
{
|
||||
[rendering appendString: @";"];
|
||||
[attributes versitRenderInString: rendering asAttributes: YES];
|
||||
[attributes versitRenderInString: rendering
|
||||
withKeyOrdering: [anElement orderOfAttributeKeys]
|
||||
asAttributes: YES];
|
||||
}
|
||||
|
||||
/* values */
|
||||
values = [anElement values];
|
||||
[rendering appendString: @":"];
|
||||
[values versitRenderInString: rendering asAttributes: NO];
|
||||
[values versitRenderInString: rendering
|
||||
withKeyOrdering: [anElement orderOfValueKeys]
|
||||
asAttributes: NO];
|
||||
|
||||
if ([rendering length] > 0)
|
||||
[rendering appendString: @"\r\n"];
|
||||
|
|
|
@ -1,3 +1,15 @@
|
|||
2012-04-18 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* NSDictionary+NGCards.m
|
||||
(-versitRenderInString:withKeyOrdering:asAttributes:): now takes
|
||||
an "ordering" parameter resulting from the methods below and
|
||||
reorder the dictionary keys as specified.
|
||||
|
||||
* CardElement.m (-orderOfAttributeKeys, -orderOfValueKeys): new
|
||||
methods that return an ordered array of value keys, used for
|
||||
rendering data in a way that is acceptable to certain picky
|
||||
clients.
|
||||
|
||||
2012-04-11 Francis Lachapelle <flachapelle@inverse.ca>
|
||||
|
||||
* iCalWeeklyRecurrenceCalculator.m
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
- (id) objectForCaseInsensitiveKey: (NSString *) aKey;
|
||||
|
||||
- (void) versitRenderInString: (NSMutableString *) aString
|
||||
withKeyOrdering: (NSArray *) ordering
|
||||
asAttributes: (BOOL) asAttribute; /* handling of ":" */
|
||||
|
||||
@end
|
||||
|
|
|
@ -123,15 +123,37 @@
|
|||
}
|
||||
|
||||
- (void) versitRenderInString: (NSMutableString *) aString
|
||||
withKeyOrdering: (NSArray *) ordering
|
||||
asAttributes: (BOOL) asAttributes
|
||||
{
|
||||
NSArray *keys;
|
||||
NSUInteger count, max, rendered = 0;
|
||||
NSMutableArray *keys;
|
||||
NSUInteger count, max, rendered = 0, keyIndex, newKeyIndex;
|
||||
NSArray *orderedValues;
|
||||
NSString *key;
|
||||
NSMutableString *substring;
|
||||
|
||||
keys = [self allKeys];
|
||||
keys = [[self allKeys] mutableCopy];
|
||||
[keys autorelease];
|
||||
|
||||
/* We reorder the fields based on the "ordering" array, by first placing
|
||||
those that are specified and then the rest of them. */
|
||||
newKeyIndex = 0;
|
||||
max = [ordering count];
|
||||
for (count = 0; count < max; count++)
|
||||
{
|
||||
key = [ordering objectAtIndex: count];
|
||||
keyIndex = [keys indexOfObject: key];
|
||||
if (keyIndex != NSNotFound)
|
||||
{
|
||||
if (keyIndex != newKeyIndex)
|
||||
{
|
||||
[keys removeObjectAtIndex: keyIndex];
|
||||
[keys insertObject: key atIndex: newKeyIndex];
|
||||
}
|
||||
newKeyIndex++;
|
||||
}
|
||||
}
|
||||
|
||||
max = [keys count];
|
||||
for (count = 0; count < max; count++)
|
||||
{
|
||||
|
|
|
@ -59,6 +59,7 @@
|
|||
rule = [rules objectAtIndex:i];
|
||||
ruleString = [NSMutableString new];
|
||||
[[rule values] versitRenderInString: ruleString
|
||||
withKeyOrdering: [rule orderOfValueKeys]
|
||||
asAttributes: NO];
|
||||
[ma addObject: ruleString];
|
||||
[ruleString release];
|
||||
|
|
Loading…
Reference in New Issue