MCPcopy Create free account
hub / github.com/Icinga/icinga2 / BaseName

Method BaseName

tools/mkclass/classcompiler.cpp:1420–1437  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1418}
1419
1420std::string ClassCompiler::BaseName(const std::string& path)
1421{
1422 char *dir = strdup(path.c_str());
1423 std::string result;
1424
1425 if (!dir)
1426 throw std::bad_alloc();
1427
1428#ifndef _WIN32
1429 result = basename(dir);
1430#else /* _WIN32 */
1431 result = PathFindFileName(dir);
1432#endif /* _WIN32 */
1433
1434 free(dir);
1435
1436 return result;
1437}
1438
1439std::string ClassCompiler::FileNameToGuardName(const std::string& fname)
1440{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected