MCPcopy Create free account
hub / github.com/DFHack/dfhack / filterSaveFileName

Function filterSaveFileName

library/modules/Persistence.cpp:180–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178}
179
180static std::string filterSaveFileName(std::string s) {
181 for (auto &ch : s) {
182 if (!isalnum(ch) && ch != '-' && ch != '_')
183 ch = '_';
184 }
185 return s;
186}
187
188static std::filesystem::path getSavePath(const std::string &world) {
189 return Filesystem::getBaseDir() / "save" / world;

Callers 1

getSaveFilePathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected