MCPcopy Create free account
hub / github.com/BYVoid/OpenCC / GetBaseNameWithoutExtension

Function GetBaseNameWithoutExtension

src/benchmark/Performance.cpp:98–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96}
97
98std::string GetBaseNameWithoutExtension(const std::string& path) {
99 const std::string::size_type slash_pos = path.find_last_of("/\\");
100 const std::string::size_type start =
101 slash_pos == std::string::npos ? 0 : slash_pos + 1;
102 const std::string::size_type dot_pos = path.find_last_of('.');
103 if (dot_pos == std::string::npos || dot_pos < start) {
104 return path.substr(start);
105 }
106 return path.substr(start, dot_pos - start);
107}
108
109std::string BenchmarkTempDirectory() {
110 return std::string(PROJECT_BINARY_DIR) + "/src/benchmark/";

Callers 1

BuildTempPathMethod · 0.85

Calls 1

substrMethod · 0.45

Tested by

no test coverage detected