HexFiend: HFByteRangeAttributeArray Class Reference

HexFiend

Instance Methods | List of all members
HFByteRangeAttributeArray Class Reference

A class that represents sets of attributes, attached to ranges of bytes.

Inheritance diagram for HFByteRangeAttributeArray:

## Instance Methods
(NSSet *) | - attributesAtIndex:length:
(NSSet *) | - attributesInRange:
(HFRange) | - rangeOfAttribute:
(void) | - addAttribute:range:
(void) | - removeAttribute:range:
(void) | - removeAttribute:
(void) | - removeAttributes:
(BOOL) | - isEmpty
(NSEnumerator *) | - attributeEnumerator
(void) | - byteRange:wasReplacedByBytesOfLength:
(void) | - transferAttributesFromAttributeArray:range:baseOffset:validator:

## Method Documentation

## § attributesAtIndex:length:()

- (NSSet *) attributesAtIndex: |  | (unsigned long long) | index
length: |  | (unsigned long long *) | length

Returns the set of attributes at the given index, and the length over which those attributes are valid (if not NULL).

## § attributesInRange:()

- (NSSet *) attributesInRange: |  | (HFRange) | range |

Returns the set of attributes within the given range.

## § rangeOfAttribute:()

- (HFRange) rangeOfAttribute: |  | (NSString *) | attribute |

Returns the first range of a given attribute. If it is not present, returns {ULLONG_MAX, ULLONG_MAX}

## § addAttribute:range:()

- (void) addAttribute: |  | (NSString *) | attributeName
range: |  | (HFRange) | range

Adds a given attribute for a given range.

## § removeAttribute:range:()

- (void) removeAttribute: |  | (NSString *) | attributeName
range: |  | (HFRange) | range

Removes the given attribute within the given range.

## § removeAttribute:()

- (void) removeAttribute: |  | (NSString *) | attributeName |

Removes the given attribute entirely.

## § removeAttributes:()

- (void) removeAttributes: |  | (NSSet *) | attributeName |

Removes the given attributes entirely.

## § isEmpty()

- (BOOL) isEmpty |  |  |

Returns whether the receiver is empty. This should be a count instead.

## § attributeEnumerator()

- (NSEnumerator *) attributeEnumerator |  |  |

Returns an NSEnumerator of the attributes. The attributes are returned in order, but there is no way to get the range of each attribute.

## § byteRange:wasReplacedByBytesOfLength:()

- (void) byteRange: |  | (HFRange) | srcRange
wasReplacedByBytesOfLength: |  | (unsigned long long) | replacementLength

Called from HFByteArray to indicate when the bytes have changed, and the attributes need to be fixed up.

## § transferAttributesFromAttributeArray:range:baseOffset:validator:()

- (void) transferAttributesFromAttributeArray: |  | (HFByteRangeAttributeArray *) | array
range: |  | (HFRange) | range
baseOffset: |  | (unsigned long long) | baseOffset
validator: |  | (BOOL(^)(NSString *)) | allowTransfer

Transfer attributes in the given range from array, adding baseOffset to each attribute range. range is interpreted as a range in array. If validator is not NULL, then it is called for each attribute; a YES return allows it to be added and a NO return prevents it.

The documentation for this class was generated from the following file:

- HFByteRangeAttributeArray.h