/BlocksKit/NSMutableIndexSet+BlocksKit.h

http://github.com/zwaldowski/BlocksKit · C++ Header · 46 lines · 6 code · 7 blank · 33 comment · 0 complexity · dc36a55f1d7e506594d9cf5f1dd10fae MD5 · raw file

  1. //
  2. // NSMutableIndexSet+BlocksKit.h
  3. // %PROJECT
  4. //
  5. #import "BKGlobals.h"
  6. /** Block extensions for NSMutableIndexSet.
  7. These utilities expound upon the BlocksKit additions
  8. to the immutable superclass by allowing certain utilities
  9. to work on an instance of the mutable class, saving memory
  10. by not creating an immutable copy of the results.
  11. Includes code by the following:
  12. - Zach Waldowski. <https://github.com/zwaldowski>. 2011. MIT.
  13. @see NSIndexSet(BlocksKit)
  14. */
  15. @interface NSMutableIndexSet (BlocksKit)
  16. /** Filters a mutable index set to the indexes matching the block.
  17. @param block A single-argument, BOOL-returning code block.
  18. @see reject:
  19. */
  20. - (void)performSelect:(BKIndexValidationBlock)block;
  21. /** Filters a mutable index set to all indexes but the ones matching the block,
  22. the logical inverse to select:.
  23. @param block A single-argument, BOOL-returning code block.
  24. @see select:
  25. */
  26. - (void)performReject:(BKIndexValidationBlock)block;
  27. /** Transform each index of the index set to a new index, as returned by the
  28. block.
  29. @param block A block that returns a new index for a index.
  30. */
  31. - (void)performMap:(BKIndexTransformBlock)block;
  32. @end