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

Function getFileTitle

plugins/plugin_utils/plugin_files.cpp:346–364  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

344}
345
346std::string getFileTitle(const char* file) {
347 std::string f = convertPathToDelims(file);
348 std::string temp = f;
349
350 const char* p = strrchr(f.c_str(), _DirDelim);
351 if (p)
352 // it's ok to go one past, cus even if it's the end, that's the
353 // NUL char so we can set it to NUL again with out worry
354 {
355 temp = p + 1;
356 }
357
358 char* p2 = (char*)strrchr(temp.c_str(), '.');
359 if (p2) {
360 *(p2) = 0; // kill the . too
361 }
362
363 return std::string(temp.c_str());
364}
365
366std::string getFileText(const char* file) {
367 std::string text;

Callers

nothing calls this directly

Calls 2

convertPathToDelimsFunction · 0.85
c_strMethod · 0.80

Tested by

no test coverage detected