| 96 | } |
| 97 | |
| 98 | std::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 | |
| 109 | std::string BenchmarkTempDirectory() { |
| 110 | return std::string(PROJECT_BINARY_DIR) + "/src/benchmark/"; |