ObjFW
Loading...
Searching...
No Matches
Classes | Typedefs | Enumerations
OFArray.h File Reference
#include <stdarg.h>
import "OFObject.h"
import "OFCollection.h"
import "OFEnumerator.h"
import "OFJSONRepresentation.h"
import "OFMessagePackRepresentation.h"
import "OFMutableArray.h"

Go to the source code of this file.

Classes

class  OFArray
 An abstract class for storing objects in an array. More...
 

Typedefs

typedef void(^ OFArrayEnumerationBlock) (id object, size_t index, bool *stop)
 A block for enumerating an OFArray.
 
typedef bool(^ OFArrayFilterBlock) (id object, size_t index)
 A block for filtering an OFArray.
 
typedef id(^ OFArrayMapBlock) (id object, size_t index)
 A block for mapping objects to objects in an OFArray.
 
typedef id(^ OFArrayFoldBlock) (id left, id right)
 A block for folding an OFArray.
 

Enumerations

enum  OFArrayJoinOptions { OFArraySkipEmptyComponents = 1 }
 Options for joining the objects of an array. More...
 
enum  OFArraySortOptions { OFArraySortDescending = 1 }
 Options for sorting an array. More...
 

Typedef Documentation

◆ OFArrayEnumerationBlock

typedef void(^ OFArrayEnumerationBlock) (id object, size_t index, bool *stop)

A block for enumerating an OFArray.

Parameters
objectThe current object
indexThe index of the current object
stopA pointer to a variable that can be set to true to stop the enumeration

◆ OFArrayFilterBlock

typedef bool(^ OFArrayFilterBlock) (id object, size_t index)

A block for filtering an OFArray.

Parameters
objectThe object to inspect
indexThe index of the object to inspect
Returns
Whether the object should be in the filtered array

◆ OFArrayFoldBlock

typedef id(^ OFArrayFoldBlock) (id left, id right)

A block for folding an OFArray.

Parameters
leftThe object to which the object has been folded so far
rightThe object that should be added to the left object
Returns
The left and right side folded into one object

◆ OFArrayMapBlock

typedef id(^ OFArrayMapBlock) (id object, size_t index)

A block for mapping objects to objects in an OFArray.

Parameters
objectThe object to map
indexThe index of the object to map
Returns
The object to map to

Enumeration Type Documentation

◆ OFArrayJoinOptions

Options for joining the objects of an array.

This is a bit mask.

Enumerator
OFArraySkipEmptyComponents 

Skip empty components

◆ OFArraySortOptions

Options for sorting an array.

This is a bit mask.

Enumerator
OFArraySortDescending 

Sort the array descending