sgRessourceManager Namespace Reference
Detailed Description
Ressource manager namespace. Manages the system memory and automatically frees registered objects.
Function Documentation
void sgRessourceManager::addRessource |
( |
sgBase * |
ress |
) |
|
Add ressource. Adds a ressource to the ressource manager which will be freed automatically.
- Parameters:
-
| ress | pointer to the ressource to add |
void sgRessourceManager::addRessource |
( |
const char * |
name, |
|
|
sgBase * |
ress | |
|
) |
| | |
Add ressource. Adds a ressource to the ressource manager which will be freed automatically.
- Parameters:
-
| name | the name to add the ressource with |
| ress | pointer to the ressource to add |
void sgRessourceManager::destroyAll |
( |
|
) |
|
Destroy all. Frees all ressources.
const char * sgRessourceManager::getFileAsString |
( |
const char * |
filepath |
) |
|
Get file content. Reads a file and returns its content as a string.
- Parameters:
-
| filepath | the path to the file |
- Returns:
- the files content string
const char * sgRessourceManager::getPath |
( |
const char * |
filename, |
|
|
const char * |
type | |
|
) |
| | |
Get path. Get the path of a file in the filesystem.
- Parameters:
-
| filename | the name of the file without type specifier |
| type | the type specifier |
- Returns:
- the path to the given file
sgBase * sgRessourceManager::getRessource |
( |
const char * |
name |
) |
|
Get ressource. Reads a file and returns its content as a string.
- Parameters:
-
| name | the name of the ressource |
- Returns:
- pointer to the instance or NULL if there is none
void sgRessourceManager::removeRessource |
( |
sgBase * |
ress |
) |
|
Remove ressource. Removes a ressource from the ressource manager.
- Parameters:
-
| ress | pointer to the ressource to remove |