MCPcopy Create free account
hub / github.com/CodingGay/BlackDex / GetFileBasename

Function GetFileBasename

Bcore/src/main/cpp/android-base/logging.cpp:344–358  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

342}
343
344static const char* GetFileBasename(const char* file) {
345 // We can't use basename(3) even on Unix because the Mac doesn't
346 // have a non-modifying basename.
347 const char* last_slash = strrchr(file, '/');
348 if (last_slash != nullptr) {
349 return last_slash + 1;
350 }
351#if defined(_WIN32)
352 const char* last_backslash = strrchr(file, '\\');
353 if (last_backslash != nullptr) {
354 return last_backslash + 1;
355 }
356#endif
357 return file;
358}
359
360// This indirection greatly reduces the stack impact of having lots of
361// checks/logging in a function.

Callers 1

LogMessageDataMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected