Objectively 1.0.0
Ultra-lightweight object oriented framework for GNU C.
|
#include <Resource.h>
Resources provide an abstraction for file and stream resources.
Definition at line 53 of file Resource.h.
Properties | |
Data * | data |
The resource data. More... | |
char * | name |
The resource name. More... | |
Object | object |
The superclass. More... | |
![]() | |
Class * | clazz |
Every instance of Object begins with a pointer to its Class. More... | |
Methods | |
Class * | _Resource (void) |
The Resource archetype. More... | |
void | addResourcePath (const char *path) |
Adds the specified Resource path. More... | |
void | addResourceProvider (ResourceProvider provider) |
Adds the specified ResourceProvider. More... | |
Resource * | initWithBytes (Resource *self, const uint8_t *bytes, size_t length, const char *name) |
Initializes this Resource with the specified bytes. More... | |
Resource * | initWithData (Resource *self, Data *data) |
Resource * | initWithData (Resource *self, Data *data, const char *name) |
Initializes this Resource with the specified Data. More... | |
Resource * | initWithName (Resource *self, const char *name) |
Initializes this Resource with the specified name . More... | |
void | removeResourcePath (const char *path) |
Removes the specified Resource path. More... | |
void | removeResourceProvider (ResourceProvider provider) |
Removes the specified ResourceProvider. More... | |
Resource * | resourceWithName (const char *name) |
Returns a new Resource with the specified name . More... | |
![]() | |
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 | |
ResourceInterface * | interface |
The interface. More... | |
![]() | |
ObjectInterface * | interface |
The interface. More... | |
Data* Resource::data | ( | void | ) |
The resource data.
Definition at line 69 of file Resource.h.
|
protected |
The interface.
Definition at line 64 of file Resource.h.
char* Resource::name |
The resource name.
Definition at line 74 of file Resource.h.
Object Resource::object |
The superclass.
Definition at line 58 of file Resource.h.
Class * _Resource | ( | void | ) |
The Resource archetype.
Definition at line 241 of file Resource.c.
void addResourcePath | ( | const char * | path | ) |
Adds the specified Resource path.
path | The resource path to add. |
Definition at line 61 of file Resource.c.
void addResourceProvider | ( | ResourceProvider | provider | ) |
Adds the specified ResourceProvider.
provider | The ResoureProvider to add. |
Definition at line 74 of file Resource.c.
Resource * initWithBytes | ( | Resource * | self, |
const uint8_t * | bytes, | ||
size_t | length, | ||
const char * | name | ||
) |
Initializes this Resource with the specified bytes.
self | The Resource. |
bytes | The bytes. |
length | The length of bytes. |
name | The resource name. |
NULL
on error. Definition at line 87 of file Resource.c.
Initializes this Resource with the specified Data.
NULL
on error. Definition at line 100 of file Resource.c.
Initializes this Resource with the specified name
.
self | The Resource. |
name | The resource name. |
NULL
on error.The configured resource paths are searched, in order, for a file by the given name.
Definition at line 118 of file Resource.c.
void removeResourcePath | ( | const char * | path | ) |
Removes the specified Resource path.
path | The resource path to remove. |
Definition at line 158 of file Resource.c.
void removeResourceProvider | ( | ResourceProvider | provider | ) |
Removes the specified ResourceProvider.
provider | The ResourceProvider to remove. |
Definition at line 171 of file Resource.c.
Resource * resourceWithName | ( | const char * | name | ) |
Returns a new Resource with the specified name
.
name | The resource name. |
NULL
on error. Definition at line 184 of file Resource.c.