MCPcopy Create free account
hub / github.com/alliedmodders/sourcemod / GetFileFromPath

Method GetFileFromPath

core/logic/LibrarySys.cpp:298–318  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

296}
297
298size_t LibrarySystem::GetFileFromPath(char *buffer, size_t maxlength, const char *path)
299{
300 size_t length = strlen(path);
301
302 for (size_t i = length - 1;
303 i <= length - 1;
304 i--)
305 {
306 if (path[i] == '/'
307#if defined PLATFORM_WINDOWS
308 || path[i] == '\\'
309#endif
310 )
311 {
312 return ke::SafeStrcpy(buffer, maxlength, &path[i+1]);
313 }
314 }
315
316 /* We scanned and found no path separator */
317 return ke::SafeStrcpy(buffer, maxlength, path);
318}
319
320bool LibrarySystem::FileTime(const char *path, FileTimeType type, time_t *pTime)
321{

Callers 4

AutoExecConfigFunction · 0.80
InitializeMethod · 0.80
FindExtensionByFileMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected