mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-05 20:10:33 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user