1
0

Don't return const ref params and removed functions from

ManualBindings.cpp
This commit is contained in:
Lukas Pioch 2017-05-01 10:31:18 +02:00
parent 9842896574
commit 74e6f41958
3 changed files with 11 additions and 101 deletions

@ -1 +1 @@
Subproject commit 80c2548acafc8d26c2612a33305f5e2f07fe9d34 Subproject commit e3b59e5edcf461fad05bb40a65e8b14d4492214d

View File

@ -2243,90 +2243,6 @@ static int tolua_cWebAdmin_GetAllWebTabs(lua_State * tolua_S)
/** Binding for cWebAdmin::GetBaseURL.
Manual code required because ToLua generates an extra return value */
static int tolua_cWebAdmin_GetBaseURL(lua_State * tolua_S)
{
// Check the param types:
cLuaState S(tolua_S);
if (
// Don't care whether the first param is a cWebAdmin instance or class
!S.CheckParamString(2) ||
!S.CheckParamEnd(3)
)
{
return 0;
}
// Get the parameters:
AString Input;
S.GetStackValue(2, Input);
// Convert and return:
S.Push(cWebAdmin::GetBaseURL(Input));
return 1;
}
/** Binding for cWebAdmin::GetContentTypeFromFileExt.
Manual code required because ToLua generates an extra return value */
static int tolua_cWebAdmin_GetContentTypeFromFileExt(lua_State * tolua_S)
{
// Check the param types:
cLuaState S(tolua_S);
if (
// Don't care whether the first param is a cWebAdmin instance or class
!S.CheckParamString(2) ||
!S.CheckParamEnd(3)
)
{
return 0;
}
// Get the parameters:
AString Input;
S.GetStackValue(2, Input);
// Convert and return:
S.Push(cWebAdmin::GetContentTypeFromFileExt(Input));
return 1;
}
/** Binding for cWebAdmin::GetHTMLEscapedString.
Manual code required because ToLua generates an extra return value */
static int tolua_cWebAdmin_GetHTMLEscapedString(lua_State * tolua_S)
{
// Check the param types:
cLuaState S(tolua_S);
if (
// Don't care whether the first param is a cWebAdmin instance or class
!S.CheckParamString(2) ||
!S.CheckParamEnd(3)
)
{
return 0;
}
// Get the parameters:
AString Input;
S.GetStackValue(2, Input);
// Convert and return:
S.Push(cWebAdmin::GetHTMLEscapedString(Input));
return 1;
}
/** Binding for cWebAdmin::GetPage. */ /** Binding for cWebAdmin::GetPage. */
static int tolua_cWebAdmin_GetPage(lua_State * tolua_S) static int tolua_cWebAdmin_GetPage(lua_State * tolua_S)
{ {
@ -4096,9 +4012,6 @@ void cManualBindings::Bind(lua_State * tolua_S)
tolua_beginmodule(tolua_S, "cWebAdmin"); tolua_beginmodule(tolua_S, "cWebAdmin");
tolua_function(tolua_S, "AddWebTab", tolua_cWebAdmin_AddWebTab); tolua_function(tolua_S, "AddWebTab", tolua_cWebAdmin_AddWebTab);
tolua_function(tolua_S, "GetAllWebTabs", tolua_cWebAdmin_GetAllWebTabs); tolua_function(tolua_S, "GetAllWebTabs", tolua_cWebAdmin_GetAllWebTabs);
tolua_function(tolua_S, "GetBaseURL", tolua_cWebAdmin_GetBaseURL);
tolua_function(tolua_S, "GetContentTypeFromFileExt", tolua_cWebAdmin_GetContentTypeFromFileExt);
tolua_function(tolua_S, "GetHTMLEscapedString", tolua_cWebAdmin_GetHTMLEscapedString);
tolua_function(tolua_S, "GetPage", tolua_cWebAdmin_GetPage); tolua_function(tolua_S, "GetPage", tolua_cWebAdmin_GetPage);
tolua_function(tolua_S, "GetURLEncodedString", tolua_cWebAdmin_GetURLEncodedString); tolua_function(tolua_S, "GetURLEncodedString", tolua_cWebAdmin_GetURLEncodedString);
tolua_endmodule(tolua_S); tolua_endmodule(tolua_S);

View File

@ -192,6 +192,16 @@ public:
/** Returns the list of ports on which the webadmin is configured to listen. */ /** Returns the list of ports on which the webadmin is configured to listen. */
AString GetPorts(void) const { return StringsConcat(m_Ports, ','); } AString GetPorts(void) const { return StringsConcat(m_Ports, ','); }
/** Returns the prefix needed for making a link point to the webadmin root from the given URL ("../../../webadmin"-style). */
static AString GetBaseURL(const AString & a_URL);
/** Returns the content type from the file extension.
If the extension isn't in the list, the function returns an empty string. */
static AString GetContentTypeFromFileExt(const AString & a_FileExtension);
/** Escapes text passed into it, so it can be embedded into html. */
static AString GetHTMLEscapedString(const AString & a_Input);
// tolua_end // tolua_end
/** Adds a new WebTab handler. /** Adds a new WebTab handler.
@ -212,26 +222,13 @@ public:
Exported in ManualBindings.cpp */ Exported in ManualBindings.cpp */
bool DelWebTab(const AString & a_UrlPath); bool DelWebTab(const AString & a_UrlPath);
/** Escapes text passed into it, so it can be embedded into html.
Exported to Lua in ManualBindings.cpp. */
static AString GetHTMLEscapedString(const AString & a_Input);
/** Escapes the string for use in an URL /** Escapes the string for use in an URL
Exported to Lua in ManualBindings.cpp. */ Exported to Lua in ManualBindings.cpp. */
static AString GetURLEncodedString(const AString & a_Input); static AString GetURLEncodedString(const AString & a_Input);
/** Returns the prefix needed for making a link point to the webadmin root from the given URL ("../../../webadmin"-style).
Exported to Lua in ManualBindings.cpp. */
static AString GetBaseURL(const AString & a_URL);
/** Returns the prefix needed for making a link point to the webadmin root from the given URL ("../../../webadmin"-style) */ /** Returns the prefix needed for making a link point to the webadmin root from the given URL ("../../../webadmin"-style) */
static AString GetBaseURL(const AStringVector & a_URLSplit); static AString GetBaseURL(const AStringVector & a_URLSplit);
/** Returns the content type from the file extension.
If the extension isn't in the list, the function returns an empty string.
Exported to Lua in ManualBindings.cpp. */
static AString GetContentTypeFromFileExt(const AString & a_FileExtension);
protected: protected:
/** Protects m_WebTabs, m_TemplateScript, m_LoginTemplate and m_IniFile against multithreaded access. */ /** Protects m_WebTabs, m_TemplateScript, m_LoginTemplate and m_IniFile against multithreaded access. */