|
Objectively 1.0.0
Ultra-lightweight object oriented framework for GNU C.
|
#include <MutableData.h>
Mutable data buffers.
Definition at line 40 of file MutableData.h.
Properties | |
| Data | data |
| The superclass. More... | |
Properties inherited from Data | |
| uint8_t * | bytes |
| The bytes. More... | |
| DataDestructor | destroy |
An optional destructor that, if set, is called on dealloc. More... | |
| size_t | length |
The length of bytes. More... | |
| Object | object |
| The superclass. More... | |
Properties inherited from Object | |
| Class * | clazz |
| Every instance of Object begins with a pointer to its Class. More... | |
Methods | |
| Class * | _MutableData (void) |
| The MutableData archetype. More... | |
| void | appendBytes (MutableData *self, const uint8_t *bytes, size_t length) |
Appends the given bytes to this Data. More... | |
| void | appendData (MutableData *self, const Data *data) |
Appends the given data to this Data. More... | |
| MutableData * | data (void) |
| Returns a new MutableData. More... | |
| MutableData * | dataWithCapacity (size_t capacity) |
Returns a new MutableData with the given capacity. More... | |
| MutableData * | init (MutableData *self) |
Initializes this Data with length 0. More... | |
| MutableData * | initWithCapacity (MutableData *self, size_t capacity) |
| Initializes this Data with the given capacity. More... | |
| MutableData * | initWithData (MutableData *self, const Data *data) |
Initializes this Data with the contents of data. More... | |
| void | setLength (MutableData *self, size_t length) |
| Sets the length of this Data, truncating or expanding it. More... | |
Methods inherited from Data | |
| Class * | _Data (void) |
| The Data archetype. More... | |
| Data * | dataWithBytes (const uint8_t *bytes, size_t length) |
Returns a new Data by copying length of bytes. More... | |
| Data * | dataWithConstMemory (const ident mem, size_t length) |
| Returns a new Data, backed by the given const memory. More... | |
| Data * | dataWithContentsOfFile (const char *path) |
Returns a new Data with the contents of the file at path. More... | |
| Data * | dataWithMemory (ident mem, size_t length) |
| Returns a new Data, taking ownership of the specified memory. More... | |
| Data * | initWithBytes (Data *self, const uint8_t *bytes, size_t length) |
Initializes this Data by copying length of bytes. More... | |
| Data * | initWithConstMemory (Data *self, const ident mem, size_t length) |
| Initializes this Data with the given const memory. More... | |
| Data * | initWithContentsOfFile (Data *self, const char *path) |
Initializes this Data with the contents of the file at path. More... | |
| Data * | initWithMemory (Data *self, ident mem, size_t length) |
| Initializes this Data, taking ownership of the specified memory. More... | |
| MutableData * | mutableCopy (const Data *self) |
| _Bool | writeToFile (const Data *self, const char *path) |
Writes this Data to path. More... | |
Methods inherited from Object | |
| Class * | _Object (void) |
| The Object archetype. More... | |
| Object * | copy (const Object *self) |
| Creates a shallow copy of this Object. More... | |
| void | dealloc (Object *self) |
| Frees all resources held by this Object. More... | |
| String * | description (const Object *self) |
| int | hash (const Object *self) |
| Object * | init (Object *self) |
| Initializes this Object. More... | |
| _Bool | isEqual (const Object *self, const Object *other) |
| Tests equality of the other Object. More... | |
| _Bool | isKindOfClass (const Object *self, const Class *clazz) |
| Tests for Class hierarchy membership. More... | |
Protected Attributes | |
| MutableDataInterface * | interface |
| The interface. More... | |
Protected Attributes inherited from Data | |
| DataInterface * | interface |
| The interface. More... | |
Protected Attributes inherited from Object | |
| ObjectInterface * | interface |
| The interface. More... | |
| MutableData * data | ( | void | ) |
The superclass.
Definition at line 45 of file MutableData.h.
|
protected |
The interface.
Definition at line 51 of file MutableData.h.
| Class * _MutableData | ( | void | ) |
The MutableData archetype.
Definition at line 182 of file MutableData.c.
| void appendBytes | ( | MutableData * | self, |
| const uint8_t * | bytes, | ||
| size_t | length | ||
| ) |
Appends the given bytes to this Data.
| self | The MutableData. |
| bytes | The bytes to append. |
| length | The length of bytes to append. |
Definition at line 53 of file MutableData.c.
| void appendData | ( | MutableData * | self, |
| const Data * | data | ||
| ) |
Appends the given data to this Data.
| self | The MutableData. |
| data | The Data to append. |
Definition at line 66 of file MutableData.c.
| MutableData * data | ( | void | ) |
Returns a new MutableData.
NULL on error. Definition at line 75 of file MutableData.c.
| MutableData * dataWithCapacity | ( | size_t | capacity | ) |
Returns a new MutableData with the given capacity.
| capacity | The desired capacity in bytes. |
NULL on error. Definition at line 84 of file MutableData.c.
| MutableData * init | ( | MutableData * | self | ) |
Initializes this Data with length 0.
| self | The MutableData. |
NULL on error. Definition at line 93 of file MutableData.c.
| MutableData * initWithCapacity | ( | MutableData * | self, |
| size_t | capacity | ||
| ) |
Initializes this Data with the given capacity.
| self | The MutableData. |
| capacity | The capacity in bytes. |
NULL on error. Definition at line 102 of file MutableData.c.
| MutableData * initWithData | ( | MutableData * | self, |
| const Data * | data | ||
| ) |
Initializes this Data with the contents of data.
| self | The MutableData. |
| data | A Data. |
NULL on error. Definition at line 124 of file MutableData.c.
| void setLength | ( | MutableData * | self, |
| size_t | length | ||
| ) |
Sets the length of this Data, truncating or expanding it.
| self | The MutableData. |
| length | The new desired length. |
Definition at line 138 of file MutableData.c.