Functions
Abstract: A member function which appends the data contained in an OSData object to the receiver.
public:
virtual bool appendBytes(const OSData *other);
Parameters
Name | Description |
other | An OSData object. |
Result: Returns true if appending the new data was successful, false otherwise.
Abstract: A member function which appends a buffer of data onto the end of the object's internal data buffer.
public:
virtual bool appendBytes(const void *bytes, unsigned int inLength);
Parameters
Name | Description |
bytes | A pointer to the block of data. |
inLength | The length of the data block. |
Result: Returns true if the object was able to append the new data, false otherwise.
Abstract: A member function which will expand the size of the collection to a given storage capacity.
public:
virtual unsigned int ensureCapacity(unsigned int newCapacity);
Parameters
Name | Description |
newCapacity | The new capacity for the data buffer. |
Result: Returns the new capacity of the data buffer or the previous capacity upon error.
Abstract: A member function which releases all resources created or used by the OSData object.
public:
virtual void free();
Do not call this function directly, use release() instead.
Abstract: A member function to return a pointer to the OSData object's internal data buffer.
public:
virtual const void *getBytesNoCopy() const;
Result: Returns a reference to the OSData object's internal data buffer.
Abstract: Returns a reference into the OSData object's internal data buffer at particular offset and with a particular length.
public:
virtual const void *getBytesNoCopy(unsigned int start,
unsigned int inLength) const;
Parameters
Name | Description |
start | The offset from the base of the internl data buffer. |
inLength | The length of window. |
Result: Returns a pointer at a particular offset into the data buffer, or 0 if the starting offset or length are not valid.
Abstract: A member function which returns the capacity of the internal data buffer.
public:
virtual unsigned int getCapacity() const;
Result: Returns an integer value for the size of the object's internal data buffer.
Abstract: A member function which returns the size by which the data buffer will grow.
public:
virtual unsigned int getCapacityIncrement() const;
Result: Returns the size by which the data buffer will grow.
Abstract: A member function which returns the length of the internal data buffer.
public:
virtual unsigned int getLength() const;
Result: Returns an integer value for the length of data in the object's internal data buffer.
Abstract: A member function to initialize an instance of OSData with the provided data.
public:
virtual bool initWithCapacity(unsigned int inCapacity);
Parameters
Name | Description |
bytes | A pointer to a block of data to be copied. |
inLength | The length of the block of data. |
Result: Returns true if initialization was successful, false otherwise.
Abstract: A member function to initialize an instance of OSData which references a block of data.
public:
virtual bool initWithBytes(const void *bytes, unsigned int inLength);
Parameters
Name | Description |
bytes | A reference to a block of data |
inLength | The length of the block of data. |
Result: Returns true if initialization was successful, false otherwise.
Abstract: A member function to initialize an instance of OSData which references a block of data.
public:
virtual bool initWithBytesNoCopy(void *bytes, unsigned int inLength);
Parameters
Name | Description |
bytes | A reference to a block of data |
inLength | The length of the block of data. |
Result: Returns true if initialization was successful, false otherwise.
Abstract: A member function to initialize an instance of OSData with the data provided.
public:
virtual bool initWithData(const OSData *inData);
Parameters
Name | Description |
inData | An OSData object which provides the data to be copied. |
Result: Returns true if initialization was successful, false otherwise.
Abstract: A member function to initialize an instance of OSData with a specific range of the data provided
public:
virtual bool initWithData(const OSData *inData,
unsigned int start, unsigned int inLength);
Parameters
Name | Description |
inData | An OSData object. |
start | The starting range of data to be copied. |
inLength | The length in bytes of the data to be copied. |
Result: Returns true if initialization was successful, false otherwise.
Abstract: A member function to test the equality between an OSData object and an arbitrary OSObject derived object.
public:
virtual bool isEqualTo(const OSObject *obj) const;
Parameters
Name | Description |
obj | An OSObject derived object. |
Result: Returns true if the two objects are equivalent.
Abstract: A member function to test the equality of an arbitrary block of data with the OSData object's internal data buffer.
public:
virtual bool isEqualTo(const void *someData, unsigned int inLength) const;
Parameters
Name | Description |
someData | A pointer to a block of data. |
inLength | The length of the block of data. |
Result: Returns true if the two blocks of data are equivalent, false otherwise.
Abstract: A member function to test the equality of two OSData objects.
public:
virtual bool isEqualTo(const OSData *aData) const;
Parameters
Name | Description |
aData | The OSData object to be compared to the receiver. |
Result: Returns true if the two objects are equivalent, false otherwise.
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: A member function which sets the growth size of the data buffer.
public:
virtual unsigned int setCapacityIncrement(unsigned increment);
Result: Returns the new growth size.
Abstract: A static constructor function to create and initialize an instance of OSData and copies in the provided data.
public:
static OSData *withBytes(const void *bytes, unsigned int inLength);
Parameters
Name | Description |
bytes | A buffer of data. |
inLength | The size of the given buffer. |
Result: Returns an instance of OSData or 0 if a failure occurrs.
Abstract: A static constructor function to create and initialize an instance of OSData which references a buffer of data.
public:
static OSData *withBytesNoCopy(void *bytes, unsigned int inLength);
Parameters
Name | Description |
bytes | A reference to a block of data. |
inLength | The size of the data block. |
Result: Returns an instance of OSData or 0 if a failure occurrs.
Abstract: A static constructor function to create and initialize an empty instance of OSData with a given capacity.
public:
static OSData *withCapacity(unsigned int inCapacity);
Parameters
Name | Description |
inCapacity | The initial capacity of the OSData object in bytes. |
Result: Returns an instance of OSData or 0 if a failure occurrs.
Abstract: A static constructor function to create and initialize an instance of OSData with the data provided.
public:
static OSData *withData(const OSData *inData);
Parameters
Name | Description |
inData | An OSData object which provides the initial data. |
Result: Returns an instance of OSData or 0 if a failure occurrs.
Abstract: A static constructor function to create and initialize an instance of OSData with a specific range of the data provided.
public:
static OSData *withData(const OSData *inData,
unsigned int start, unsigned int inLength);
Parameters
Name | Description |
inData | An OSData object which provides the initial data. |
start | The starting index at which the data will be copied. |
inLength | The number of bytes to be copied starting at index 'start'. |
Result: Returns an instance of OSData or 0 if a failure occurrs.
© 2000 Apple Computer, Inc. (Last Updated 2/23/2000)