* Converts a string filename into a thrift program name */
| 314 | * Converts a string filename into a thrift program name |
| 315 | */ |
| 316 | string 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 |