MCPcopy Create free account
hub / github.com/apache/thrift / program_name

Function program_name

compiler/cpp/tests/thrift_test_parser_support.cc:57–68  ·  view source on GitHub ↗

Simplified helpers referenced by the grammar.

Source from the content-addressed store, hash-verified

55
56// Simplified helpers referenced by the grammar.
57std::string program_name(std::string filename) {
58 filename.erase(std::remove(filename.begin(), filename.end(), '\\'), filename.end());
59 std::string::size_type slash = filename.rfind('/');
60 if (slash != std::string::npos) {
61 filename = filename.substr(slash + 1);
62 }
63 std::string::size_type dot = filename.rfind('.');
64 if (dot != std::string::npos) {
65 filename = filename.substr(0, dot);
66 }
67 return filename;
68}
69
70std::string directory_name(std::string filename) {
71 std::replace(filename.begin(), filename.end(), '\\', '/');

Callers

nothing calls this directly

Calls 3

beginMethod · 0.45
endMethod · 0.45
substrMethod · 0.45

Tested by

no test coverage detected