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

Function program_name

compiler/cpp/src/thrift/main.cc:316–326  ·  view source on GitHub ↗

* Converts a string filename into a thrift program name */

Source from the content-addressed store, hash-verified

314 * Converts a string filename into a thrift program name
315 */
316string program_name(string filename) {
317 string::size_type slash = filename.rfind("/");
318 if (slash != string::npos) {
319 filename = filename.substr(slash + 1);
320 }
321 string::size_type dot = filename.rfind(".");
322 if (dot != string::npos) {
323 filename = filename.substr(0, dot);
324 }
325 return filename;
326}
327
328/**
329 * Gets the directory path of a filename

Callers 1

t_programMethod · 0.50

Calls 1

substrMethod · 0.45

Tested by

no test coverage detected