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

Method getTemplateFileMetaData

plugins/plugin_utils/plugin_HTTP.cpp:1011–1033  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1009}
1010
1011bool Templateiser::getTemplateFileMetaData(TemplateMetaData& metadata, const char* file) {
1012 if (!file) {
1013 return false;
1014 }
1015
1016 // find the file
1017 for (size_t i = 0; i < filePaths.size(); i++) {
1018 std::string path = filePaths[i] + file;
1019 FILE* fp = fopen(getPathForOS(path).c_str(), "rt");
1020 std::string val;
1021 if (fp) {
1022 char c;
1023 while (fscanf(fp, "%c", &c) == 1) {
1024 val += c;
1025 }
1026 fclose(fp);
1027
1028 getTemplateMetaData(metadata, val);
1029 return true;
1030 }
1031 }
1032 return false;
1033}
1034
1035
1036void Templateiser::setPluginName(const char* name, const char* URL) {

Callers 2

handleAuthedRequestMethod · 0.80

Calls 3

c_strMethod · 0.80
getPathForOSFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected