ObjFW
|
Provides a way to store a number in an object. More...
#import <ObjFW/OFNumber.h>
Instance Methods | |
(id) | - initWithBool: |
Initializes an already allocated OFNumber with the specified bool. More... | |
(id) | - initWithChar: |
Initializes an already allocated OFNumber with the specified signed char. More... | |
(id) | - initWithShort: |
Initializes an already allocated OFNumber with the specified signed short. More... | |
(id) | - initWithInt: |
Initializes an already allocated OFNumber with the specified signed int. More... | |
(id) | - initWithLong: |
Initializes an already allocated OFNumber with the specified signed long. More... | |
(id) | - initWithLongLong: |
Initializes an already allocated OFNumber with the specified signed long long. More... | |
(id) | - initWithUnsignedChar: |
Initializes an already allocated OFNumber with the specified unsigned char. More... | |
(id) | - initWithUnsignedShort: |
Initializes an already allocated OFNumber with the specified unsigned short. More... | |
(id) | - initWithUnsignedInt: |
Initializes an already allocated OFNumber with the specified unsigned int. More... | |
(id) | - initWithUnsignedLong: |
Initializes an already allocated OFNumber with the specified unsigned long. More... | |
(id) | - initWithUnsignedLongLong: |
Initializes an already allocated OFNumber with the specified unsigned long long. More... | |
(id) | - initWithInt8: |
Initializes an already allocated OFNumber with the specified int8_t. More... | |
(id) | - initWithInt16: |
Initializes an already allocated OFNumber with the specified int16_t. More... | |
(id) | - initWithInt32: |
Initializes an already allocated OFNumber with the specified int32_t. More... | |
(id) | - initWithInt64: |
Initializes an already allocated OFNumber with the specified int64_t. More... | |
(id) | - initWithUInt8: |
Initializes an already allocated OFNumber with the specified uint8_t. More... | |
(id) | - initWithUInt16: |
Initializes an already allocated OFNumber with the specified uint16_t. More... | |
(id) | - initWithUInt32: |
Initializes an already allocated OFNumber with the specified uint32_t. More... | |
(id) | - initWithUInt64: |
Initializes an already allocated OFNumber with the specified uint64_t. More... | |
(id) | - initWithSize: |
Initializes an already allocated OFNumber with the specified size_t. More... | |
(id) | - initWithSSize: |
Initializes an already allocated OFNumber with the specified ssize_t. More... | |
(id) | - initWithIntMax: |
Initializes an already allocated OFNumber with the specified intmax_t. More... | |
(id) | - initWithUIntMax: |
Initializes an already allocated OFNumber with the specified uintmax_t. More... | |
(id) | - initWithPtrDiff: |
Initializes an already allocated OFNumber with the specified ptrdiff_t. More... | |
(id) | - initWithIntPtr: |
Initializes an already allocated OFNumber with the specified intptr_t. More... | |
(id) | - initWithUIntPtr: |
Initializes an already allocated OFNumber with the specified uintptr_t. More... | |
(id) | - initWithFloat: |
Initializes an already allocated OFNumber with the specified float. More... | |
(id) | - initWithDouble: |
Initializes an already allocated OFNumber with the specified double. More... | |
(of_number_type_t) | - type |
Returns the type of the number. More... | |
(bool) | - boolValue |
Returns the OFNumber as a bool. More... | |
(signed char) | - charValue |
Returns the OFNumber as a signed char. More... | |
(signed short) | - shortValue |
Returns the OFNumber as a signed short. More... | |
(signed int) | - intValue |
Returns the OFNumber as a signed int. More... | |
(signed long) | - longValue |
Returns the OFNumber as a signed long. More... | |
(signed long long) | - longLongValue |
Returns the OFNumber as a signed long long. More... | |
(unsigned char) | - unsignedCharValue |
Returns the OFNumber as an unsigned char. More... | |
(unsigned short) | - unsignedShortValue |
Returns the OFNumber as an unsigned short. More... | |
(unsigned int) | - unsignedIntValue |
Returns the OFNumber as an unsigned int. More... | |
(unsigned long) | - unsignedLongValue |
Returns the OFNumber as an unsigned long. More... | |
(unsigned long long) | - unsignedLongLongValue |
Returns the OFNumber as an unsigned long long. More... | |
(int8_t) | - int8Value |
Returns the OFNumber as an int8_t. More... | |
(int16_t) | - int16Value |
Returns the OFNumber as an int16_t. More... | |
(int32_t) | - int32Value |
Returns the OFNumber as an int32_t. More... | |
(int64_t) | - int64Value |
Returns the OFNumber as an int64_t. More... | |
(uint8_t) | - uInt8Value |
Returns the OFNumber as a uint8_t. More... | |
(uint16_t) | - uInt16Value |
Returns the OFNumber as a uint16_t. More... | |
(uint32_t) | - uInt32Value |
Returns the OFNumber as a uint32_t. More... | |
(uint64_t) | - uInt64Value |
Returns the OFNumber as a uint64_t. More... | |
(size_t) | - sizeValue |
Returns the OFNumber as a size_t. More... | |
(ssize_t) | - sSizeValue |
Returns the OFNumber as an ssize_t. More... | |
(intmax_t) | - intMaxValue |
Returns the OFNumber as an intmax_t. More... | |
(uintmax_t) | - uIntMaxValue |
Returns the OFNumber as a uintmax_t. More... | |
(ptrdiff_t) | - ptrDiffValue |
Returns the OFNumber as a ptrdiff_t. More... | |
(intptr_t) | - intPtrValue |
Returns the OFNumber as an intptr_t. More... | |
(uintptr_t) | - uIntPtrValue |
Returns the OFNumber as a uintptr_t. More... | |
(float) | - floatValue |
Returns the OFNumber as a float. More... | |
(double) | - doubleValue |
Returns the OFNumber as a double. More... | |
Instance Methods inherited from OFObject | |
(id) | - init |
Initializes an already allocated object. More... | |
(OFString *) | - className |
Returns the name of the object's class. More... | |
(OFString *) | - description |
Returns a description for the object. More... | |
(void *) | - allocMemoryWithSize: |
Allocates memory and stores it in the object's memory pool. More... | |
(void *) | - allocMemoryWithSize:count: |
Allocates memory for the specified number of items and stores it in the object's memory pool. More... | |
(nullable void *) | - resizeMemory:size: |
Resizes memory in the object's memory pool to the specified size. More... | |
(nullable void *) | - resizeMemory:size:count: |
Resizes memory in the object's memory pool to the specific number of items of the specified size. More... | |
(void) | - freeMemory: |
Frees allocated memory and removes it from the object's memory pool. More... | |
(void) | - dealloc |
Deallocates the object. More... | |
(void) | - performSelector:afterDelay: |
Performs the specified selector after the specified delay. More... | |
(void) | - performSelector:withObject:afterDelay: |
Performs the specified selector with the specified object after the specified delay. More... | |
(void) | - performSelector:withObject:withObject:afterDelay: |
Performs the specified selector with the specified objects after the specified delay. More... | |
(void) | - performSelector:onThread:waitUntilDone: |
Performs the specified selector on the specified thread. More... | |
(void) | - performSelector:onThread:withObject:waitUntilDone: |
Performs the specified selector on the specified thread with the specified object. More... | |
(void) | - performSelector:onThread:withObject:withObject:waitUntilDone: |
Performs the specified selector on the specified thread with the specified objects. More... | |
(void) | - performSelectorOnMainThread:waitUntilDone: |
Performs the specified selector on the main thread. More... | |
(void) | - performSelectorOnMainThread:withObject:waitUntilDone: |
Performs the specified selector on the main thread with the specified object. More... | |
(void) | - performSelectorOnMainThread:withObject:withObject:waitUntilDone: |
Performs the specified selector on the main thread with the specified objects. More... | |
(void) | - performSelector:onThread:afterDelay: |
Performs the specified selector on the specified thread after the specified delay. More... | |
(void) | - performSelector:onThread:withObject:afterDelay: |
Performs the specified selector on the specified thread with the specified object after the specified delay. More... | |
(void) | - performSelector:onThread:withObject:withObject:afterDelay: |
Performs the specified selector on the specified thread with the specified objects after the specified delay. More... | |
(nullable id) | - forwardingTargetForSelector: |
This method is called when resolveClassMethod: or resolveInstanceMethod: returned false. It should return a target to which the message should be forwarded. More... | |
(void) | - doesNotRecognizeSelector: |
Handles messages which are not understood by the receiver. More... | |
(OFString *) | - stringBySerializing |
Creates a string by serializing the receiver. More... | |
Instance Methods inherited from <OFObject> | |
(bool) | - isKindOfClass: |
Returns a boolean whether the object of the specified kind. More... | |
(bool) | - isMemberOfClass: |
Returns a boolean whether the object is a member of the specified class. More... | |
(bool) | - respondsToSelector: |
Returns a boolean whether the object responds to the specified selector. More... | |
(nullable IMP) | - methodForSelector: |
Returns the implementation for the specified selector. More... | |
(nullable const char *) | - typeEncodingForSelector: |
Returns the type encoding for the specified selector. More... | |
(nullable id) | - performSelector: |
Performs the specified selector. More... | |
(nullable id) | - performSelector:withObject: |
Performs the specified selector with the specified object. More... | |
(nullable id) | - performSelector:withObject:withObject: |
Performs the specified selector with the specified objects. More... | |
(bool) | - isEqual: |
Checks two objects for equality. More... | |
(uint32_t) | - hash |
Calculates a hash for the object. More... | |
(id) | - retain |
Increases the retain count. More... | |
(unsigned int) | - retainCount |
Returns the retain count. More... | |
(void) | - release |
Decreases the retain count. More... | |
(id) | - autorelease |
Adds the object to the topmost OFAutoreleasePool of the thread's autorelease pool stack. More... | |
(id) | - self |
Returns the receiver. More... | |
(bool) | - isProxy |
Returns whether the object is a proxy object. More... | |
Instance Methods inherited from <OFCopying> | |
(id) | - copy |
Copies the object. More... | |
Instance Methods inherited from <OFComparing> | |
(of_comparison_result_t) | - compare: |
Compares the object with another object. More... | |
Instance Methods inherited from <OFSerialization> | |
(id) | - initWithSerialization: |
Initializes the object with the specified XML element serialization. More... | |
(OFXMLElement *) | - XMLElementBySerializing |
Serializes the object into an XML element. More... | |
Instance Methods inherited from <OFJSONRepresentation> | |
(OFString *) | - JSONRepresentation |
Returns the JSON representation of the object as a string. More... | |
(OFString *) | - JSONRepresentationWithOptions: |
Returns the JSON representation of the object as a string. More... | |
Instance Methods inherited from <OFMessagePackRepresentation> | |
(OFDataArray *) | - messagePackRepresentation |
Returns the MessagePack representation of the object as an OFDataArray. More... | |
Class Methods | |
(instancetype) | + numberWithBool: |
Creates a new OFNumber with the specified bool. More... | |
(instancetype) | + numberWithChar: |
Creates a new OFNumber with the specified signed char. More... | |
(instancetype) | + numberWithShort: |
Creates a new OFNumber with the specified signed short. More... | |
(instancetype) | + numberWithInt: |
Creates a new OFNumber with the specified signed int. More... | |
(instancetype) | + numberWithLong: |
Creates a new OFNumber with the specified signed long. More... | |
(instancetype) | + numberWithLongLong: |
Creates a new OFNumber with the specified signed long long. More... | |
(instancetype) | + numberWithUnsignedChar: |
Creates a new OFNumber with the specified unsigned char. More... | |
(instancetype) | + numberWithUnsignedShort: |
Creates a new OFNumber with the specified unsigned short. More... | |
(instancetype) | + numberWithUnsignedInt: |
Creates a new OFNumber with the specified unsigned int. More... | |
(instancetype) | + numberWithUnsignedLong: |
Creates a new OFNumber with the specified unsigned long. More... | |
(instancetype) | + numberWithUnsignedLongLong: |
Creates a new OFNumber with the specified unsigned long long. More... | |
(instancetype) | + numberWithInt8: |
Creates a new OFNumber with the specified int8_t. More... | |
(instancetype) | + numberWithInt16: |
Creates a new OFNumber with the specified int16_t. More... | |
(instancetype) | + numberWithInt32: |
Creates a new OFNumber with the specified int32_t. More... | |
(instancetype) | + numberWithInt64: |
Creates a new OFNumber with the specified int64_t. More... | |
(instancetype) | + numberWithUInt8: |
Creates a new OFNumber with the specified uint8_t. More... | |
(instancetype) | + numberWithUInt16: |
Creates a new OFNumber with the specified uint16_t. More... | |
(instancetype) | + numberWithUInt32: |
Creates a new OFNumber with the specified uint32_t. More... | |
(instancetype) | + numberWithUInt64: |
Creates a new OFNumber with the specified uint64_t. More... | |
(instancetype) | + numberWithSize: |
Creates a new OFNumber with the specified size_t. More... | |
(instancetype) | + numberWithSSize: |
Creates a new OFNumber with the specified ssize_t. More... | |
(instancetype) | + numberWithIntMax: |
Creates a new OFNumber with the specified intmax_t. More... | |
(instancetype) | + numberWithUIntMax: |
Creates a new OFNumber with the specified uintmax_t. More... | |
(instancetype) | + numberWithPtrDiff: |
Creates a new OFNumber with the specified ptrdiff_t. More... | |
(instancetype) | + numberWithIntPtr: |
Creates a new OFNumber with the specified intptr_t. More... | |
(instancetype) | + numberWithUIntPtr: |
Creates a new OFNumber with the specified uintptr_t. More... | |
(instancetype) | + numberWithFloat: |
Creates a new OFNumber with the specified float. More... | |
(instancetype) | + numberWithDouble: |
Creates a new OFNumber with the specified double. More... | |
Class Methods inherited from OFObject | |
(void) | + load |
A method which is called once when the class is loaded into the runtime. More... | |
(void) | + unload |
A method which is called when the class is unloaded from the runtime. More... | |
(void) | + initialize |
A method which is called the moment before the first call to the class is being made. More... | |
(id) | + alloc |
Allocates memory for an instance of the class and sets up the memory pool for the object. More... | |
(id) | + new |
Allocates memory for a new instance and calls init on it. More... | |
(Class) | + class |
Returns the class. More... | |
(OFString *) | + className |
Returns the name of the class as a string. More... | |
(bool) | + isSubclassOfClass: |
Returns a boolean whether the class is a subclass of the specified class. More... | |
(Class) | + superclass |
Returns the superclass of the class. More... | |
(bool) | + instancesRespondToSelector: |
Checks whether instances of the class respond to a given selector. More... | |
(bool) | + conformsToProtocol: |
Checks whether the class conforms to a given protocol. More... | |
(nullable IMP) | + instanceMethodForSelector: |
Returns the implementation of the instance method for the specified selector. More... | |
(nullable const char *) | + typeEncodingForInstanceSelector: |
Returns the type encoding of the instance method for the specified selector. More... | |
(OFString *) | + description |
Returns a description for the class, which is usually the class name. More... | |
(nullable IMP) | + replaceClassMethod:withMethodFromClass: |
Replaces a class method with a class method from another class. More... | |
(nullable IMP) | + replaceInstanceMethod:withMethodFromClass: |
Replaces an instance method with an instance method from another class. More... | |
(nullable IMP) | + replaceClassMethod:withImplementation:typeEncoding: |
Replaces or adds a class method. More... | |
(nullable IMP) | + replaceInstanceMethod:withImplementation:typeEncoding: |
Replaces or adds an instance method. More... | |
(void) | + inheritMethodsFromClass: |
Adds all methods from the specified class to the class that is the receiver. More... | |
(bool) | + resolveClassMethod: |
Try to resolve the specified class method. More... | |
(bool) | + resolveInstanceMethod: |
Try to resolve the specified instance method. More... | |
(id) | + copy |
Returns the class. More... | |
Provides a way to store a number in an object.
- (signed char) charValue |
- (id) initWithBool: | (bool) | bool_ |
- (id) initWithChar: | (signed char) | schar |
- (id) initWithDouble: | (double) | double_ |
- (id) initWithFloat: | (float) | float_ |
- (id) initWithInt16: | (int16_t) | int16 |
- (id) initWithInt32: | (int32_t) | int32 |
- (id) initWithInt64: | (int64_t) | int64 |
- (id) initWithInt8: | (int8_t) | int8 |
- (id) initWithInt: | (signed int) | sint |
- (id) initWithIntMax: | (intmax_t) | intmax |
- (id) initWithIntPtr: | (intptr_t) | intptr |
- (id) initWithLong: | (signed long) | slong |
- (id) initWithLongLong: | (signed long long) | slonglong |
- (id) initWithPtrDiff: | (ptrdiff_t) | ptrdiff |
- (id) initWithShort: | (signed short) | sshort |
- (id) initWithSize: | (size_t) | size |
- (id) initWithSSize: | (ssize_t) | ssize |
- (id) initWithUInt16: | (uint16_t) | uint16 |
- (id) initWithUInt32: | (uint32_t) | uint32 |
- (id) initWithUInt64: | (uint64_t) | uint64 |
- (id) initWithUInt8: | (uint8_t) | uint8 |
- (id) initWithUIntMax: | (uintmax_t) | uintmax |
- (id) initWithUIntPtr: | (uintptr_t) | uintptr |
- (id) initWithUnsignedChar: | (unsigned char) | uchar |
- (id) initWithUnsignedInt: | (unsigned int) | uint |
- (id) initWithUnsignedLong: | (unsigned long) | ulong |
- (id) initWithUnsignedLongLong: | (unsigned long long) | ulonglong |
- (id) initWithUnsignedShort: | (unsigned short) | ushort |
- (signed long long) longLongValue |
- (signed long) longValue |
+ (instancetype) numberWithBool: | (bool) | bool_ |
+ (instancetype) numberWithChar: | (signed char) | schar |
+ (instancetype) numberWithDouble: | (double) | double_ |
+ (instancetype) numberWithFloat: | (float) | float_ |
+ (instancetype) numberWithInt16: | (int16_t) | int16 |
+ (instancetype) numberWithInt32: | (int32_t) | int32 |
+ (instancetype) numberWithInt64: | (int64_t) | int64 |
+ (instancetype) numberWithInt8: | (int8_t) | int8 |
+ (instancetype) numberWithInt: | (signed int) | sint |
+ (instancetype) numberWithIntMax: | (intmax_t) | intmax |
+ (instancetype) numberWithIntPtr: | (intptr_t) | intptr |
+ (instancetype) numberWithLong: | (signed long) | slong |
+ (instancetype) numberWithLongLong: | (signed long long) | slonglong |
+ (instancetype) numberWithPtrDiff: | (ptrdiff_t) | ptrdiff |
+ (instancetype) numberWithShort: | (signed short) | sshort |
+ (instancetype) numberWithSize: | (size_t) | size |
+ (instancetype) numberWithSSize: | (ssize_t) | ssize |
+ (instancetype) numberWithUInt16: | (uint16_t) | uint16 |
+ (instancetype) numberWithUInt32: | (uint32_t) | uint32 |
+ (instancetype) numberWithUInt64: | (uint64_t) | uint64 |
+ (instancetype) numberWithUInt8: | (uint8_t) | uint8 |
+ (instancetype) numberWithUIntMax: | (uintmax_t) | uintmax |
+ (instancetype) numberWithUIntPtr: | (uintptr_t) | uintptr |
+ (instancetype) numberWithUnsignedChar: | (unsigned char) | uchar |
+ (instancetype) numberWithUnsignedInt: | (unsigned int) | uint |
+ (instancetype) numberWithUnsignedLong: | (unsigned long) | ulong |
+ (instancetype) numberWithUnsignedLongLong: | (unsigned long long) | ulonglong |
+ (instancetype) numberWithUnsignedShort: | (unsigned short) | ushort |
- (signed short) shortValue |
- (of_number_type_t) type |
Returns the type of the number.
- (unsigned char) unsignedCharValue |
- (unsigned int) unsignedIntValue |
- (unsigned long long) unsignedLongLongValue |
- (unsigned long) unsignedLongValue |
- (unsigned short) unsignedShortValue |