1
0
cuberite-2a/source/cWebPlugin.h
faketruth 7c84349990 WebAdmin should not cause crashes anymore
Got rid of cWebPlugin_Lua
cPlugin_Lua is also a cWebPlugin now, so plugins don't need a separate cWebPlugin object
Changed some stuff to use AString instead of char*

git-svn-id: http://mc-server.googlecode.com/svn/trunk@777 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-22 14:22:21 +00:00

38 lines
772 B
C++

#pragma once
struct lua_State;
struct HTTPRequest;
//tolua_begin
class cWebPlugin
{
public:
cWebPlugin();
virtual ~cWebPlugin();
void SetName( std::string a_Name ) { m_Name = a_Name; }
std::string GetName() { return m_Name; }
virtual std::string HandleWebRequest( HTTPRequest* a_Request ) = 0;
static AString SafeString( const AString & a_String );
//tolua_end
struct sWebPluginTab
{
std::string Title;
std::string SafeTitle;
int UserData;
};
typedef std::list< sWebPluginTab* > TabList;
TabList & GetTabs() { return m_Tabs; }
std::list< std::pair<std::string, std::string> > GetTabNames();
std::pair< std::string, std::string > GetTabNameForRequest( HTTPRequest* a_Request );
private:
TabList m_Tabs;
std::string m_Name;
}; //tolua_export