| 210 | } |
| 211 | |
| 212 | void Generator::generateOutputFile(const string &fileName, const string &templateName, data_map &templateData, |
| 213 | const char *const kParseFile) |
| 214 | { |
| 215 | ofstream fileOutputStream; |
| 216 | openFile(fileOutputStream, fileName); |
| 217 | |
| 218 | // Run template and write output to output files. Catch and rethrow template exceptions |
| 219 | // so we can add the name of the template that caused the error to aid in debugging. |
| 220 | try |
| 221 | { |
| 222 | parse(fileOutputStream, kParseFile, templateData); |
| 223 | fileOutputStream.close(); |
| 224 | } |
| 225 | catch (TemplateException &e) |
| 226 | { |
| 227 | throw TemplateException(format_string("Template %s: %s", templateName.c_str(), e.what())); |
| 228 | } |
| 229 | } |
| 230 | |
| 231 | string Generator::stripExtension(const string &filename) |
| 232 | { |
nothing calls this directly
no test coverage detected