MCPcopy Create free account
hub / github.com/Icinga/icinga2 / HandleIncludeRecursive

Method HandleIncludeRecursive

lib/config/configcompiler.cpp:161–179  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

159 * @param debuginfo Debug information.
160 */
161std::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
181void 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{

Callers

nothing calls this directly

Calls 1

MakeInlineMethod · 0.80

Tested by

no test coverage detected