orx
1.14
Portable Game Engine
|
Data Structures | |
struct | orxRESOURCE_EVENT_PAYLOAD |
struct | orxRESOURCE_TYPE_INFO |
Macros | |
#define | orxRESOURCE_KC_LOCATION_SEPARATOR ':' |
#define | orxRESOURCE_KZ_DEFAULT_STORAGE "." |
#define | orxRESOURCE_KZ_TYPE_TAG_FILE "file" |
Typedefs | |
typedef void(orxFASTCALL * | orxRESOURCE_FUNCTION_CLOSE) (orxHANDLE _hResource) |
typedef orxSTATUS(orxFASTCALL * | orxRESOURCE_FUNCTION_DELETE) (const orxSTRING _zLocation) |
typedef orxS64(orxFASTCALL * | orxRESOURCE_FUNCTION_GET_SIZE) (orxHANDLE _hResource) |
typedef orxS64(orxFASTCALL * | orxRESOURCE_FUNCTION_GET_TIME) (const orxSTRING _zLocation) |
typedef const orxSTRING(orxFASTCALL * | orxRESOURCE_FUNCTION_LOCATE) (const orxSTRING _zGroup, const orxSTRING _zStorage, const orxSTRING _zName, orxBOOL _bRequireExistence) |
typedef orxHANDLE(orxFASTCALL * | orxRESOURCE_FUNCTION_OPEN) (const orxSTRING _zLocation, orxBOOL _bEraseMode) |
typedef orxS64(orxFASTCALL * | orxRESOURCE_FUNCTION_READ) (orxHANDLE _hResource, orxS64 _s64Size, void *_pBuffer) |
typedef orxS64(orxFASTCALL * | orxRESOURCE_FUNCTION_SEEK) (orxHANDLE _hResource, orxS64 _s64Offset, orxSEEK_OFFSET_WHENCE _eWhence) |
typedef orxS64(orxFASTCALL * | orxRESOURCE_FUNCTION_TELL) (orxHANDLE _hResource) |
typedef orxS64(orxFASTCALL * | orxRESOURCE_FUNCTION_WRITE) (orxHANDLE _hResource, orxS64 _s64Size, const void *_pBuffer) |
typedef void(orxFASTCALL * | orxRESOURCE_OP_FUNCTION) (orxHANDLE _hResource, orxS64 _s64Size, void *_pBuffer, void *_pContext) |
Enumerations | |
enum | orxRESOURCE_EVENT { orxRESOURCE_EVENT_UPDATE = 0, orxRESOURCE_EVENT_ADD, orxRESOURCE_EVENT_REMOVE, orxRESOURCE_EVENT_NUMBER, orxRESOURCE_EVENT_NONE = orxENUM_NONE } |
Functions | |
orxDLLAPI orxSTATUS orxFASTCALL | orxResource_AddStorage (const orxSTRING _zGroup, const orxSTRING _zStorage, orxBOOL _bAddFirst) |
orxDLLAPI orxSTATUS orxFASTCALL | orxResource_ClearCache (const orxSTRING _zGroup) |
orxDLLAPI void orxFASTCALL | orxResource_Close (orxHANDLE _hResource) |
orxDLLAPI orxSTATUS orxFASTCALL | orxResource_Delete (const orxSTRING _zLocation) |
orxDLLAPI void orxFASTCALL | orxResource_Exit () |
orxDLLAPI orxU32 orxFASTCALL | orxResource_GetCacheCount (const orxSTRING _zGroup) |
orxDLLAPI const orxSTRING orxFASTCALL | orxResource_GetGroup (orxU32 _u32Index) |
orxDLLAPI orxU32 orxFASTCALL | orxResource_GetGroupCount () |
orxDLLAPI const orxSTRING orxFASTCALL | orxResource_GetLocation (orxHANDLE _hResource) |
orxDLLAPI orxHANDLE orxFASTCALL | orxResource_GetNextCachedLocation (const orxSTRING _zGroup, orxHANDLE _hIterator, const orxSTRING *_pzLocation, const orxSTRING *_pzStorage, const orxSTRING *_pzName) |
orxDLLAPI const orxSTRING orxFASTCALL | orxResource_GetPath (const orxSTRING _zLocation) |
orxDLLAPI orxU32 orxFASTCALL | orxResource_GetPendingOpCount (const orxHANDLE _hResource) |
orxDLLAPI orxS64 orxFASTCALL | orxResource_GetSize (orxHANDLE _hResource) |
orxDLLAPI const orxSTRING orxFASTCALL | orxResource_GetStorage (const orxSTRING _zGroup, orxU32 _u32Index) |
orxDLLAPI orxU32 orxFASTCALL | orxResource_GetStorageCount (const orxSTRING _zGroup) |
orxDLLAPI orxS64 orxFASTCALL | orxResource_GetTime (const orxSTRING _zLocation) |
orxDLLAPI orxU32 orxFASTCALL | orxResource_GetTotalPendingOpCount () |
orxDLLAPI const orxRESOURCE_TYPE_INFO *orxFASTCALL | orxResource_GetType (const orxSTRING _zLocation) |
orxDLLAPI orxU32 orxFASTCALL | orxResource_GetTypeCount () |
orxDLLAPI const orxSTRING orxFASTCALL | orxResource_GetTypeTag (orxU32 _u32Index) |
orxDLLAPI orxSTATUS orxFASTCALL | orxResource_Init () |
orxDLLAPI const orxSTRING orxFASTCALL | orxResource_Locate (const orxSTRING _zGroup, const orxSTRING _zName) |
orxDLLAPI const orxSTRING orxFASTCALL | orxResource_LocateInStorage (const orxSTRING _zGroup, const orxSTRING _zStorage, const orxSTRING _zName) |
orxDLLAPI orxHANDLE orxFASTCALL | orxResource_Open (const orxSTRING _zLocation, orxBOOL _bEraseMode) |
orxDLLAPI orxS64 orxFASTCALL | orxResource_Read (orxHANDLE _hResource, orxS64 _s64Size, void *_pBuffer, orxRESOURCE_OP_FUNCTION _pfnCallback, void *_pContext) |
orxDLLAPI orxSTATUS orxFASTCALL | orxResource_RegisterType (const orxRESOURCE_TYPE_INFO *_pstInfo) |
orxDLLAPI orxSTATUS orxFASTCALL | orxResource_ReloadStorage () |
orxDLLAPI orxSTATUS orxFASTCALL | orxResource_RemoveStorage (const orxSTRING _zGroup, const orxSTRING _zStorage) |
orxDLLAPI orxS64 orxFASTCALL | orxResource_Seek (orxHANDLE _hResource, orxS64 _s64Offset, orxSEEK_OFFSET_WHENCE _eWhence) |
orxDLLAPI void orxFASTCALL | orxResource_Setup () |
orxDLLAPI orxSTATUS orxFASTCALL | orxResource_Sync (const orxSTRING _zGroup) |
orxDLLAPI orxS64 orxFASTCALL | orxResource_Tell (orxHANDLE _hResource) |
orxDLLAPI orxSTATUS orxFASTCALL | orxResource_UnregisterType (const orxSTRING _zTypeTag) |
orxDLLAPI orxS64 orxFASTCALL | orxResource_Write (orxHANDLE _hResource, orxS64 _s64Size, const void *_pBuffer, orxRESOURCE_OP_FUNCTION _pfnCallback, void *_pContext) |
Resource module Module that handles resource mapping
#define orxRESOURCE_KC_LOCATION_SEPARATOR ':' |
Misc
Definition at line 49 of file orxResource.h.
#define orxRESOURCE_KZ_DEFAULT_STORAGE "." |
Definition at line 51 of file orxResource.h.
#define orxRESOURCE_KZ_TYPE_TAG_FILE "file" |
Definition at line 52 of file orxResource.h.
Definition at line 65 of file orxResource.h.
typedef orxSTATUS(orxFASTCALL * orxRESOURCE_FUNCTION_DELETE) (const orxSTRING _zLocation) |
Definition at line 71 of file orxResource.h.
typedef orxS64(orxFASTCALL * orxRESOURCE_FUNCTION_GET_SIZE) (orxHANDLE _hResource) |
Definition at line 66 of file orxResource.h.
typedef orxS64(orxFASTCALL * orxRESOURCE_FUNCTION_GET_TIME) (const orxSTRING _zLocation) |
Definition at line 63 of file orxResource.h.
typedef const orxSTRING(orxFASTCALL * orxRESOURCE_FUNCTION_LOCATE) (const orxSTRING _zGroup, const orxSTRING _zStorage, const orxSTRING _zName, orxBOOL _bRequireExistence) |
Resource handlers
Definition at line 62 of file orxResource.h.
typedef orxHANDLE(orxFASTCALL * orxRESOURCE_FUNCTION_OPEN) (const orxSTRING _zLocation, orxBOOL _bEraseMode) |
Definition at line 64 of file orxResource.h.
typedef orxS64(orxFASTCALL * orxRESOURCE_FUNCTION_READ) (orxHANDLE _hResource, orxS64 _s64Size, void *_pBuffer) |
Definition at line 69 of file orxResource.h.
typedef orxS64(orxFASTCALL * orxRESOURCE_FUNCTION_SEEK) (orxHANDLE _hResource, orxS64 _s64Offset, orxSEEK_OFFSET_WHENCE _eWhence) |
Definition at line 67 of file orxResource.h.
typedef orxS64(orxFASTCALL * orxRESOURCE_FUNCTION_TELL) (orxHANDLE _hResource) |
Definition at line 68 of file orxResource.h.
typedef orxS64(orxFASTCALL * orxRESOURCE_FUNCTION_WRITE) (orxHANDLE _hResource, orxS64 _s64Size, const void *_pBuffer) |
Definition at line 70 of file orxResource.h.
typedef void(orxFASTCALL * orxRESOURCE_OP_FUNCTION) (orxHANDLE _hResource, orxS64 _s64Size, void *_pBuffer, void *_pContext) |
Resource asynchronous operation callback function
Definition at line 57 of file orxResource.h.
enum orxRESOURCE_EVENT |
Event enum
Enumerator | |
---|---|
orxRESOURCE_EVENT_UPDATE | |
orxRESOURCE_EVENT_ADD | |
orxRESOURCE_EVENT_REMOVE | |
orxRESOURCE_EVENT_NUMBER | |
orxRESOURCE_EVENT_NONE |
Definition at line 93 of file orxResource.h.
orxDLLAPI orxSTATUS orxFASTCALL orxResource_AddStorage | ( | const orxSTRING | _zGroup, |
const orxSTRING | _zStorage, | ||
orxBOOL | _bAddFirst | ||
) |
Adds a storage for a given resource group
[in] | _zGroup | Concerned resource group |
[in] | _zStorage | Description of the storage, as understood by one of the resource type |
[in] | _bAddFirst | If true this storage will be used before any already added ones, otherwise it'll be used after all those |
Clears cache for specific resource group(s)
[in] | _zGroup | Concerned resource group, orxNULL for all groups |
Closes a resource
[in] | _hResource | Concerned resource |
Deletes a resource, given its location
[in] | _zLocation | Location of the resource to delete |
orxDLLAPI orxU32 orxFASTCALL orxResource_GetCacheCount | ( | const orxSTRING | _zGroup | ) |
Gets the cached location count for a given group
[in] | _zGroup | Concerned resource group |
orxDLLAPI const orxSTRING orxFASTCALL orxResource_GetGroup | ( | orxU32 | _u32Index | ) |
Gets resource group at given index
[in] | _u32Index | Index of resource group |
orxDLLAPI orxU32 orxFASTCALL orxResource_GetGroupCount | ( | ) |
Gets number of resource groups
Gets the literal location of a resource
[in] | _hResource | Concerned resource |
orxDLLAPI orxHANDLE orxFASTCALL orxResource_GetNextCachedLocation | ( | const orxSTRING | _zGroup, |
orxHANDLE | _hIterator, | ||
const orxSTRING * | _pzLocation, | ||
const orxSTRING * | _pzStorage, | ||
const orxSTRING * | _pzName | ||
) |
Gets the next cached location for the given group and returns an iterator for next search
[in] | _zGroup | Concerned resource group |
[in] | _hIterator | Iterator from previous search or orxHANDLE_UNDEFINED/orxNULL for a new search |
[out] | _pzLocation | Current resource's location, orxNULL to ignore |
[out] | _pzStorage | Current resource's storage, orxNULL to ignore |
[out] | _pzName | Current resource's name, orxNULL to ignore |
orxDLLAPI const orxSTRING orxFASTCALL orxResource_GetPath | ( | const orxSTRING | _zLocation | ) |
Gets the resource path from a location
[in] | _zLocation | Location of the concerned resource |
Gets pending operation count for a given resource
[in] | _hResource | Concerned resource |
Gets the size, in bytes, of a resource
[in] | _hResource | Concerned resource |
orxDLLAPI const orxSTRING orxFASTCALL orxResource_GetStorage | ( | const orxSTRING | _zGroup, |
orxU32 | _u32Index | ||
) |
Gets storage at given index for a given resource group
[in] | _zGroup | Concerned resource group |
[in] | _u32Index | Index of storage |
orxDLLAPI orxU32 orxFASTCALL orxResource_GetStorageCount | ( | const orxSTRING | _zGroup | ) |
Gets number of storages for a given resource group
[in] | _zGroup | Concerned resource group |
orxDLLAPI orxS64 orxFASTCALL orxResource_GetTime | ( | const orxSTRING | _zLocation | ) |
Gets the time of last modification of a resource
[in] | _zLocation | Location of the concerned resource |
orxDLLAPI orxU32 orxFASTCALL orxResource_GetTotalPendingOpCount | ( | ) |
Gets total pending operation count
orxDLLAPI const orxRESOURCE_TYPE_INFO* orxFASTCALL orxResource_GetType | ( | const orxSTRING | _zLocation | ) |
Gets the resource type from a location
[in] | _zLocation | Location of the concerned resource |
orxDLLAPI orxU32 orxFASTCALL orxResource_GetTypeCount | ( | ) |
Gets number of registered resource types
orxDLLAPI const orxSTRING orxFASTCALL orxResource_GetTypeTag | ( | orxU32 | _u32Index | ) |
Gets registered type tag at given index
[in] | _u32Index | Index of storage |
Inits the resource module
orxDLLAPI const orxSTRING orxFASTCALL orxResource_Locate | ( | const orxSTRING | _zGroup, |
const orxSTRING | _zName | ||
) |
Gets the location of an existing resource for a given group, location gets cached if found
[in] | _zGroup | Concerned resource group |
[in] | _zName | Name of the resource to locate |
orxDLLAPI const orxSTRING orxFASTCALL orxResource_LocateInStorage | ( | const orxSTRING | _zGroup, |
const orxSTRING | _zStorage, | ||
const orxSTRING | _zName | ||
) |
Gets the location for a resource (existing or not) in a specific storage, for a given group. The location doesn't get cached and thus needs to be copied by the caller before the next call
[in] | _zGroup | Concerned resource group |
[in] | _zStorage | Concerned storage, if orxNULL then the highest priority storage will be used |
[in] | _zName | Name of the resource |
orxDLLAPI orxHANDLE orxFASTCALL orxResource_Open | ( | const orxSTRING | _zLocation, |
orxBOOL | _bEraseMode | ||
) |
Opens the resource at the given location
[in] | _zLocation | Location of the resource to open |
[in] | _bEraseMode | If true, the file will be erased if existing or created otherwise, if false, no content will get destroyed when opening |
orxDLLAPI orxS64 orxFASTCALL orxResource_Read | ( | orxHANDLE | _hResource, |
orxS64 | _s64Size, | ||
void * | _pBuffer, | ||
orxRESOURCE_OP_FUNCTION | _pfnCallback, | ||
void * | _pContext | ||
) |
Reads data from a resource
[in] | _hResource | Concerned resource |
[in] | _s64Size | Size to read (in bytes) |
[out] | _pBuffer | Buffer that will be filled by the read data |
[in] | _pfnCallback | Callback that will get called after asynchronous operation; if orxNULL, operation will be synchronous |
[in] | _pContext | Context that will be transmitted to the callback when called |
orxDLLAPI orxSTATUS orxFASTCALL orxResource_RegisterType | ( | const orxRESOURCE_TYPE_INFO * | _pstInfo | ) |
Registers a new resource type
[in] | _pstInfo | Info describing the new resource type and how to handle it |
Reloads storage from config
orxDLLAPI orxSTATUS orxFASTCALL orxResource_RemoveStorage | ( | const orxSTRING | _zGroup, |
const orxSTRING | _zStorage | ||
) |
Removes storage(s) for specific resource group(s)
[in] | _zGroup | Concerned resource group, orxNULL for all groups |
[in] | _zStorage | Concerned storage, orxNULL for all storages (except default one) |
orxDLLAPI orxS64 orxFASTCALL orxResource_Seek | ( | orxHANDLE | _hResource, |
orxS64 | _s64Offset, | ||
orxSEEK_OFFSET_WHENCE | _eWhence | ||
) |
Seeks a position in a given resource (moves cursor)
[in] | _hResource | Concerned resource |
[in] | _s64Offset | Number of bytes to offset from 'origin' |
[in] | _eWhence | Starting point for the offset computation (start, current position or end) |
Syncs all cached resources for specific resource group(s): update, add or remove events will be sent for all resources that are not located in their original storage anymore
[in] | _zGroup | Concerned resource group, orxNULL for all groups |
Tells the position of the cursor in a given resource
[in] | _hResource | Concerned resource |
Unregisters a resource type
[in] | _zTypeTag | Tag of the resource type to unregister |
orxDLLAPI orxS64 orxFASTCALL orxResource_Write | ( | orxHANDLE | _hResource, |
orxS64 | _s64Size, | ||
const void * | _pBuffer, | ||
orxRESOURCE_OP_FUNCTION | _pfnCallback, | ||
void * | _pContext | ||
) |
Writes data to a resource
[in] | _hResource | Concerned resource |
[in] | _s64Size | Size to write (in bytes) |
[out] | _pBuffer | Buffer that will be written |
[in] | _pfnCallback | Callback that will get called after asynchronous operation; if orxNULL, operation will be synchronous |
[in] | _pContext | Context that will be transmitted to the callback when called |