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

path info impl More...

#include "ZFImpl_ZFLua.h"

Go to the source code of this file.

Macros

#define ZFImpl_ZFLua_implPathInfo_DEFINE(luaFunc, luaFuncBody)
 

Functions

void ZFImpl_ZFLua_implPathInfoSetup (lua_State *L, zfstring &ret, const ZFPathInfo &pathInfo, zfbool localMode=_ZFT_t_zftrue)
 setup path info for lua execute
 
zfbool ZFImpl_ZFLua_implPathInfoExist (const zfchar *luaFuncName)
 check whether luaFuncName registered
 
const ZFCoreArray< zfstring > & ZFImpl_ZFLua_implPathInfoList (void)
 return luaFuncName list registered
 

Detailed Description

path info impl

Macro Definition Documentation

◆ ZFImpl_ZFLua_implPathInfo_DEFINE

#define ZFImpl_ZFLua_implPathInfo_DEFINE ( luaFunc,
luaFuncBody )

Function Documentation

◆ ZFImpl_ZFLua_implPathInfoSetup()

void ZFImpl_ZFLua_implPathInfoSetup ( lua_State * L,
zfstring & ret,
const ZFPathInfo & pathInfo,
zfbool localMode = _ZFT_t_zftrue )
extern

setup path info for lua execute

how it works:
lua does not have any way to append additional user data to chunk, so we hack it by appending extra code before each ZFLuaExecute, to setup some path info related datas, to return a ZFPathInfo

impl may use ZFImpl_ZFLua_implPathInfo_DEFINE to append extra contents, the final extra code may be something look like this:

-- in global scope
function _ZFP_l(zfl_l)
return
function (...) -- appended by module xxx
return xxxAction(zfl_l)
end,
function (...) -- appended by module yyy
return yyyAction(zfl_l)
end,
nil
end
-- in local scope
local xxx,yyy = _ZFP_l(ZFPathInfo(pathType, pathData));
-- after the above code,
-- the xxx() and yyy() call should call the local version with local path info
xxx()
yyy()
path related info storage for impl, actual meaning of the info depends on impl
Definition ZFPathInfo.h:35
// in cpp code
"function(...) return xxxAction(zfl_l) end"
)
#define ZFImpl_ZFLua_implPathInfo_DEFINE(luaFunc, luaFuncBody)
Definition ZFImpl_ZFLua_PathInfo.h:65