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

Method GetFileExtension

core/logic/LibrarySys.cpp:263–291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261}
262
263const char *LibrarySystem::GetFileExtension(const char *filename)
264{
265 size_t len, end;
266
267 len = strlen(filename);
268
269 /* Minimum string length for filename with ext would be 3; example: a.a */
270 if (len < 3)
271 {
272 return NULL;
273 }
274
275 end = len - 1;
276
277 for (size_t i = end; i <= end; i--)
278 {
279 if (filename[i] == PLATFORM_SEP_CHAR || filename[i] == PLATFORM_SEP_ALTCHAR)
280 {
281 break;
282 }
283
284 if (filename[i] == '.' && i != end && i != 0)
285 {
286 return &filename[++i];
287 }
288 }
289
290 return NULL;
291}
292
293bool LibrarySystem::CreateFolder(const char *path)
294{

Callers 5

LoadAutoExtensionMethod · 0.80
LoadExtensionMethod · 0.80
LoadPluginMethod · 0.80
OnRootConsoleCommandMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected