hey,everybody:
when i using C++ with lua,I have some problems which I cannot work through.
see I want to write a program to open a file and using lua to deal the strings in the file,and then write to another file
so i try to register the deal function to the lua ,but I don't want to register all of the class to lua.
I will use some code to describe my problems:
I just want it like this:
I'd like to use the read and write function in my main function and the deal in the lua file , but I don't know how to do.
thank regards
when i using C++ with lua,I have some problems which I cannot work through.
see I want to write a program to open a file and using lua to deal the strings in the file,and then write to another file
so i try to register the deal function to the lua ,but I don't want to register all of the class to lua.
I will use some code to describe my problems:
I just want it like this:
class A
{
public:
int read (FILE fd,string m_string);
int deal(Lua_state *L); // this function will deal with m_string by some parameters in the lua file
int write(string m_string1,FILE fd1)
private:
string m_string;
string m_string1;
};
I'd like to use the read and write function in my main function and the deal in the lua file , but I don't know how to do.
thank regards