ZFFramework
 
Loading...
Searching...
No Matches
ZFResCache.h File Reference

utility to load serializable from resource with cache logic More...

#include "ZFCache.h"

Go to the source code of this file.

Classes

class  ZFResCache
 cache for serializable from resources More...
 

Functions

zfauto zfres (const zfchar *resFilePath, const ZFPathInfo &pathInfo=(zft_zfnull))
 load resource by ZFObjectIOLoad
 
zfauto zfres (const ZFInput &input)
 load resource by ZFObjectIOLoad with specified input
 
zfauto zfres (const ZFInput &input, const ZFListener &loadImpl)
 load resource with custom impl with specified input
 

Detailed Description

utility to load serializable from resource with cache logic

Function Documentation

◆ zfres() [1/3]

zfauto zfres ( const zfchar * resFilePath,
const ZFPathInfo & pathInfo = (zft_zfnull) )
extern

load resource by ZFObjectIOLoad

automatically cache the resource in ZFResCache, you should not modified the returned object

when pathInfo is specified, the resFilePath can be relative path to pathInfo, at this case, the pathInfo must be well formed

◆ zfres() [2/3]

zfauto zfres ( const ZFInput & input)
extern

load resource by ZFObjectIOLoad with specified input

automatically cache result in ZFResCache with ZFCallback::callbackId as cache key

◆ zfres() [3/3]

zfauto zfres ( const ZFInput & input,
const ZFListener & loadImpl )
extern

load resource with custom impl with specified input

automatically cache result in ZFResCache with ZFCallback::callbackId as cache key
loadImpl's sender is the source ZFInput, and must set ZFArgs::result if load success