MCPcopy Create free account
hub / github.com/MergHQ/CRYENGINE / GetUniqueLogFileName

Function GetUniqueLogFileName

Code/CryEngine/CrySystem/SystemInit.cpp:2263–2282  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

2261
2262//////////////////////////////////////////////////////////////////////////
2263string GetUniqueLogFileName(string logFileName)
2264{
2265#if CRY_PLATFORM_WINDOWS
2266 int instance = gEnv->pSystem->GetApplicationInstance();
2267 if (instance != 0)
2268 {
2269 string logFileExtension;
2270 size_t extensionIndex = logFileName.find_last_of('.');
2271 string logFileNamePrefix = logFileName;
2272 if (extensionIndex != string::npos)
2273 {
2274 logFileExtension = logFileName.substr(extensionIndex, logFileName.length() - extensionIndex);
2275 logFileNamePrefix = logFileName.substr(0, extensionIndex);
2276 }
2277 logFileName.Format("%s(%d)%s", logFileNamePrefix.c_str(), instance, logFileExtension.c_str());
2278 }
2279#endif
2280
2281 return logFileName;
2282}
2283
2284//////////////////////////////////////////////////////////////////////////
2285void OnLevelLoadingDump(ICVar* pArgs)

Callers 1

SystemInit.cppFile · 0.85

Calls 6

find_last_ofMethod · 0.80
FormatMethod · 0.80
substrMethod · 0.45
lengthMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected