1
0
Files
cuberite-2a/source/LuaScript.h

60 lines
735 B
C
Raw Normal View History

2013-07-29 10:03:42 +02:00
// LuaScript.h
// Declares the cLuaScript class that loads a Lua script file to produce a web template out of it
#pragma once
2013-08-06 19:28:09 +02:00
#include "LuaState.h"
2013-07-29 10:03:42 +02:00
2013-08-06 19:28:09 +02:00
/*
struct sLuaUsertype
{
sLuaUsertype(void* a_pObject, const char* a_pClassName) : Object(a_pObject), ClassName(a_pClassName) {}
//
void* Object;
2013-07-29 10:03:42 +02:00
const char* ClassName;
} ;
2013-08-06 19:28:09 +02:00
*/
// fwd:
class cWebAdmin;
struct HTTPTemplateRequest;
2013-07-29 10:03:42 +02:00
class cLuaScript
{
public:
2013-08-06 19:28:09 +02:00
cLuaScript(void);
/// Prepares a Lua state
2013-08-06 19:28:09 +02:00
void Initialize();
/// Load a Lua script on the given path
2013-08-06 19:28:09 +02:00
bool LoadFile(const char * a_FilePath);
2013-08-06 19:28:09 +02:00
bool CallShowPage(cWebAdmin & a_WebAdmin, HTTPTemplateRequest & a_Request, AString & a_ReturnedString);
protected:
2013-08-06 19:28:09 +02:00
cLuaState m_LuaState;
2013-07-29 10:03:42 +02:00
} ;