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