2006-12-14 21:16:00 +01:00
|
|
|
/* NSArray+Utilities.h - this file is part of SOGo
|
|
|
|
*
|
2008-09-27 03:13:41 +02:00
|
|
|
* Copyright (C) 2006 Inverse inc.
|
2006-12-14 21:16:00 +01:00
|
|
|
*
|
|
|
|
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
|
|
|
*
|
|
|
|
* This file is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
* any later version.
|
|
|
|
*
|
|
|
|
* This file is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; see the file COPYING. If not, write to
|
|
|
|
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef NSARRAY_UTILITIES_H
|
|
|
|
#define NSARRAY_UTILITIES_H
|
|
|
|
|
|
|
|
#import <Foundation/NSArray.h>
|
|
|
|
|
|
|
|
@class NSString;
|
|
|
|
|
|
|
|
@interface NSArray (SOGoArrayUtilities)
|
|
|
|
|
2008-06-13 21:55:59 +02:00
|
|
|
- (id *) asPointersOfObjects;
|
|
|
|
|
2007-05-25 19:30:24 +02:00
|
|
|
- (NSString *) jsonRepresentation;
|
|
|
|
|
2006-12-14 21:16:00 +01:00
|
|
|
- (NSArray *) stringsWithFormat: (NSString *) format;
|
2007-08-15 21:50:20 +02:00
|
|
|
- (NSArray *) keysWithFormat: (NSString *) format;
|
2008-10-23 17:35:20 +02:00
|
|
|
- (NSArray *) objectsForKey: (NSString *) key
|
|
|
|
notFoundMarker: (id) marker;
|
2007-08-15 21:50:20 +02:00
|
|
|
- (NSArray *) flattenedArray;
|
2006-12-14 21:16:00 +01:00
|
|
|
|
2008-02-22 22:21:24 +01:00
|
|
|
- (NSArray *) uniqueObjects;
|
|
|
|
|
2007-06-01 06:13:22 +02:00
|
|
|
- (BOOL) containsCaseInsensitiveString: (NSString *) match;
|
|
|
|
|
2007-02-08 17:30:07 +01:00
|
|
|
#ifdef GNUSTEP_BASE_LIBRARY
|
|
|
|
- (void) makeObjectsPerform: (SEL) selector
|
|
|
|
withObject: (id) object1
|
|
|
|
withObject: (id) object2;
|
|
|
|
#endif
|
|
|
|
|
2006-12-14 21:16:00 +01:00
|
|
|
@end
|
|
|
|
|
2007-05-19 02:41:01 +02:00
|
|
|
@interface NSMutableArray (SOGoArrayUtilities)
|
|
|
|
|
2009-06-10 22:54:02 +02:00
|
|
|
- (void) addNonNSObject: (void *) objectPtr
|
|
|
|
withSize: (size_t) objectSize
|
|
|
|
copy: (BOOL) doCopy;
|
|
|
|
- (void) freeNonNSObjects;
|
|
|
|
|
2007-05-19 02:41:01 +02:00
|
|
|
- (void) addObjectUniquely: (id) object;
|
|
|
|
|
2008-08-22 01:35:34 +02:00
|
|
|
- (BOOL) hasRangeIntersection: (NSRange) testRange;
|
2007-05-30 22:03:19 +02:00
|
|
|
|
2007-05-19 02:41:01 +02:00
|
|
|
@end
|
|
|
|
|
2006-12-14 21:16:00 +01:00
|
|
|
#endif /* NSARRAY_UTILITIES_H */
|