zoukankan      html  css  js  c++  java
  • cocos2dx lua 路径问题的一个bug (网络整理)

    在android手机里运行时,弹出提示Get data from file(aaa/xxx.lua)failed!,我xxx.lua是放在aaa目录下,结果无法获取数据。

    1.  std::string filename(luaL_checkstring(L, 1));
    2.                 std::string strsrc(".");
    3.                 std::string strdst("/");
    4.                 std::string::size_type pos = 0;
    5.                 std::string::size_type srclen = strsrc.size();
    6.                 std::string::size_type dstlen = strdst.size();
    7.                 while( (pos=filename.find(strsrc, pos)) != std::string::npos )
    8.                 {
    9.                         filename.replace( pos, srclen, strdst );
    10.                         pos += dstlen;
    11.                 }
    12.                 filename.append(".lua")
  • 相关阅读:
    java下载url图片链接
    mysql 设计索引的原则
    169. 多数元素
    263. 丑数
    markdown 语法笔记
    70.爬楼梯
    540. 有序数组中的单一元素
    88. 合并两个有序数组
    面试题57
    152. 乘积最大子序列
  • 原文地址:https://www.cnblogs.com/wenlove/p/2909311.html
Copyright © 2011-2022 走看看