MCPcopy Create free account
hub / github.com/Universal-Team/Universal-Updater / removeFile

Method removeFile

source/utils/scriptUtils.cpp:51–64  ·  view source on GitHub ↗

Remove a File. */

Source from the content-addressed store, hash-verified

49
50/* Remove a File. */
51Result 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. */
67void ScriptUtils::bootTitle(const std::string &TitleID, bool isNAND, bool isARG) {

Callers

nothing calls this directly

Calls 6

deleteFileFunction · 0.85
archPathMethod · 0.80
_3dsxPathMethod · 0.80
_3dsxInFolderMethod · 0.80
ndsPathMethod · 0.80
firmPathMethod · 0.80

Tested by

no test coverage detected