MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / LoadTextRetryable

Function LoadTextRetryable

Source/XML/xml_helper.cpp:242–263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

240}
241
242bool LoadTextRetryable(void *&mem,
243 const std::string &path,
244 const std::string type) {
245 char abs_path[kPathSize];
246 bool retry = true;
247 if (FindFilePath(path.c_str(), abs_path, kPathSize, kDataPaths | kModPaths | kAbsPath) == -1) {
248 ErrorResponse err;
249 while (retry) {
250 err = DisplayError("Error",
251 (type + " file \"" + path + "\" did not load correctly.").c_str(),
252 _ok_cancel_retry);
253 if (err != _retry) {
254 return false;
255 }
256 if (FindFilePath(path.c_str(), abs_path, kPathSize, kDataPaths | kModPaths | kAbsPath) != -1) {
257 retry = false;
258 }
259 }
260 }
261 LoadText(mem, abs_path);
262 return true;
263}
264
265void LoadAttribIntoString(TiXmlElement *el, const char *attrib, std::string &str) {
266 const char *label = el->Attribute(attrib);

Callers

nothing calls this directly

Calls 4

FindFilePathFunction · 0.85
LoadTextFunction · 0.85
DisplayErrorFunction · 0.50
c_strMethod · 0.45

Tested by

no test coverage detected