nst / nsarray-functional

Objective-C category to add Python-like map, filter and reduce methods to Cocoa NSArray.

This URL has Read+Write access

nsarray-functional / NSString+Cat.h
100644 43 lines (35 sloc) 1.805 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//
// NSString+Cat.h
// Functional
//
// Created by Nicolas Seriot on 08.01.09.
// Copyright 2009 Sen:te. All rights reserved.
//
 
#import <Foundation/Foundation.h>
 
 
@interface NSString (Cat)
 
- (BOOL)isOk;
 
- (BOOL)isLongerThan:(NSUInteger)length;
- (NSString *)arrayWithStringRepresentationsForBool:(BOOL)aBool string:(NSString *)aString charPtr:(char *)aCharPtr aFloat:(float)aFloat aDouble:(double)aDouble ;
 
- (NSString *)stringRepresentationForBool:(BOOL)aBool;
- (NSString *)stringRepresentationForInt:(int)anInt;
- (NSString *)stringRepresentationForFloat:(float)aFloat;
- (NSString *)stringRepresentationForDouble:(double)aDouble;
- (NSString *)stringRepresentationForSelector:(SEL)aSelector;
- (NSString *)stringRepresentationForChar:(char)aChar;
- (NSString *)stringRepresentationForShort:(short)aShort;
- (NSString *)stringRepresentationForCppBool:(bool)aCppBool;
- (NSString *)stringRepresentationForUChar:(unsigned char)aUChar;
- (NSString *)stringRepresentationForUShort:(unsigned short)aUShort;
- (NSString *)stringRepresentationForLong:(long)aLong;
- (NSString *)stringRepresentationForLongLong:(long long)aLongLong;
- (NSString *)stringRepresentationForUInt:(unsigned int)aUInt;
- (NSString *)stringRepresentationForULong:(unsigned long)aULong;
- (NSString *)stringRepresentationForULongLong:(unsigned long long)aULongLong;
- (NSString *)stringRepresentationForCharPtr:(long long)aCharPtr;
- (NSString *)stringRepresentationForObject:(id)anObject;
- (NSString *)stringRepresentationForClass:(Class)aClass;
- (NSString *)stringRepresentationForNSInteger:(NSInteger)aNSInteger;
- (NSString *)stringRepresentationForNSUInteger:(NSUInteger)aNSUInteger;
- (NSString *)stringRepresentationForCGFloat:(CGFloat)aCGFloat;
- (NSString *)stringRepresentationForPointer:(void *)aPointer;
 
@end