MCPcopy Create free account
hub / github.com/amule-project/amule / Load

Method Load

src/Statistics.cpp:288–306  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

286
287
288void CStatistics::Load()
289{
290 CFile f;
291
292 s_totalSent = 0;
293 s_totalReceived = 0;
294 try {
295 CPath path(JoinPaths(thePrefs::GetConfigDir(), "statistics.dat"));
296 if (path.FileExists() && f.Open(path)) {
297 uint8_t version = f.ReadUInt8();
298 if (version == 0) {
299 s_totalSent = f.ReadUInt64();
300 s_totalReceived = f.ReadUInt64();
301 }
302 }
303 } catch (const CSafeIOException& e) {
304 AddLogLineN(e.what());
305 }
306}
307
308
309void CStatistics::Save()

Callers

nothing calls this directly

Calls 7

JoinPathsFunction · 0.85
GetConfigDirFunction · 0.85
FileExistsMethod · 0.80
ReadUInt8Method · 0.80
ReadUInt64Method · 0.80
whatMethod · 0.80
OpenMethod · 0.45

Tested by

no test coverage detected