extract the portion of filename before the first . character
| 11 | |
| 12 | // extract the portion of filename before the first . character |
| 13 | static std::string basename(const std::string& filename) { |
| 14 | size_t dotPosition = filename.find('.'); |
| 15 | assert(dotPosition != std::string::npos); |
| 16 | return filename.substr(0, dotPosition); |
| 17 | } |
| 18 | |
| 19 | // make a filename like foo_enums.h from foo.proto |
| 20 | static std::string makeExt(const std::string& filename) { |