mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Tweaks
This commit is contained in:
parent
fdcd5a9757
commit
438f79bf5d
@ -75,8 +75,14 @@ void LuaManager::ReportErrors(lua_State* L, const std::wstring& file)
|
|||||||
|
|
||||||
void LuaManager::PushWide(lua_State* L, const WCHAR* str)
|
void LuaManager::PushWide(lua_State* L, const WCHAR* str)
|
||||||
{
|
{
|
||||||
const std::string tmpStr = StringUtil::Narrow(str);
|
const std::string narrowStr = StringUtil::Narrow(str);
|
||||||
lua_pushlstring(L, tmpStr.c_str(), tmpStr.length());
|
lua_pushlstring(L, narrowStr.c_str(), narrowStr.length());
|
||||||
|
}
|
||||||
|
|
||||||
|
void LuaManager::PushWide(lua_State* L, const std::wstring& str)
|
||||||
|
{
|
||||||
|
const std::string narrowStr = StringUtil::Narrow(str);
|
||||||
|
lua_pushlstring(L, narrowStr.c_str(), narrowStr.length());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::wstring LuaManager::ToWide(lua_State* L, int narg)
|
std::wstring LuaManager::ToWide(lua_State* L, int narg)
|
||||||
|
@ -37,6 +37,7 @@ public:
|
|||||||
static void ReportErrors(lua_State* L, const std::wstring& file);
|
static void ReportErrors(lua_State* L, const std::wstring& file);
|
||||||
|
|
||||||
static void PushWide(lua_State* L, const WCHAR* str);
|
static void PushWide(lua_State* L, const WCHAR* str);
|
||||||
|
static void PushWide(lua_State* L, const std::wstring& str);
|
||||||
static std::wstring ToWide(lua_State* L, int narg);
|
static std::wstring ToWide(lua_State* L, int narg);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -43,7 +43,7 @@ static int GetOption(lua_State* L)
|
|||||||
std::wstring strTmp = LuaManager::ToWide(L, 2);
|
std::wstring strTmp = LuaManager::ToWide(L, 2);
|
||||||
strTmp = parser.ReadString(self->GetName(), strTmp.c_str(), LuaManager::ToWide(L, 3).c_str());
|
strTmp = parser.ReadString(self->GetName(), strTmp.c_str(), LuaManager::ToWide(L, 3).c_str());
|
||||||
|
|
||||||
LuaManager::PushWide(L, strTmp.c_str());
|
LuaManager::PushWide(L, strTmp);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ static int GetOption(lua_State* L)
|
|||||||
std::wstring strTmp = LuaManager::ToWide(L, 2);
|
std::wstring strTmp = LuaManager::ToWide(L, 2);
|
||||||
strTmp = parser.ReadString(self->GetName(), strTmp.c_str(), L"");
|
strTmp = parser.ReadString(self->GetName(), strTmp.c_str(), L"");
|
||||||
|
|
||||||
LuaManager::PushWide(L, strTmp.c_str());
|
LuaManager::PushWide(L, strTmp);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ static int GetVariable(lua_State* L)
|
|||||||
const std::wstring* value = self->GetParser().GetVariable(strTmp);
|
const std::wstring* value = self->GetParser().GetVariable(strTmp);
|
||||||
if (value)
|
if (value)
|
||||||
{
|
{
|
||||||
LuaManager::PushWide(L, (*value).c_str());
|
LuaManager::PushWide(L, *value);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -128,7 +128,7 @@ static int ReplaceVariables(lua_State* L)
|
|||||||
|
|
||||||
self->GetParser().ReplaceVariables(strTmp);
|
self->GetParser().ReplaceVariables(strTmp);
|
||||||
self->GetParser().ReplaceMeasures(strTmp);
|
self->GetParser().ReplaceMeasures(strTmp);
|
||||||
LuaManager::PushWide(L, strTmp.c_str());
|
LuaManager::PushWide(L, strTmp);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -206,7 +206,7 @@ static int MakePathAbsolute(lua_State* L)
|
|||||||
DECLARE_SELF(L)
|
DECLARE_SELF(L)
|
||||||
std::wstring path = LuaManager::ToWide(L, 2);
|
std::wstring path = LuaManager::ToWide(L, 2);
|
||||||
self->MakePathAbsolute(path);
|
self->MakePathAbsolute(path);
|
||||||
LuaManager::PushWide(L, path.c_str());
|
LuaManager::PushWide(L, path);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user