From 7f4f11f7e3358c24147e4e534cde33dffde1e590 Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Sat, 9 Jan 2016 19:11:11 +0000 Subject: Mirlua: reading blobs from database git-svn-id: http://svn.miranda-ng.org/main/trunk@16071 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MirLua/src/m_database.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'plugins/MirLua') diff --git a/plugins/MirLua/src/m_database.cpp b/plugins/MirLua/src/m_database.cpp index a8d0a04388..4feab11e57 100644 --- a/plugins/MirLua/src/m_database.cpp +++ b/plugins/MirLua/src/m_database.cpp @@ -206,7 +206,17 @@ static int lua_GetSetting(lua_State *L) case DBVT_WCHAR: lua_pushstring(L, ptrA(mir_utf8encodeW(dbv.pwszVal))); break; - + case DBVT_BLOB: + { + lua_newtable(L); + for (size_t i = 0; i < dbv.cpbVal; i++) + { + lua_pushnumber(L, i + 1); + lua_pushnumber(L, dbv.pbVal[i]); + lua_settable(L, -3); + } + } + break; default: db_free(&dbv); lua_pushvalue(L, 4); @@ -305,7 +315,9 @@ static int lua_WriteSetting(lua_State *L) dbv.pszVal = (char*)lua_tostring(L, 4); dbv.type = DBVT_UTF8; break; - + case LUA_TTABLE: + //this is blob, should be converted to BYTE* + break; default: lua_pushinteger(L, 1); return 1; -- cgit v1.2.3