Main Page | Namespace List | Class Hierarchy | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages

LuaUtils.hpp

Go to the documentation of this file.
00001 #ifndef LuaUtils_HPP
00002 #define LuaUtils_HPP
00003 
00004 #include <string>
00005 #include<vector>
00006 
00007 
00008 
00009 
00010 extern "C" {
00011 #include <lua.h>
00012 }
00013 
00014 using std::string;
00015 using std::vector;
00016 
00017 
00025 class LuaUtils{
00026 
00027   private:
00028    
00029     //FIXME: COMMENT ME!!!!
00030     static int convertStackIndex(struct lua_State * state, int stackIndex);
00031 
00032   public:
00033 
00034 
00042     static std::string getStringFromTable(struct lua_State * state, const char * key);
00043 
00044 
00045     static int getIntFromTable(struct lua_State * state, const char * key);
00046 
00055     static void setFieldOnTable(struct lua_State * state,
00056                                 const char * key,
00057                                 const char * value,
00058                                 int tableIndexOnStack);
00059 
00068     static void setFieldOnTable(struct lua_State * state,
00069                                 string key,
00070                                 string value,
00071                                 int tableIndexOnStack){
00072        LuaUtils::setFieldOnTable(state, key.c_str(), value.c_str(), tableIndexOnStack);
00073 
00074     }
00075 
00076 
00085     static void setFieldOnTable(struct lua_State * state,
00086                                 const char * key,
00087                                 double value,
00088                                 int tableIndexOnStack);
00089 
00098     static void setFieldOnTable(struct lua_State * state,
00099                                 string key,
00100                                 double value,
00101                                 int tableIndexOnStack){
00102 
00103       LuaUtils::setFieldOnTable(state, key.c_str(), value, tableIndexOnStack);
00104     }
00105 
00106 
00107 
00116     static void writeFile(struct lua_State * state,
00117                                     std::string fileName,
00118                                     int stackIndex);
00119 
00120     //FIXME: COMMENT ME!!!!
00121     static void openFileForRead(struct lua_State * state,
00122                          std::string fileName);
00123 
00124     static void openFileForWrite(struct lua_State * state,
00125                          std::string fileName);
00126 
00127 
00128     //FIXME: COMMENT ME!!!!
00129     static void closeDefaultFile(struct lua_State * state);
00130 
00131     //FIXME: COMMENT ME!!!!
00132     static void readFullFile(struct lua_State * state);
00133 
00134     //FIXME: COMMENT ME!!!!
00135     static void writeToFile(struct lua_State * state, int stackIndex);
00136 
00137     //FIXME: COMMENT ME!!!!
00138     static void printTable(struct lua_State * state, int stackIndex);
00139 
00140     //FIXME: COMMENT ME!!!!
00141     static vector<string> extractStringSequence(struct lua_State * state, int stackIndex);
00142 
00143 };
00144 
00145 #endif//LuaUtils_HPP

Generated on Mon Sep 6 16:12:48 2004 by doxygen 1.3.3