void BigPotConfig::setRecord(int v, const char * name) { if (strlen(name) == 0) return; auto mainname = getFilenameWithoutPath(name); getElement(_record, ("_" + _sha3(mainname)).c_str()) ->SetText(formatString("%d", v).c_str()); }
int BigPotConfig::getRecord(const char * name) { if (strlen(name) == 0) return 0; auto mainname = getFilenameWithoutPath(name); const char * str = getElement(_record, ("_" + _sha3(mainname)).c_str())->GetText(); if (!str) return 0; return atoi(str); }
XString getFilenameWithoutPathAndExtension(XString s) { XString k = getFilenameWithoutPath(s); int i = k.findRev('.'); k = k.left(i); return k; }
void BigPotConfig::removeRecord(const char * name) { if (strlen(name) == 0) return; auto mainname = getFilenameWithoutPath(name); _record->DeleteChild(getElement(_record, ("_" + _sha3(mainname)).c_str())); }