ObjFW
Public Member Functions | Static Public Member Functions | Protected Attributes
OFNumber Class Reference

Provides a way to store a number in an object. More...

#include <OFNumber.h>

Inheritance diagram for OFNumber:
OFObject <OFCopying> <OFObject>

List of all members.

Public Member Functions

id initWithBool: (BOOL bool_)
id initWithChar: (char char_)
id initWithShort: (short short_)
id initWithInt: (int int_)
id initWithLong: (long long_)
id initWithUnsignedChar: (unsigned char uchar)
id initWithUnsignedShort: (unsigned short ushort)
id initWithUnsignedInt: (unsigned int uint)
id initWithUnsignedLong: (unsigned long ulong)
id initWithInt8: (int8_t int8)
id initWithInt16: (int16_t int16)
id initWithInt32: (int32_t int32)
id initWithInt64: (int64_t int64)
id initWithUInt8: (uint8_t uint8)
id initWithUInt16: (uint16_t uint16)
id initWithUInt32: (uint32_t uint32)
id initWithUInt64: (uint64_t uint64)
id initWithSize: (size_t size)
id initWithSSize: (ssize_t ssize)
id initWithIntMax: (intmax_t intmax)
id initWithUIntMax: (uintmax_t uintmax)
id initWithPtrDiff: (ptrdiff_t ptrdiff)
id initWithIntPtr: (intptr_t intptr)
id initWithUIntPtr: (uintptr_t uintptr)
id initWithFloat: (float float_)
id initWithDouble: (double double_)
of_number_type_t type ()
BOOL boolValue ()
char charValue ()
short shortValue ()
int intValue ()
long longValue ()
unsigned char unsignedCharValue ()
unsigned short unsignedShortValue ()
unsigned int unsignedIntValue ()
unsigned long unsignedLongValue ()
int8_t int8Value ()
int16_t int16Value ()
int32_t int32Value ()
int64_t int64Value ()
uint8_t uInt8Value ()
uint16_t uInt16Value ()
uint32_t uInt32Value ()
uint64_t uInt64Value ()
size_t sizeValue ()
ssize_t sSizeValue ()
intmax_t intMaxValue ()
uintmax_t uIntMaxValue ()
ptrdiff_t ptrDiffValue ()
intptr_t intPtrValue ()
uintptr_t uIntPtrValue ()
float floatValue ()
double doubleValue ()
OFNumbernumberByAddingNumber: (OFNumber *num)
OFNumbernumberBySubtractingNumber: (OFNumber *num)
OFNumbernumberByMultiplyingWithNumber: (OFNumber *num)
OFNumbernumberByDividingWithNumber: (OFNumber *num)
OFNumbernumberByANDingWithNumber: (OFNumber *num)
OFNumbernumberByORingWithNumber: (OFNumber *num)
OFNumbernumberByXORingWithNumber: (OFNumber *num)
OFNumbernumberByShiftingLeftWithNumber: (OFNumber *num)
OFNumbernumberByShiftingRightWithNumber: (OFNumber *num)
OFNumbernumberByIncreasing ()
OFNumbernumberByDecreasing ()
OFNumberremainderOfDivisionWithNumber: (OFNumber *num)

Static Public Member Functions

id numberWithBool: (BOOL bool_)
id numberWithChar: (char char_)
id numberWithShort: (short short_)
id numberWithInt: (int int_)
id numberWithLong: (long long_)
id numberWithUnsignedChar: (unsigned char uchar)
id numberWithUnsignedShort: (unsigned short ushort)
id numberWithUnsignedInt: (unsigned int uint)
id numberWithUnsignedLong: (unsigned long ulong)
id numberWithInt8: (int8_t int8)
id numberWithInt16: (int16_t int16)
id numberWithInt32: (int32_t int32)
id numberWithInt64: (int64_t int64)
id numberWithUInt8: (uint8_t uint8)
id numberWithUInt16: (uint16_t uint16)
id numberWithUInt32: (uint32_t uint32)
id numberWithUInt64: (uint64_t uint64)
id numberWithSize: (size_t size)
id numberWithSSize: (ssize_t ssize)
id numberWithIntMax: (intmax_t intmax)
id numberWithUIntMax: (uintmax_t uintmax)
id numberWithPtrDiff: (ptrdiff_t ptrdiff)
id numberWithIntPtr: (intptr_t intptr)
id numberWithUIntPtr: (uintptr_t uintptr)
id numberWithFloat: (float float_)
id numberWithDouble: (double double_)

Protected Attributes

union OFNumber::of_number_value value
of_number_type_t type

Detailed Description

Provides a way to store a number in an object.


Member Function Documentation

BOOL OFNumber::boolValue ( ) [virtual]
Returns:
The OFNumber as a BOOL
char OFNumber::charValue ( ) [virtual]
Returns:
The OFNumber as a char
double OFNumber::doubleValue ( ) [virtual]
Returns:
The OFNumber as a double
float OFNumber::floatValue ( ) [virtual]
Returns:
The OFNumber as a float
id OFNumber::initWithBool: ( BOOL  bool_) [virtual]

Initializes an already allocated OFNumber with the specified BOOL.

Parameters:
bool_A BOOL which the OFNumber should contain
Returns:
An initialized OFNumber
id OFNumber::initWithChar: ( char  char_) [virtual]

Initializes an already allocated OFNumber with the specified char.

Parameters:
char_A char which the OFNumber should contain
Returns:
An initialized OFNumber
id OFNumber::initWithDouble: ( double  double_) [virtual]

Initializes an already allocated OFNumber with the specified double.

Parameters:
double_A double which the OFNumber should contain
Returns:
An initialized OFNumber
id OFNumber::initWithFloat: ( float  float_) [virtual]

Initializes an already allocated OFNumber with the specified float.

Parameters:
float_A float which the OFNumber should contain
Returns:
An initialized OFNumber
id OFNumber::initWithInt16: ( int16_t  int16) [virtual]

Initializes an already allocated OFNumber with the specified int16_t.

Parameters:
int16An int16_t which the OFNumber should contain
Returns:
An initialized OFNumber
id OFNumber::initWithInt32: ( int32_t  int32) [virtual]

Initializes an already allocated OFNumber with the specified int32_t.

Parameters:
int32An int32_t which the OFNumber should contain
Returns:
An initialized OFNumber
id OFNumber::initWithInt64: ( int64_t  int64) [virtual]

Initializes an already allocated OFNumber with the specified int64_t.

Parameters:
int64An int64_t which the OFNumber should contain
Returns:
An initialized OFNumber
id OFNumber::initWithInt8: ( int8_t  int8) [virtual]

Initializes an already allocated OFNumber with the specified int8_t.

Parameters:
int8An int8_t which the OFNumber should contain
Returns:
An initialized OFNumber
id OFNumber::initWithInt: ( int  int_) [virtual]

Initializes an already allocated OFNumber with the specified int.

Parameters:
int_An int which the OFNumber should contain
Returns:
An initialized OFNumber
id OFNumber::initWithIntMax: ( intmax_t  intmax) [virtual]

Initializes an already allocated OFNumber with the specified intmax_t.

Parameters:
intmaxAn intmax_t which the OFNumber should contain
Returns:
An initialized OFNumber
id OFNumber::initWithIntPtr: ( intptr_t  intptr) [virtual]

Initializes an already allocated OFNumber with the specified intptr_t.

Parameters:
intptrAn intptr_t which the OFNumber should contain
Returns:
An initialized OFNumber
id OFNumber::initWithLong: ( long  long_) [virtual]

Initializes an already allocated OFNumber with the specified long.

Parameters:
long_A long which the OFNumber should contain
Returns:
An initialized OFNumber
id OFNumber::initWithPtrDiff: ( ptrdiff_t  ptrdiff) [virtual]

Initializes an already allocated OFNumber with the specified ptrdiff_t.

Parameters:
ptrdiffA ptrdiff_t which the OFNumber should contain
Returns:
An initialized OFNumber
id OFNumber::initWithShort: ( short  short_) [virtual]

Initializes an already allocated OFNumber with the specified short.

Parameters:
short_A short which the OFNumber should contain
Returns:
An initialized OFNumber
id OFNumber::initWithSize: ( size_t  size) [virtual]

Initializes an already allocated OFNumber with the specified size_t.

Parameters:
sizeA size_t which the OFNumber should contain
Returns:
An initialized OFNumber
id OFNumber::initWithSSize: ( ssize_t  ssize) [virtual]

Initializes an already allocated OFNumber with the specified ssize_t.

Parameters:
ssizeAn ssize_t which the OFNumber should contain
Returns:
An initialized OFNumber
id OFNumber::initWithUInt16: ( uint16_t  uint16) [virtual]

Initializes an already allocated OFNumber with the specified uint16_t.

Parameters:
uint16A uint16_t which the OFNumber should contain
Returns:
An initialized OFNumber
id OFNumber::initWithUInt32: ( uint32_t  uint32) [virtual]

Initializes an already allocated OFNumber with the specified uint32_t.

Parameters:
uint32A uint32_t which the OFNumber should contain
Returns:
An initialized OFNumber
id OFNumber::initWithUInt64: ( uint64_t  uint64) [virtual]

Initializes an already allocated OFNumber with the specified uint64_t.

Parameters:
uint64A uint64_t which the OFNumber should contain
Returns:
An initialized OFNumber
id OFNumber::initWithUInt8: ( uint8_t  uint8) [virtual]

Initializes an already allocated OFNumber with the specified uint8_t.

Parameters:
uint8A uint8_t which the OFNumber should contain
Returns:
An initialized OFNumber
id OFNumber::initWithUIntMax: ( uintmax_t  uintmax) [virtual]

Initializes an already allocated OFNumber with the specified uintmax_t.

Parameters:
uintmaxA uintmax_t which the OFNumber should contain
Returns:
An initialized OFNumber
id OFNumber::initWithUIntPtr: ( uintptr_t  uintptr) [virtual]

Initializes an already allocated OFNumber with the specified uintptr_t.

Parameters:
uintptrA uintptr_t which the OFNumber should contain
Returns:
An initialized OFNumber
id OFNumber::initWithUnsignedChar: ( unsigned char  uchar) [virtual]

Initializes an already allocated OFNumber with the specified unsigned char.

Parameters:
ucharAn unsigned char which the OFNumber should contain
Returns:
An initialized OFNumber
id OFNumber::initWithUnsignedInt: ( unsigned int  uint) [virtual]

Initializes an already allocated OFNumber with the specified unsigned int .

Parameters:
uintAn unsigned int which the OFNumber should contain
Returns:
An initialized OFNumber
id OFNumber::initWithUnsignedLong: ( unsigned long  ulong) [virtual]

Initializes an already allocated OFNumber with the specified unsigned long.

Parameters:
ulongAn unsigned long which the OFNumber should contain
Returns:
An initialized OFNumber
id OFNumber::initWithUnsignedShort: ( unsigned short  ushort) [virtual]

Initializes an already allocated OFNumber with the specified unsigned short.

Parameters:
ushortAn unsigned short which the OFNumber should contain
Returns:
An initialized OFNumber
int16_t OFNumber::int16Value ( ) [virtual]
Returns:
The OFNumber as an int16_t
int32_t OFNumber::int32Value ( ) [virtual]
Returns:
The OFNumber as an int32_t
int64_t OFNumber::int64Value ( ) [virtual]
Returns:
The OFNumber as an int64_t
int8_t OFNumber::int8Value ( ) [virtual]
Returns:
The OFNumber as an int8_t
intmax_t OFNumber::intMaxValue ( ) [virtual]
Returns:
The OFNumber as an intmax_t
intptr_t OFNumber::intPtrValue ( ) [virtual]
Returns:
The OFNumber as an intptr_t
int OFNumber::intValue ( ) [virtual]
Returns:
The OFNumber as an int
long OFNumber::longValue ( ) [virtual]
Returns:
The OFNumber as a long
OFNumber * OFNumber::numberByAddingNumber: ( OFNumber num) [virtual]
Parameters:
numThe OFNumber to add
Returns:
A new autoreleased OFNumber added with the specified OFNumber
OFNumber * OFNumber::numberByANDingWithNumber: ( OFNumber num) [virtual]

ANDs two OFNumbers, returning a new one.

Does not work with floating point types!

Parameters:
numThe number to AND with.
Returns:
A new autoreleased OFNumber ANDed with the specified OFNumber
OFNumber * OFNumber::numberByDecreasing ( ) [virtual]
Returns:
A new autoreleased OFNumber with the value decreased by one.
OFNumber * OFNumber::numberByDividingWithNumber: ( OFNumber num) [virtual]
Parameters:
numThe OFNumber to divide by
Returns:
A new autoreleased OFNumber devided by the specified OFNumber
OFNumber * OFNumber::numberByIncreasing ( ) [virtual]
Returns:
A new autoreleased OFNumber with the value increased by one.
OFNumber * OFNumber::numberByMultiplyingWithNumber: ( OFNumber num) [virtual]
Parameters:
numThe OFNumber to multiply with
Returns:
A new autoreleased OFNumber multiplied with the specified OFNumber
OFNumber * OFNumber::numberByORingWithNumber: ( OFNumber num) [virtual]

ORs two OFNumbers, returning a new one.

Does not work with floating point types!

Parameters:
numThe number to OR with.
Returns:
A new autoreleased OFNumber ORed with the specified OFNumber
OFNumber * OFNumber::numberByShiftingLeftWithNumber: ( OFNumber num) [virtual]

Bitshifts the OFNumber to the left by the specified OFNumber, returning a new one.

Does not work with floating point types!

Parameters:
numThe number of bits to shift to the left
Returns:
A new autoreleased OFNumber bitshifted to the left with the specified OFNumber
OFNumber * OFNumber::numberByShiftingRightWithNumber: ( OFNumber num) [virtual]

Bitshifts the OFNumber to the right by the specified OFNumber, returning a new one.

Does not work with floating point types!

Parameters:
numThe number of bits to shift to the right
Returns:
A new autoreleased OFNumber bitshifted to the right with the specified OFNumber
OFNumber * OFNumber::numberBySubtractingNumber: ( OFNumber num) [virtual]
Parameters:
numThe OFNumber to substract
Returns:
A new autoreleased OFNumber subtracted by the specified OFNumber
OFNumber * OFNumber::numberByXORingWithNumber: ( OFNumber num) [virtual]

XORs two OFNumbers, returning a new one.

Does not work with floating point types!

Parameters:
numThe number to XOR with.
Returns:
A new autoreleased OFNumber XORed with the specified OFNumber
id OFNumber::numberWithBool: ( BOOL  bool_) [static, virtual]
Parameters:
bool_A BOOL which the OFNumber should contain
Returns:
A new autoreleased OFNumber
id OFNumber::numberWithChar: ( char  char_) [static, virtual]
Parameters:
char_A char which the OFNumber should contain
Returns:
A new autoreleased OFNumber
id OFNumber::numberWithDouble: ( double  double_) [static, virtual]
Parameters:
double_A double which the OFNumber should contain
Returns:
A new autoreleased OFNumber
id OFNumber::numberWithFloat: ( float  float_) [static, virtual]
Parameters:
float_A float which the OFNumber should contain
Returns:
A new autoreleased OFNumber
id OFNumber::numberWithInt16: ( int16_t  int16) [static, virtual]
Parameters:
int16An int16_t which the OFNumber should contain
Returns:
A new autoreleased OFNumber
id OFNumber::numberWithInt32: ( int32_t  int32) [static, virtual]
Parameters:
int32An int32_t which the OFNumber should contain
Returns:
A new autoreleased OFNumber
id OFNumber::numberWithInt64: ( int64_t  int64) [static, virtual]
Parameters:
int64An int64_t which the OFNumber should contain
Returns:
A new autoreleased OFNumber
id OFNumber::numberWithInt8: ( int8_t  int8) [static, virtual]
Parameters:
int8An int8_t which the OFNumber should contain
Returns:
A new autoreleased OFNumber
id OFNumber::numberWithInt: ( int  int_) [static, virtual]
Parameters:
int_An int which the OFNumber should contain
Returns:
A new autoreleased OFNumber
id OFNumber::numberWithIntMax: ( intmax_t  intmax) [static, virtual]
Parameters:
intmaxAn intmax_t which the OFNumber should contain
Returns:
A new autoreleased OFNumber
id OFNumber::numberWithIntPtr: ( intptr_t  intptr) [static, virtual]
Parameters:
intptrAn intptr_t which the OFNumber should contain
Returns:
A new autoreleased OFNumber
id OFNumber::numberWithLong: ( long  long_) [static, virtual]
Parameters:
long_A long which the OFNumber should contain
Returns:
A new autoreleased OFNumber
id OFNumber::numberWithPtrDiff: ( ptrdiff_t  ptrdiff) [static, virtual]
Parameters:
ptrdiffA ptrdiff_t which the OFNumber should contain
Returns:
A new autoreleased OFNumber
id OFNumber::numberWithShort: ( short  short_) [static, virtual]
Parameters:
short_A short which the OFNumber should contain
Returns:
A new autoreleased OFNumber
id OFNumber::numberWithSize: ( size_t  size) [static, virtual]
Parameters:
sizeA size_t which the OFNumber should contain
Returns:
A new autoreleased OFNumber
id OFNumber::numberWithSSize: ( ssize_t  ssize) [static, virtual]
Parameters:
ssizeAn ssize_t which the OFNumber should contain
Returns:
A new autoreleased OFNumber
id OFNumber::numberWithUInt16: ( uint16_t  uint16) [static, virtual]
Parameters:
uint16A uint16_t which the OFNumber should contain
Returns:
A new autoreleased OFNumber
id OFNumber::numberWithUInt32: ( uint32_t  uint32) [static, virtual]
Parameters:
uint32A uint32_t which the OFNumber should contain
Returns:
A new autoreleased OFNumber
id OFNumber::numberWithUInt64: ( uint64_t  uint64) [static, virtual]
Parameters:
uint64A uint64_t which the OFNumber should contain
Returns:
A new autoreleased OFNumber
id OFNumber::numberWithUInt8: ( uint8_t  uint8) [static, virtual]
Parameters:
uint8A uint8_t which the OFNumber should contain
Returns:
A new autoreleased OFNumber
id OFNumber::numberWithUIntMax: ( uintmax_t  uintmax) [static, virtual]
Parameters:
uintmaxA uintmax_t which the OFNumber should contain
Returns:
A new autoreleased OFNumber
id OFNumber::numberWithUIntPtr: ( uintptr_t  uintptr) [static, virtual]
Parameters:
uintptrA uintptr_t which the OFNumber should contain
Returns:
A new autoreleased OFNumber
id OFNumber::numberWithUnsignedChar: ( unsigned char  uchar) [static, virtual]
Parameters:
ucharAn unsigned char which the OFNumber should contain
Returns:
A new autoreleased OFNumber
id OFNumber::numberWithUnsignedInt: ( unsigned int  uint) [static, virtual]
Parameters:
uintAn unsigned int which the OFNumber should contain
Returns:
A new autoreleased OFNumber
id OFNumber::numberWithUnsignedLong: ( unsigned long  ulong) [static, virtual]
Parameters:
ulongAn unsigned long which the OFNumber should contain
Returns:
A new autoreleased OFNumber
id OFNumber::numberWithUnsignedShort: ( unsigned short  ushort) [static, virtual]
Parameters:
ushortAn unsigned short which the OFNumber should contain
Returns:
A new autoreleased OFNumber
ptrdiff_t OFNumber::ptrDiffValue ( ) [virtual]
Returns:
The OFNumber as a ptrdiff_t
OFNumber * OFNumber::remainderOfDivisionWithNumber: ( OFNumber num) [virtual]
Parameters:
numThe number to divide by
Returns:
The remainder of a division by the specified number
short OFNumber::shortValue ( ) [virtual]
Returns:
The OFNumber as a short
size_t OFNumber::sizeValue ( ) [virtual]
Returns:
The OFNumber as a size_t
ssize_t OFNumber::sSizeValue ( ) [virtual]
Returns:
The OFNumber as an ssize_t
of_number_type_t OFNumber::type ( ) [virtual]
Returns:
An of_number_type_t indicating the type of the number
uint16_t OFNumber::uInt16Value ( ) [virtual]
Returns:
The OFNumber as a uint16_t
uint32_t OFNumber::uInt32Value ( ) [virtual]
Returns:
The OFNumber as a uint32_t
uint64_t OFNumber::uInt64Value ( ) [virtual]
Returns:
The OFNumber as a uint64_t
uint8_t OFNumber::uInt8Value ( ) [virtual]
Returns:
The OFNumber as a uint8_t
uintmax_t OFNumber::uIntMaxValue ( ) [virtual]
Returns:
The OFNumber as a uintmax_t
uintptr_t OFNumber::uIntPtrValue ( ) [virtual]
Returns:
The OFNumber as a uintptr_t
unsigned char OFNumber::unsignedCharValue ( ) [virtual]
Returns:
The OFNumber as an unsigned char
unsigned int OFNumber::unsignedIntValue ( ) [virtual]
Returns:
The OFNumber as an unsigned int
unsigned long OFNumber::unsignedLongValue ( ) [virtual]
Returns:
The OFNumber as an unsigned long
unsigned short OFNumber::unsignedShortValue ( ) [virtual]
Returns:
The OFNumber as an unsigned short

The documentation for this class was generated from the following files:
 All Classes Functions Variables