summaryrefslogtreecommitdiffstats
path: root/src/Bindings/ManualBindings.cpp
diff options
context:
space:
mode:
authorflx5 <git@flx5.com>2015-03-11 20:02:11 +0100
committerflx5 <git@flx5.com>2015-03-11 20:02:11 +0100
commitf6912bd01c80a1031c1d0f69a87eca4f0990da66 (patch)
treed8b603551c2924a4d25289c5fcb767f3cef6c669 /src/Bindings/ManualBindings.cpp
parentFixed issue with quotes not appearing in pairs (diff)
downloadcuberite-f6912bd01c80a1031c1d0f69a87eca4f0990da66.tar
cuberite-f6912bd01c80a1031c1d0f69a87eca4f0990da66.tar.gz
cuberite-f6912bd01c80a1031c1d0f69a87eca4f0990da66.tar.bz2
cuberite-f6912bd01c80a1031c1d0f69a87eca4f0990da66.tar.lz
cuberite-f6912bd01c80a1031c1d0f69a87eca4f0990da66.tar.xz
cuberite-f6912bd01c80a1031c1d0f69a87eca4f0990da66.tar.zst
cuberite-f6912bd01c80a1031c1d0f69a87eca4f0990da66.zip
Diffstat (limited to 'src/Bindings/ManualBindings.cpp')
-rw-r--r--src/Bindings/ManualBindings.cpp33
1 files changed, 18 insertions, 15 deletions
diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp
index 435d72eb9..40ac12b41 100644
--- a/src/Bindings/ManualBindings.cpp
+++ b/src/Bindings/ManualBindings.cpp
@@ -268,12 +268,15 @@ static int tolua_StringSplit(lua_State * tolua_S)
static int tolua_StringSplitWithQuotes(lua_State * tolua_S)
{
- cLuaState LuaState(tolua_S);
- std::string str = (std::string)tolua_tocppstring(LuaState, 1, 0);
- std::string delim = (std::string)tolua_tocppstring(LuaState, 2, 0);
+ cLuaState S(tolua_S);
+
+ AString str;
+ AString delim;
+
+ S.GetStackValues(1, str, delim);
AStringVector Split = StringSplitWithQuotes(str, delim);
- LuaState.Push(Split);
+ S.Push(Split);
return 1;
}
@@ -3676,18 +3679,18 @@ void ManualBindings::Bind(lua_State * tolua_S)
tolua_cclass(tolua_S, "cStringCompression", "cStringCompression", "", nullptr);
// Globals:
- tolua_function(tolua_S, "Clamp", tolua_Clamp);
- tolua_function(tolua_S, "StringSplit", tolua_StringSplit);
+ tolua_function(tolua_S, "Clamp", tolua_Clamp);
+ tolua_function(tolua_S, "StringSplit", tolua_StringSplit);
tolua_function(tolua_S, "StringSplitWithQuotes", tolua_StringSplitWithQuotes);
- tolua_function(tolua_S, "StringSplitAndTrim", tolua_StringSplitAndTrim);
- tolua_function(tolua_S, "LOG", tolua_LOG);
- tolua_function(tolua_S, "LOGINFO", tolua_LOGINFO);
- tolua_function(tolua_S, "LOGWARN", tolua_LOGWARN);
- tolua_function(tolua_S, "LOGWARNING", tolua_LOGWARN);
- tolua_function(tolua_S, "LOGERROR", tolua_LOGERROR);
- tolua_function(tolua_S, "Base64Encode", tolua_Base64Encode);
- tolua_function(tolua_S, "Base64Decode", tolua_Base64Decode);
- tolua_function(tolua_S, "md5", tolua_md5_obsolete); // OBSOLETE, use cCryptoHash.md5() instead
+ tolua_function(tolua_S, "StringSplitAndTrim", tolua_StringSplitAndTrim);
+ tolua_function(tolua_S, "LOG", tolua_LOG);
+ tolua_function(tolua_S, "LOGINFO", tolua_LOGINFO);
+ tolua_function(tolua_S, "LOGWARN", tolua_LOGWARN);
+ tolua_function(tolua_S, "LOGWARNING", tolua_LOGWARN);
+ tolua_function(tolua_S, "LOGERROR", tolua_LOGERROR);
+ tolua_function(tolua_S, "Base64Encode", tolua_Base64Encode);
+ tolua_function(tolua_S, "Base64Decode", tolua_Base64Decode);
+ tolua_function(tolua_S, "md5", tolua_md5_obsolete); // OBSOLETE, use cCryptoHash.md5() instead
tolua_beginmodule(tolua_S, "cFile");
tolua_function(tolua_S, "GetFolderContents", tolua_cFile_GetFolderContents);