GL Studio C++ Runtime API
GlsResourceFileMgr Class Reference

#include <gls_resource_file_mgr.h>

Classes

class  AutoRelease
 
class  BinaryResource
 
class  ResourceCache
 
class  ResourceRef
 

Public Member Functions

ResourceRefGetResourceRef (const char *resource_name)
 
bool AddResourceFolder (const char *url, bool silent=false)
 
AutoRelease< ResourceCacheCacheResourcesForComponent (const char *componentClassName)
 

Static Public Member Functions

static GlsResourceFileMgrInstance ()
 

Detailed Description

class GlsResourceFileMgr This class manages all known resource files and provides an API for objects to access the data for a named resource. This allows the runtime code to access required resources without knowing their location. Resources may be stored in individual files, in an archive file, inline data in the source code, RCDATA, etc.

Member Function Documentation

◆ AddResourceFolder()

bool AddResourceFolder ( const char *  url,
bool  silent = false 
)

Tell the resource manager to load resources from the given location This method may be called multiple times to specify multiple locations

Parameters
urlpath to the resources. e.g. "./resources/". This may be a directory or zip file.
silentif false, then a popup is displayed to the user if the location is not found
Returns
true if resources were successfully opened, false otherwise

◆ CacheResourcesForComponent()

AutoRelease< ResourceCache > CacheResourcesForComponent ( const char *  componentClassName)

Loads resources for a given component into RAM. The resources remain cached until the ResourceCache is Released.

Parameters
componentClassNameThe generated class name of the component.
Returns
A reference counted pointer to the resources.

◆ GetResourceRef()

ResourceRef * GetResourceRef ( const char *  resource_name)

Get a reference to a given resource

Parameters
resource_nameThe unique string name of the resource (relative path to the file if using resource folders)
Returns
reference to the resource or NULL if the resource was not found.

◆ Instance()

static GlsResourceFileMgr & Instance ( )
static
Returns
Reference to the GlsResourceFileMgr

The documentation for this class was generated from the following file: