std::string levelpath = FileUtils::getInstance()->fullPathForFilename("leveldata");
const char* filepath = levelpath.c_str();
std::string filestr = FileUtils::getInstance()->getStringFromFile(filepath);
std::string writePath = FileUtils::getInstance()->getWritablePath()+"leveldata";
if (!FileUtils::getInstance()->isFileExist(writePath)) {
FILE* openFile = fopen(writePath.c_str(), "wb+");
fwrite(filestr.c_str(), 1, filestr.size(), openFile);
fclose(openFile);
}
filestr = FileUtils::getInstance()->getStringFromFile(writePath.c_str());
读取文件,写入沙盒