| 989 | } |
| 990 | |
| 991 | void Templateiser::getTemplateMetaData(TemplateMetaData& metadata, const std::string& templateText) { |
| 992 | size_t pos = 0; |
| 993 | while (pos < templateText.size() && pos != std::string::npos) { |
| 994 | pos = find_first_substr(templateText, std::string("[#"), pos); |
| 995 | if (pos < templateText.size() && pos != std::string::npos) { |
| 996 | size_t start = pos; |
| 997 | |
| 998 | pos = find_first_substr(templateText, std::string("]"), pos); |
| 999 | if (pos < templateText.size() && pos != std::string::npos) { |
| 1000 | std::string dataKey = getStringRange(templateText, start + 2, pos - 1); |
| 1001 | |
| 1002 | std::vector<std::string> chunks = tokenize(dataKey, std::string(":"), 0, true); |
| 1003 | if (chunks.size() > 1) { |
| 1004 | metadata.add(chunks[0], chunks[1]); |
| 1005 | } |
| 1006 | } |
| 1007 | } |
| 1008 | } |
| 1009 | } |
| 1010 | |
| 1011 | bool Templateiser::getTemplateFileMetaData(TemplateMetaData& metadata, const char* file) { |
| 1012 | if (!file) { |
nothing calls this directly
no test coverage detected