MCPcopy Create free account
hub / github.com/EmbeddedRPC/erpc / generateOutputFile

Method generateOutputFile

erpcgen/src/Generator.cpp:212–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

210}
211
212void 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
231string Generator::stripExtension(const string &filename)
232{

Callers

nothing calls this directly

Calls 4

parseFunction · 0.85
TemplateExceptionClass · 0.85
format_stringFunction · 0.85
closeMethod · 0.65

Tested by

no test coverage detected