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

Function LoadXMLRetryable

Source/XML/xml_helper.cpp:153–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151}
152
153bool LoadXMLRetryable(TiXmlDocument &doc,
154 const std::string &path,
155 const std::string type) {
156 char abs_path[kPathSize];
157 bool retry = true;
158 if (FindFilePath(path.c_str(), abs_path, kPathSize, kDataPaths | kModPaths | kAbsPath) == -1) {
159 ErrorResponse err;
160 while (retry) {
161 err = DisplayError("Error",
162 (type + " file \"" + path + "\" did not load correctly.").c_str(),
163 _ok_cancel_retry);
164 if (err != _retry) {
165 return false;
166 }
167 if (FindFilePath(path.c_str(), abs_path, kPathSize, kDataPaths | kModPaths | kAbsPath) != -1) {
168 retry = false;
169 }
170 }
171 }
172 doc.LoadFile(abs_path);
173 return true;
174}
175
176uint8_t *StackLoadText(const char *path, size_t *size_out) {
177 uint8_t *mem = NULL;

Callers 12

LoadMethod · 0.85
LoadMethod · 0.85
LoadMethod · 0.85
LoadMethod · 0.85
LoadMethod · 0.85
LoadMethod · 0.85
LoadMethod · 0.85
LoadMethod · 0.85
LoadMethod · 0.85
LoadMethod · 0.85
LoadMethod · 0.85
GetTypeFromXMLFunction · 0.85

Calls 4

FindFilePathFunction · 0.85
DisplayErrorFunction · 0.50
c_strMethod · 0.45
LoadFileMethod · 0.45

Tested by

no test coverage detected