OSNumber



Member Functions

addValue

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

NameDescription
valueThe value to be added.

free

Abstract: Releases and deallocates resources created by the OSNumber instances.
public:

virtual void free();

This function should not be called directly, use release() instead.


init

Abstract: A member function to initialize an instance of OSNumber.
public:

virtual bool init(const char *value, unsigned int numberOfBits);

Parameters

NameDescription
valueA c-string representation of a numeric value.
numberOfBitsThe number of bit required to represent the value.
Result: Returns true if instance was successfully initialized, false otherwise.

init

Abstract: A member function to initialize an instance of OSNumber.
public:

virtual bool init(unsigned long long value, unsigned int numberOfBits);

Parameters

NameDescription
valueAn integer value.
numberOfBitsThe number of bit required to represent the value.
Result: Returns true if instance was successfully initialized, false otherwise.

isEqualTo

Abstract: A member function to test the equality of two OSNumber objects.
public:

virtual bool isEqualTo(const OSNumber *integer) const;

Parameters

NameDescription
integerThe OSNumber object to be compared against the receiver.
Result: Returns true if the two objects are equivalent, false otherwise.

isEqualTo

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

NameDescription
objThe OSObject derived object to be compared to the receiver.
Result: Returns true if the two objects are equivalent, false otherwise.

numberOfBits

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.

numberOfBytes

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.

serialize

Abstract: A member function which archives the receiver.
public:

virtual bool serialize(OSSerialize *s) const;

Parameters

NameDescription
sThe OSSerialize object.
Result: Returns true if serialization was successful, false if not.

setValue

Abstract: Replaces the current internal numeric value of the OSNumber object by the value given.
public:

virtual void setValue(unsigned long long value);

Parameters

NameDescription
valueThe new value for the OSNumber object.

unsigned16BitValue

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.

unsigned32BitValue

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.

unsigned64BitValue

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.

unsigned8BitValue

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.

withNumber

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

NameDescription
valueA c-string representing a numeric value.
numberOfBitsThe number of bit required to represent the value.
Result: Returns an instance of OSNumber or 0 if an error occurred.

withNumber

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

NameDescription
valueThe numeric integer value.
numberOfBitsThe 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)