API  0.9.10
Foundation

Classes

class  CPAttributedString
 A mutable character string with attributes. More...
 
class  CPByteCountFormatter
 
class  CPCache
 A collection-like container with discardable objects. More...
 
class  CPCoder
 Defines methods for use when archiving & restoring (enc/decoding). More...
 
class  CPComparisonPredicate
 CPComparisonPredicate is a subclass of CPPredicate used to compare expressions. More...
 
class  CPCompoundPredicate
 CPCompoundPredicate is a subclass of CPPredicate used to represent logical “gate” operations (AND/OR/NOT) and comparison operations. More...
 
class  CPCountedSet
 An mutable collection which may contain a specific object numerous times. More...
 
class  CPData
 A Cappuccino wrapper for any data type. More...
 
class  CPDate
 A representation of a single point in time. More...
 
class  CPDateFormatter
 
class  CPDecimalNumber
 Decimal floating point number. More...
 
class  CPDecimalNumberHandler
 Decimal floating point number exception and rounding behavior. This class is mutable. More...
 
class  CPDictionary
 A mutable key-value pair collection. More...
 
class  CPEnumerator
 Defines an interface for enumerators. More...
 
class  CPError
 Used for encapsulating, presenting, and recovery from errors. More...
 
class  CPException
 Used to implement exception handling (creating & raising). More...
 
class  CPFormatter
 CPFormatter is an abstract class that declares an interface for objects that create, interpret, and validate the textual representation of cell contents. The Foundation framework provides two concrete subclasses of CPFormatter to generate these objects: CPNumberFormatter and CPDateFormatter. More...
 
class  CPIndexSet
 A collection of unique integers. More...
 
class  CPInvocation
 An object representation of a message. More...
 
class  CPJSONPConnection
 Allows cross domain connections using JSONP protocol. More...
 
class  CPKeyedArchiver
 Implements keyed archiving of object graphs (e.g. for storing data). More...
 
class  CPKeyedUnarchiver
 Unarchives objects created using CPKeyedArchiver. More...
 
class  CPNotification
 A notification that can be posted to a CPNotificationCenter. More...
 
class  CPNotificationCenter
 Sends messages (CPNotification) between objects. More...
 
class  CPNotificationQueue
 CPNotificationQueue objects act as buffers for notification centers (instances of CPNotificationCenter). More...
 
class  CPNull
 An object representation of nil. More...
 
class  CPNumber
 A bridged object to native Javascript numbers. More...
 
class  CPNumberFormatter
 
protocol  <CPObject>
 The root class from which most classes are subclassed. More...
 
class  CPRunLoop
 The main run loop for the application. More...
 
class  CPSortDescriptor
 Holds attributes necessary to describe how to sort a set of objects. More...
 
class  CPString
 An immutable string (collection of characters). More...
 
class  CPTimer
 A timer object that can send a message after the given time interval. More...
 
class  CPTimeZone
 CPTimeZone is a class to define the behvior of time zone object (like CPDatePicker) More...
 
class  CPUndoManager
 A general mechanism for user action "undo". More...
 
class  CPURLConnection
 Provides loading of a URL request. More...
 
class  CPURLRequest
 Contains data obtained during a request made with CPURLConnection. More...
 
class  CPURLResponse
 Protocol agnostic information about a request to a specific URL. More...
 
class  CPUserDefaults
 
class  CPUserNotification
 The CPUserNotification class is used to configure a notification that is scheduled for display by the UserNotificationCenter class. More...
 
class  CPUserNotificationCenter
 The CPUserNotificationCenter class delivers user notifications to the user from applications or helper applications. More...
 
class  CPValue
 A generic "value". Can be subclassed to hold specific data types. More...
 

Typedefs

typedef CPRange function CPMakeRange(location, length)
 

Functions

function CPDecimalAdd (result, leftOperand, rightOperand, roundingMode, longMode)
 
function CPDecimalCompact (dcm)
 
function CPDecimalCompare (leftOperand, rightOperand)
 
function CPDecimalCopy (dcm)
 
function CPDecimalDivide (result, leftOperand, rightOperand, roundingMode)
 
function CPDecimalIsNotANumber (dcm)
 
function CPDecimalIsOne (dcm)
 
function CPDecimalIsZero (dcm)
 
function CPDecimalMakeNaN ()
 
function CPDecimalMakeOne ()
 
function CPDecimalMakeWithParts (mantissa, exponent)
 
function CPDecimalMakeWithString (string, locale)
 
function CPDecimalMakeZero ()
 
function CPDecimalMultiply (result, leftOperand, rightOperand, roundingMode, powerMode)
 
function CPDecimalMultiplyByPowerOf10 (result, dcm, power, roundingMode)
 
function CPDecimalNormalize (dcm1, dcm2, roundingMode, longMode)
 
function CPDecimalPower (result, dcm, power, roundingMode)
 
function CPDecimalRound (result, dcm, scale, roundingMode)
 
function CPDecimalString (dcm, locale)
 
function CPDecimalSubtract (result, leftOperand, rightOperand, roundingMode)
 
function CPEmptyRange (aRange)
 
function CPEqualRanges (lhsRange, rhsRange)
 
function CPIntersectionRange (lhsRange, rhsRange)
 
function CPLocationInRange (aLocation, aRange)
 
function CPMakeRangeCopy (aRange)
 
function CPMaxRange (aRange)
 
function CPRangeFromString (aString)
 
function CPRangeInRange (lhsRange, rhsRange)
 
function CPStringFromRange (aRange)
 
function CPUnionRange (lhsRange, rhsRange)
 

Variables

var CPBundlesForURLStrings = { }
 Groups information about an application's code & resources. More...
 

Detailed Description

Typedef Documentation

◆ CPMakeRange

typedef CPRange function CPMakeRange(location, length)

Makes a CPRange.

Parameters
locationthe location for new range
lengththe length of the new range CPRange
Returns
CPRange the new range object

Definition at line 37 of file CPRange.j.

Function Documentation

◆ CPDecimalAdd()

function CPDecimalAdd ( result  ,
leftOperand  ,
rightOperand  ,
roundingMode  ,
longMode   
)

Performs the addition of 2 CPDecimal numbers.

Parameters
resultthe CPDecimal object in which to put the result
leftOperandthe left CPDecimal operand
rightOperandthe right CPDecimal operand
roundingModethe rounding mode for the operation
Returns
a CPCalculationError status value.

Definition at line 534 of file CPDecimal.j.

◆ CPDecimalCompact()

function CPDecimalCompact ( dcm  )

Remove trailing and leading zeros from mantissa.

Parameters
dcmthe CPDecimal operand

Definition at line 1462 of file CPDecimal.j.

◆ CPDecimalCompare()

function CPDecimalCompare ( leftOperand  ,
rightOperand   
)

Compare two CPDecimal objects. Order is left to right (i.e. Ascending would mean left is smaller than right operand).

Parameters
leftOperandthe left CPDecimal
rightOperandthe right CPDecimal
Returns
CPOrderedAscending, CPOrderedDescending or CPOrderedSame.

Definition at line 379 of file CPDecimal.j.

◆ CPDecimalCopy()

function CPDecimalCopy ( dcm  )

Create a copy of a CPDecimal object

Parameters
dcmthe CPDecimal number to copy.
Returns
a new CPDecimal.

Definition at line 361 of file CPDecimal.j.

◆ CPDecimalDivide()

function CPDecimalDivide ( result  ,
leftOperand  ,
rightOperand  ,
roundingMode   
)

Performs a division of 2 CPDecimal numbers.

Parameters
resultthe CPDecimal object in which to put the result
leftOperandthe left CPDecimal operand
rightOperandthe right CPDecimal operand
roundingModethe rounding mode for the operation
Returns
a CPCalculationError status value.

Definition at line 888 of file CPDecimal.j.

◆ CPDecimalIsNotANumber()

function CPDecimalIsNotANumber ( dcm  )

Checks to see if a CPDecimal is Not A Number.

Returns
TRUE on NaN.

Definition at line 350 of file CPDecimal.j.

◆ CPDecimalIsOne()

function CPDecimalIsOne ( dcm  )

Checks to see if a CPDecimal is 1. Can handle uncompacted strings (it compacts them).

Returns
TRUE on 1.

Definition at line 303 of file CPDecimal.j.

◆ CPDecimalIsZero()

function CPDecimalIsZero ( dcm  )

Checks to see if a CPDecimal is zero. Can handle uncompacted strings.

Returns
TRUE on zero.

Definition at line 283 of file CPDecimal.j.

◆ CPDecimalMakeNaN()

function CPDecimalMakeNaN ( )

Creates a CPDecimal NaN.

Returns
A CPDecimal object containing the value NaN

Definition at line 250 of file CPDecimal.j.

◆ CPDecimalMakeOne()

function CPDecimalMakeOne ( )

Creates a CPDecimal 1.

Returns
A CPDecimal object containing the value 1.

Definition at line 239 of file CPDecimal.j.

◆ CPDecimalMakeWithParts()

function CPDecimalMakeWithParts ( mantissa  ,
exponent   
)

Creates a CPDecimal object from a given mantissa and exponent. The sign is taken from the sign of the mantissa. This cant do a full 34 digit mantissa representation as JS's 32 bits or 64bit binary FP numbers cant represent that. So use the CPDecimalMakeWithString if you want longer mantissa.

Parameters
mantissathe mantissa (though see above note)
exponentthe exponent
Returns
A CPDecimal object, or nil on error.

Definition at line 193 of file CPDecimal.j.

◆ CPDecimalMakeWithString()

function CPDecimalMakeWithString ( string  ,
locale   
)

Creates a CPDecimal object from a string representation of the decimal number.

Parameters
decimalStringCPString of number
roundingModeRounding mode for when number is too large to fit in mantissa.
Returns
A CPDecimal object, or nil on error.

Definition at line 104 of file CPDecimal.j.

◆ CPDecimalMakeZero()

function CPDecimalMakeZero ( )

Creates a CPDecimal 0.

Returns
A CPDecimal object containing the value 0.

Definition at line 229 of file CPDecimal.j.

◆ CPDecimalMultiply()

function CPDecimalMultiply ( result  ,
leftOperand  ,
rightOperand  ,
roundingMode  ,
powerMode   
)

Performs multiplication of 2 CPDecimal numbers.

Parameters
resultthe CPDecimal object in which to put the result
leftOperandthe left CPDecimal operand
rightOperandthe right CPDecimal operand
roundingModethe rounding mode for the operation
Returns
a CPCalculationError status value.

Definition at line 1032 of file CPDecimal.j.

◆ CPDecimalMultiplyByPowerOf10()

function CPDecimalMultiplyByPowerOf10 ( result  ,
dcm  ,
power  ,
roundingMode   
)

Raises a CPDecimal number to a power of 10.

Parameters
resultthe CPDecimal object in which to put the result
dcmthe CPDecimal operand
powerthe power to raise to
roundingModethe rounding mode for the operation
Returns
a CPCalculationError status value.

Definition at line 1131 of file CPDecimal.j.

◆ CPDecimalNormalize()

function CPDecimalNormalize ( dcm1  ,
dcm2  ,
roundingMode  ,
longMode   
)

Normalises 2 CPDecimals. Normalisation is the process of modifying a numbers mantissa to ensure that both CPDecimals have the same exponent.

Parameters
dcm1the first CPDecimal
dcm2the second CPDecimal
roundingModethe rounding mode for the operation
Returns
a CPCalculationError status value.

Definition at line 1215 of file CPDecimal.j.

◆ CPDecimalPower()

function CPDecimalPower ( result  ,
dcm  ,
power  ,
roundingMode   
)

Raises a CPDecimal number to the given power.

Parameters
resultthe CPDecimal object in which to put the result
dcmthe CPDecimal operand
powerthe power to raise to
roundingModethe rounding mode for the operation
Returns
a CPCalculationError status value.

Definition at line 1162 of file CPDecimal.j.

◆ CPDecimalRound()

function CPDecimalRound ( result  ,
dcm  ,
scale  ,
roundingMode   
)

Rounds a CPDecimal off at a given decimal position. scale specifies the position. Negative values of scale imply rounding in the whole numbers and positive values rounding in the decimal places. A scale of 0 rounds to the first whole number.

Parameters
resultthe CPDecimal object in which to put the result
dcmthe CPDecimal operand
scalethe position to round to
roundingModethe rounding mode for the operation
Returns
a CPCalculationError status value.

Definition at line 1341 of file CPDecimal.j.

◆ CPDecimalString()

function CPDecimalString ( dcm  ,
locale   
)

Convert a CPDecimal to a string representation.

Parameters
dcmthe CPDecimal operand
localethe locale to use for the conversion
Returns
a CPString

Definition at line 1504 of file CPDecimal.j.

◆ CPDecimalSubtract()

function CPDecimalSubtract ( result  ,
leftOperand  ,
rightOperand  ,
roundingMode   
)

Performs the subtraction of 2 CPDecimal numbers.

Parameters
resultthe CPDecimal object in which to put the result
leftOperandthe left CPDecimal operand
rightOperandthe right CPDecimal operand
roundingModethe rounding mode for the operation
Returns
a CPCalculationError status value.

Definition at line 688 of file CPDecimal.j.

◆ CPEmptyRange()

function CPEmptyRange ( aRange  )

Determines if a range is empty length is 0.

Parameters
aRangethe range to test CPRange
Returns
YES if the range is empty

Definition at line 59 of file CPRange.j.

◆ CPEqualRanges()

function CPEqualRanges ( lhsRange  ,
rhsRange   
)

Determines if two CPRanges are equal.

Parameters
lhsRangethe first CPRange
rhsRangethe second CPRange
Returns
BOOL YES if the two CPRanges are equal.

Definition at line 81 of file CPRange.j.

◆ CPIntersectionRange()

function CPIntersectionRange ( lhsRange  ,
rhsRange   
)

Creates a new CPRange that spans the common range of two CPRanges

Parameters
lhsRangethe first CPRange
rhsRangethe second CPRange CPRange
Returns
CPRange the new CPRange

Definition at line 120 of file CPRange.j.

◆ CPLocationInRange()

function CPLocationInRange ( aLocation  ,
aRange   
)

Determines if a number is within a specified CPRange.

Parameters
aLocationthe number to check
aRangethe CPRange to check within CPRange
Returns
BOOL YES if aLocation is within the range

Definition at line 93 of file CPRange.j.

◆ CPMakeRangeCopy()

function CPMakeRangeCopy ( aRange  )

Makes a copy of a CPRange.

Parameters
aRangethe CPRange to copy CPRange
Returns
CPRange the copy of the range

Definition at line 48 of file CPRange.j.

◆ CPMaxRange()

function CPMaxRange ( aRange  )

Finds the range maximum. (location + length)

Parameters
aRangethe range to calculate a maximum from CPRange
Returns
int the range maximum

Definition at line 70 of file CPRange.j.

◆ CPRangeFromString()

function CPRangeFromString ( aString  )

Creates a CPRange from the contents of a CPString.

Parameters
aStringthe string to create a CPRange from CPRange
Returns
CPRange the new range

Definition at line 159 of file CPRange.j.

◆ CPRangeInRange()

function CPRangeInRange ( lhsRange  ,
rhsRange   
)

Checks if a range completely contains another range. In other words, if one range is the "super range" of another.

Parameters
lhsRangethe containing range
rhsRangethe range we are testing to see if lhsRange contains it CPRange
Returns
BOOL whether or not lhsRange completely contains rhsRange

Definition at line 137 of file CPRange.j.

◆ CPStringFromRange()

function CPStringFromRange ( aRange  )

Returns a string describing a range.

Parameters
aRangethe range to describe CPRange
Returns
CPString a describing string

Definition at line 148 of file CPRange.j.

◆ CPUnionRange()

function CPUnionRange ( lhsRange  ,
rhsRange   
)

Creates a new range with the minimum location and a length that extends to the maximum length.

Parameters
lhsRangethe first CPRange
rhsRangethe second CPRange CPRange
Returns
CPRange the new CPRange

Definition at line 106 of file CPRange.j.

Variable Documentation

◆ CPBundlesForURLStrings

var CPBundlesForURLStrings = { }

Groups information about an application's code & resources.

Definition at line 41 of file CPBundle.j.