ADC Home > Reference Library > Reference > Darwin > Kernel Framework Reference
|
OSData |
A container class to manage an array of bytes.
Appends a buffer of constant data onto the end of the object's internal data buffer.
Appends the data contained in an OSData object to the receiver.
Appends a buffer of data onto the end of the object's internal data buffer.
Expands the size of the collection to a given storage capacity.
Releases all resources created or used by the OSData object.
Returns a pointer to the OSData object's internal data buffer.
Returns a reference into the OSData object's internal data buffer at particular offset and with a particular length.
Returns the capacity of the internal data buffer.
Returns the size by which the data buffer will grow.
Returns the length of the internal data buffer.
Initializes an instance of OSData that references a block of data.
Initializes an instance of OSData that references a block of data.
Initializes an instance of OSData that references a block of data.
Initializes an instance of OSData with a minimum capacity of at least the given size.
Initializes an instance of OSData with the data provided.
Initializes an instance of OSData with a specific range of the data provided.
Tests the equality of two OSData objects.
Tests the equality between an OSData object and an arbitrary OSObject-derived object.
Tests the equality between an OSData object and an OSString object.
Tests the equality of an arbitrary block of data with the OSData object's internal data buffer.
Archives the receiver.
Sets the growth size of the data buffer.
Creates and initializes an instance of OSData and copies in the provided data.
Creates and initializes an instance of OSData that references a buffer of data.
Creates and initializes an empty instance of OSData with a given capacity.
Creates and initializes an instance of OSData with the data provided.
Creates and initializes an instance of OSData with a specific range of the data provided.
appendByte |
Appends a buffer of constant data onto the end of the object's internal data buffer.
public
virtual bool appendByte( unsigned char byte, unsigned int inCount);
byte
A byte value to replicate as the added data.
inCount
The length of the data to add.
Returns true if the object was able to append the new data, false otherwise.
appendBytes(const OSData *) |
Appends the data contained in an OSData object to the receiver.
public
virtual bool appendBytes( const OSData *other);
other
An OSData object.
Returns true if appending the new data was successful, false otherwise.
appendBytes(const void *, unsigned int) |
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);
bytes
A pointer to the block of data. If the value is 0 then append zero-ed memory to the data object.
inLength
The length of the data block.
Returns true if the object was able to append the new data, false otherwise.
ensureCapacity |
Expands the size of the collection to a given storage capacity.
public
virtual unsigned int ensureCapacity( unsigned int newCapacity);
newCapacity
The new capacity for the data buffer.
Returns the new capacity of the data buffer or the previous capacity upon error.
free |
Releases all resources created or used by the OSData object.
public
virtual void free();
Do not call this function directly, use release() instead.
getBytesNoCopy() |
Returns a pointer to the OSData object's internal data buffer.
public
virtual const void *getBytesNoCopy() const;
Returns a reference to the OSData object's internal data buffer.
getBytesNoCopy(unsigned int, unsigned int) |
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;
start
The offset from the base of the internal data buffer.
inLength
The length of the data.
Returns a pointer at a particular offset into the data buffer, or 0 if the starting offset or length are not valid.
getCapacity |
Returns the capacity of the internal data buffer.
public
virtual unsigned int getCapacity() const;
Returns an integer value for the size of the object's internal data buffer.
getCapacityIncrement |
Returns the size by which the data buffer will grow.
public
virtual unsigned int getCapacityIncrement() const;
Returns the size by which the data buffer will grow.
getLength |
Returns the length of the internal data buffer.
public
virtual unsigned int getLength() const;
Returns an integer value for the length of data in the object's internal data buffer.
initWithBytes(const void *, unsigned int) |
Initializes an instance of OSData that references a block of data.
public
virtual bool initWithBytes( const void *bytes, unsigned int inLength);
bytes
A reference to a block of data
inLength
The length of the block of data.
Returns true if initialization was successful, false otherwise.
initWithBytes(void *, unsigned int) |
Initializes an instance of OSData that references a block of data.
public
virtual bool initWithBytesNoCopy( void *bytes, unsigned int inLength);
bytes
A reference to a block of data
inLength
The length of the block of data.
Returns true if initialization was successful, false otherwise.
initWithBytesNoCopy |
Initializes an instance of OSData that references a block of data.
public
virtual bool initWithBytesNoCopy( void *bytes, unsigned int inLength);
bytes
A reference to a block of data
inLength
The length of the block of data.
Returns true if initialization was successful, false otherwise.
initWithCapacity |
Initializes an instance of OSData with a minimum capacity of at least the given size.
public
virtual bool initWithCapacity( unsigned int capacity);
capacity
The length of the allocated block of data.
Returns true if initialization was successful, false otherwise.
Note if this function is called on an object that has been previously used then the length is set down to 0 and a new block of data is allocated if necessary to ensure the given capacity.
initWithData(const OSData *) |
Initializes an instance of OSData with the data provided.
public
virtual bool initWithData( const OSData *inData);
inData
An OSData object that provides the data to be copied.
Returns true if initialization was successful, false otherwise.
initWithData(const OSData *, unsigned int, unsigned int) |
Initializes 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);
inData
An OSData object.
start
The starting range of data to be copied.
inLength
The length in bytes of the data to be copied.
Returns true if initialization was successful, false otherwise.
isEqualTo(const OSData *) |
Tests the equality of two OSData objects.
public
virtual bool isEqualTo( const OSData *aData) const;
aData
The OSData object to be compared to the receiver.
Returns true if the two objects are equivalent, false otherwise.
isEqualTo(const OSMetaClassBase *) |
Tests the equality between an OSData object and an arbitrary OSObject-derived object.
public
virtual bool isEqualTo( const OSMetaClassBase *obj) const;
obj
An OSObject-derived object.
Returns true if the two objects are equivalent.
isEqualTo(const OSString *) |
Tests the equality between an OSData object and an OSString object.
public
virtual bool isEqualTo( const OSString *obj) const;
obj
An OSString object
Returns true if the two objects are equivalent.
isEqualTo(const void *, unsigned int) |
Tests 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;
someData
A pointer to a block of data.
inLength
The length of the block of data.
Returns true if the two blocks of data are equivalent, false otherwise.
serialize |
Archives the receiver.
public
virtual bool serialize( OSSerialize *s) const;
s
The OSSerialize object.
Returns true if serialization was successful, false if not.
setCapacityIncrement |
Sets the growth size of the data buffer.
public
virtual unsigned int setCapacityIncrement( unsigned increment);
Returns the new growth size.
withBytes |
Creates and initializes an instance of OSData and copies in the provided data.
public
static OSData *withBytes( const void *bytes, unsigned int inLength);
bytes
A buffer of data.
inLength
The size of the given buffer.
Returns an instance of OSData or 0 if a failure occurs.
withBytesNoCopy |
Creates and initializes an instance of OSData that references a buffer of data.
public
static OSData *withBytesNoCopy( void *bytes, unsigned int inLength);
bytes
A reference to a block of data.
inLength
The size of the data block.
Returns an instance of OSData or 0 if a failure occurs.
withCapacity |
Creates and initializes an empty instance of OSData with a given capacity.
public
static OSData *withCapacity( unsigned int inCapacity);
inCapacity
The initial capacity of the OSData object in bytes.
Returns an instance of OSData or 0 if a failure occurs.
withData(const OSData *) |
Creates and initializes an instance of OSData with the data provided.
public
static OSData *withData( const OSData *inData);
inData
An OSData object that provides the initial data.
Returns an instance of OSData or 0 if a failure occurs.
withData(const OSData *, unsigned int, unsigned int) |
Creates and initializes 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);
inData
An OSData object that 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'.
Returns an instance of OSData or 0 if a failure occurs.
reserved |
protected
ExpansionData *reserved;
Reserved for future use. (Internal use only)
|
Last Updated: 2008-12-19