Mesen/Core/LuaCallHelper.h
2017-08-30 18:31:27 -04:00

31 lines
595 B
C++

#pragma once
#include "stdafx.h"
#include "../Lua/lua.hpp"
class LuaCallHelper
{
private:
int _stackSize = 0;
int _paramCount = 0;
int _returnCount = 0;
lua_State* _lua;
public:
LuaCallHelper(lua_State* lua);
void ForceParamCount(int paramCount);
bool CheckParamCount(int minParamCount = -1);
double ReadDouble();
bool ReadBool(bool defaultValue = false);
uint32_t ReadInteger(uint32_t defaultValue = 0);
string ReadString();
int GetReference();
void Return(bool value);
void Return(int value);
void Return(uint32_t value);
void Return(string value);
int ReturnCount();
};