MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / processTemplateFile

Method processTemplateFile

plugins/plugin_utils/plugin_HTTP.cpp:924–946  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

922}
923
924bool 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
948void Templateiser::processTemplate(std::string& code, const std::string& templateText) {
949 std::string::const_iterator templateItr = templateText.begin();

Callers 6

doStatReportMethod · 0.80
doPlayerReportMethod · 0.80
doFlagReportMethod · 0.80
handleAuthedRequestMethod · 0.80
generatePageMethod · 0.80
handleAuthedRequestMethod · 0.80

Calls 3

c_strMethod · 0.80
getPathForOSFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected