Remove a File. */
| 49 | |
| 50 | /* Remove a File. */ |
| 51 | Result ScriptUtils::removeFile(const std::string &file, bool isARG) { |
| 52 | std::string out; |
| 53 | out = std::regex_replace(file, std::regex("%ARCHIVE_DEFAULT%"), config->archPath()); |
| 54 | out = std::regex_replace(out, std::regex("%3DSX%/(.*)\\.(.*)"), config->_3dsxPath() + (config->_3dsxInFolder() ? "/$1/$1.$2" : "/$1.$2")); |
| 55 | out = std::regex_replace(out, std::regex("%3DSX%"), config->_3dsxPath()); |
| 56 | out = std::regex_replace(out, std::regex("%NDS%"), config->ndsPath()); |
| 57 | out = std::regex_replace(out, std::regex("%FIRM%"), config->firmPath()); |
| 58 | |
| 59 | Result ret = NONE; |
| 60 | if (access(out.c_str(), F_OK) != 0) return DELETE_ERROR; |
| 61 | |
| 62 | deleteFile(out.c_str()); |
| 63 | return ret; |
| 64 | } |
| 65 | |
| 66 | /* Boot a title. */ |
| 67 | void ScriptUtils::bootTitle(const std::string &TitleID, bool isNAND, bool isARG) { |
nothing calls this directly
no test coverage detected