| 23 | } |
| 24 | |
| 25 | tpl_t* file_tmpl::open_tpl(const char* filename) |
| 26 | { |
| 27 | tpl_t* tpl = tpl_alloc(); |
| 28 | string filepath; |
| 29 | filepath.format("%s/%s", path_from_.c_str(), filename); |
| 30 | if (tpl_load(tpl, filepath.c_str()) != TPL_OK) { |
| 31 | printf("load file %s error: %s\r\n", |
| 32 | filepath.c_str(), last_serror()); |
| 33 | tpl_free(tpl); |
| 34 | return NULL; |
| 35 | } |
| 36 | return tpl; |
| 37 | } |
| 38 | |
| 39 | bool file_tmpl::copy_and_replace(const char* from, |
| 40 | const char* to, bool exec /* = false */) |
no test coverage detected