| 922 | } |
| 923 | |
| 924 | bool Templateiser::processTemplateFile(std::string& code, const char* file) { |
| 925 | if (!file) { |
| 926 | return false; |
| 927 | } |
| 928 | |
| 929 | // find the file |
| 930 | for (size_t i = 0; i < filePaths.size(); i++) { |
| 931 | std::string path = filePaths[i] + file; |
| 932 | FILE* fp = fopen(getPathForOS(path).c_str(), "rt"); |
| 933 | std::string val; |
| 934 | if (fp) { |
| 935 | char c; |
| 936 | while (fscanf(fp, "%c", &c) == 1) { |
| 937 | val += c; |
| 938 | } |
| 939 | fclose(fp); |
| 940 | |
| 941 | processTemplate(code, val); |
| 942 | return true; |
| 943 | } |
| 944 | } |
| 945 | return false; |
| 946 | } |
| 947 | |
| 948 | void Templateiser::processTemplate(std::string& code, const std::string& templateText) { |
| 949 | std::string::const_iterator templateItr = templateText.begin(); |
no test coverage detected