Monotone-Parent: 584371c66b4989feaab5012db26f19d8ed7cd7ad

Monotone-Revision: 72a4f60ec4a14476e485da2ce400df860572fa48

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2010-01-05T22:34:35
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2010-01-05 22:34:35 +00:00
parent 7c3b61134a
commit aa7e1d2f5a
15 changed files with 987 additions and 241 deletions
+25 -18
View File
@@ -36,7 +36,7 @@
unsigned int max;
max = [self count];
pointers = NSZoneMalloc (NULL, sizeof(id) * (max + 1));
pointers = NSZoneMalloc (NULL, sizeof (id) * (max + 1));
[self getObjects: pointers];
*(pointers + max) = nil;
@@ -154,6 +154,12 @@
return newArray;
}
- (NSArray *) trimmedComponents
{
return [self resultsOfSelector: @selector (stringByTrimmingSpaces)];
}
#ifdef GNUSTEP_BASE_LIBRARY
- (void) makeObjectsPerform: (SEL) selector
withObject: (id) object1
withObject: (id) object2
@@ -166,6 +172,24 @@
withObject: object1
withObject: object2];
}
#endif
- (NSArray *) resultsOfSelector: (SEL) operation
{
NSMutableArray *results;
int count, max;
id result;
max = [self count];
results = [NSMutableArray arrayWithCapacity: max];
for (count = 0; count < max; count++)
{
result = [[self objectAtIndex: count] performSelector: operation];
[results addObject: result];
}
return results;
}
- (NSString *) jsonRepresentation
{
@@ -204,23 +228,6 @@
return response;
}
- (NSArray *) trimmedComponents
{
NSMutableArray *newComponents;
NSString *currentString;
unsigned int count, max;
max = [self count];
newComponents = [NSMutableArray arrayWithCapacity: max];
for (count = 0; count < max; count++)
{
currentString = [[self objectAtIndex: count] stringByTrimmingSpaces];
[newComponents addObject: currentString];
}
return newComponents;
}
@end
@implementation NSMutableArray (SOGoArrayUtilities)