PageRenderTime 4ms CodeModel.GetById 2ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/BlocksKit/NSMutableDictionary+BlocksKit.h

http://github.com/zwaldowski/BlocksKit
C++ Header | 46 lines | 6 code | 6 blank | 34 comment | 0 complexity | ca4b8f6fa70f6d4a5a2935a666d2ba74 MD5 | raw file
 1//
 2//  NSMutableDictionary+BlocksKit.h
 3//  %PROJECT
 4//
 5
 6#import "BKGlobals.h"
 7
 8/** Block extensions for NSMutableDictionary.
 9 
10 These utilities expound upon the BlocksKit additions
11 to the immutable superclass by allowing certain utilities
12 to work on an instance of the mutable class, saving memory
13 by not creating an immutable copy of the results.
14 
15 Includes code by the following:
16 
17 - Martin Sch?rrer.  <https://github.com/MSch>.	 2011. MIT.
18 - Zach Waldowski. <https://github.com/zwaldowski>. 2011. MIT.
19 
20 @see NSDictionary(BlocksKit)
21 */
22@interface NSMutableDictionary (BlocksKit)
23
24/** Filters a mutable dictionary to the key/value pairs matching the block.
25 
26 @param block A BOOL-returning code block for a key/value pair.
27 @see reject:
28 */
29- (void)performSelect:(BKKeyValueValidationBlock)block;
30
31/** Filters a mutable dictionary to the key/value pairs not matching the block,
32 the logical inverse to select:.
33 
34 @param block A BOOL-returning code block for a key/value pair.
35 @see select:
36 */
37- (void)performReject:(BKKeyValueValidationBlock)block;
38
39/** Transform each value of the dictionary to a new value, as returned by the
40 block.
41 
42 @param block A block that returns a new value for a given key/value pair.
43 */
44- (void)performMap:(BKKeyValueTransformBlock)block;
45
46@end