* Handles recursive includes. * * @param relativeBase The path this include is relative to. * @param path The directory path. * @param pattern The file pattern. * @param debuginfo Debug information. */
| 159 | * @param debuginfo Debug information. |
| 160 | */ |
| 161 | std::unique_ptr<Expression> ConfigCompiler::HandleIncludeRecursive(const String& relativeBase, const String& path, |
| 162 | const String& pattern, const String& zone, const String& package, const DebugInfo&) |
| 163 | { |
| 164 | String ppath; |
| 165 | |
| 166 | if (IsAbsolutePath(path)) |
| 167 | ppath = path; |
| 168 | else |
| 169 | ppath = relativeBase + "/" + path; |
| 170 | |
| 171 | std::vector<std::unique_ptr<Expression> > expressions; |
| 172 | Utility::GlobRecursive(ppath, pattern, [&expressions, zone, package](const String& file) { |
| 173 | CollectIncludes(expressions, file, zone, package); |
| 174 | }, GlobFile); |
| 175 | |
| 176 | std::unique_ptr<DictExpression> dict{new DictExpression(std::move(expressions))}; |
| 177 | dict->MakeInline(); |
| 178 | return dict; |
| 179 | } |
| 180 | |
| 181 | void ConfigCompiler::HandleIncludeZone(const String& relativeBase, const String& tag, const String& path, const String& pattern, const String& package, std::vector<std::unique_ptr<Expression> >& expressions) |
| 182 | { |
nothing calls this directly
no test coverage detected