OSNumber
Member Functions
Abstract: A member function which adds an integer value to the internal numeric value of the OSNumber object.
public:
virtual void addValue(signed long long value);
Parameters
Name | Description |
value | The value to be added. |
Abstract: Releases and deallocates resources created by the OSNumber instances.
public:
virtual void free();
This function should not be called directly, use release() instead.
Abstract: A member function to initialize an instance of OSNumber.
public:
virtual bool init(const char *value, unsigned int numberOfBits);
Parameters
Name | Description |
value | A c-string representation of a numeric value. |
numberOfBits | The number of bit required to represent the value. |
Result: Returns true if instance was successfully initialized, false otherwise.
Abstract: A member function to initialize an instance of OSNumber.
public:
virtual bool init(unsigned long long value, unsigned int numberOfBits);
Parameters
Name | Description |
value | An integer value. |
numberOfBits | The number of bit required to represent the value. |
Result: Returns true if instance was successfully initialized, false otherwise.
Abstract: A member function to test the equality of two OSNumber objects.
public:
virtual bool isEqualTo(const OSNumber *integer) const;
Parameters
Name | Description |
integer | The OSNumber object to be compared against the receiver. |
Result: Returns true if the two objects are equivalent, false otherwise.
Abstract: A member function to test the equality of an arbitrary OSObject derived object and an OSNumber object.
public:
virtual bool isEqualTo(const OSObject *obj) const;
Parameters
Name | Description |
obj | The OSObject derived object to be compared to the receiver. |
Result: Returns true if the two objects are equivalent, false otherwise.
Abstract: A member function which returns the number of bits used to represent the value.
public:
virtual unsigned int numberOfBits() const;
Result: Returns the number of bits required to represent the value.
Abstract: A member function which returns the number of bytes used to represent the value.
public:
virtual unsigned int numberOfBytes() const;
Result: Returns the number of bytes required to represent the value.
Abstract: A member function which archives the receiver.
public:
virtual bool serialize(OSSerialize *s) const;
Parameters
Name | Description |
s | The OSSerialize object. |
Result: Returns true if serialization was successful, false if not.
Abstract: Replaces the current internal numeric value of the OSNumber object by the value given.
public:
virtual void setValue(unsigned long long value);
Parameters
Name | Description |
value | The new value for the OSNumber object. |
Abstract: A member function which returns its internal value as an 16-bit value.
public:
virtual unsigned short unsigned16BitValue() const;
Result: Returns the internal value as an 16-bit value.
Abstract: A member function which returns its internal value as an 32-bit value.
public:
virtual unsigned int unsigned32BitValue() const;
Result: Returns the internal value as an 32-bit value.
Abstract: A member function which returns its internal value as an 64-bit value.
public:
virtual unsigned long long unsigned64BitValue() const;
Result: Returns the internal value as an 64-bit value.
Abstract: A member function which returns its internal value as an 8-bit value.
public:
virtual unsigned char unsigned8BitValue() const;
Result: Returns the internal value as an 8-bit value.
Abstract: A static constructor function to create and initialize an instance of OSNumber with a given value represented as a simple c-string.
public:
static OSNumber *withNumber(const char *value, unsigned int numberOfBits);
Parameters
Name | Description |
value | A c-string representing a numeric value. |
numberOfBits | The number of bit required to represent the value. |
Result: Returns an instance of OSNumber or 0 if an error occurred.
Abstract: A static constructor function to create and initialize an instance of OSNumber with a given value.
public:
static OSNumber *withNumber(unsigned long long value,
unsigned int numberOfBits);
Parameters
Name | Description |
value | The numeric integer value. |
numberOfBits | The number of bit required to represent the value. |
Result: Returns an instance of OSNumber or 0 if an error occurred.
© 2000 Apple Computer, Inc. (Last Updated 2/23/2000)