MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / getFileExtension

Function getFileExtension

plugins/plugin_utils/plugin_files.cpp:332–344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

330}
331
332std::string getFileExtension(const char* file) {
333 std::string f = convertPathToDelims(file);
334
335 char* p = (char*)strrchr(f.c_str(), '.');
336 if (!p)
337 // it's ok to go one past, cus even if it's the end, that's the
338 // NUL char so we can set it to NUL again with out worry
339 {
340 return std::string();
341 }
342
343 return std::string(p + 1);
344}
345
346std::string getFileTitle(const char* file) {
347 std::string f = convertPathToDelims(file);

Callers

nothing calls this directly

Calls 2

convertPathToDelimsFunction · 0.85
c_strMethod · 0.80

Tested by

no test coverage detected