在android手机里运行时,弹出提示Get data from file(aaa/xxx.lua)failed!,我xxx.lua是放在aaa目录下,结果无法获取数据。
- std::string filename(luaL_checkstring(L, 1));
- std::string strsrc(".");
- std::string strdst("/");
- std::string::size_type pos = 0;
- std::string::size_type srclen = strsrc.size();
- std::string::size_type dstlen = strdst.size();
- while( (pos=filename.find(strsrc, pos)) != std::string::npos )
- {
- filename.replace( pos, srclen, strdst );
- pos += dstlen;
- }
- filename.append(".lua")