CPRange


Function Summary
CPRangeCPMakeRange(location, length)
          Makes a CPRange.
CPRangeCPCopyRange(aRange)
          Makes a copy of a CPRange.
CPRangeCPMakeRangeCopy(aRange)
          Makes a copy of a CPRange.
CPRangeCPEmptyRange(aRange)
          Sets a range's length to 0.
intCPMaxRange(aRange)
          Finds the range maximum.
BOOLCPLocationInRange(aLocation, aRange)
          Determines if a number is within a specified CPRange.
CPRangeCPUnionRange(lhsRange, rhsRange)
          Creates a new range with the minimum location and a length that extends to the maximum length.
CPRangeCPIntersectionRange(lhsRange, rhsRange)
          Creates a new CPRange that spans the common range of two CPRanges.
CPStringCPStringFromRange(aRange)
          Returns a string describing a range.
CPRangeCPRangeFromString(aString)
          Creates a CPRange from the contents of a CPString.

Function Detail

CPMakeRange

function CPMakeRange(location, length)
Makes a CPRange.
Arguments
location - the location for new range
length - the length of the new range
Returns:
the new range object

CPCopyRange

function CPCopyRange(aRange)
Makes a copy of a CPRange.
Arguments
aRange - the CPRange to copy
Returns:
the copy of the range

CPMakeRangeCopy

function CPMakeRangeCopy(aRange)
Makes a copy of a CPRange.
Arguments
aRange - the CPRange to copy
Returns:
the copy of the range

CPEmptyRange

function CPEmptyRange(aRange)
Sets a range's length to 0.
Arguments
aRange - the range to empty
Returns:
the empty range (same as the argument)

CPMaxRange

function CPMaxRange(aRange)
Finds the range maximum. (location + length)
Arguments
aRange - the range to calculate a maximum from
Returns:
the range maximum

CPLocationInRange

function CPLocationInRange(aLocation, aRange)
Determines if a number is within a specified CPRange.
Arguments
aLocation - the number to check
aRange - the CPRange to check within
Returns:
YES if aLocation/code> is within the range

CPUnionRange

function CPUnionRange(lhsRange, rhsRange)
Creates a new range with the minimum location and a length that extends to the maximum length.
Arguments
lhsRange - the first CPRange
rhsRange - the second CPRange
Returns:
the new CPRange

CPIntersectionRange

function CPIntersectionRange(lhsRange, rhsRange)
Creates a new CPRange that spans the common range of two CPRanges
Arguments
lhsRange - the first CPRange
rhsRange - the second CPRange
Returns:
the new CPRange

CPStringFromRange

function CPStringFromRange(aRange)
Returns a string describing a range.
Arguments
aRange - the range to describe
Returns:
a describing string

CPRangeFromString

function CPRangeFromString(aString)
Creates a CPRange from the contents of a CPString.
Arguments
aString - the string to create a CPRange from
Returns:
the new range