MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / LoadFromFile

Function LoadFromFile

engine/Poseidon/IO/Streams/QBStream.cpp:280–301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

278 snprintf(logName, sizeof(logName), "%s", (const char*)"FilesUsed");
279 ::CreateDirectory(logName, nullptr);
280 strncat(logName, PATH_SEP_STR, sizeof(logName) - strlen(logName) - 1);
281 strncat(logName, bankName, sizeof(logName) - strlen(logName) - 1);
282 size_t len = strlen(logName);
283 if (len > 0 && (logName[len - 1] == '\\' || logName[len - 1] == '/'))
284 {
285 logName[len - 1] = 0;
286 }
287 strncat(logName, ".log", sizeof(logName) - strlen(logName) - 1);
288
289#ifndef _WIN32
290 unixPath(logName);
291#endif
292 FILE* file = fopen(logName, "r");
293 if (file)
294 {
295 // read filenames already there
296 for (;;)
297 {
298 char buf[1024];
299 *buf = 0;
300 fgets(buf, sizeof(buf), file);
301 if (!*buf)
302 {
303 break;
304 }

Callers 1

LoadMethod · 0.85

Calls 1

RStringClass · 0.50

Tested by

no test coverage detected