Value value;
try {
- Expression *expr = ConfigCompiler::CompileText("temp", pword, false);
+ Expression *expr = ConfigCompiler::CompileText("temp", pword);
if (expr)
value = expr->Evaluate(*l_ScriptFrame);
try {
lines[fileName] = command;
- expr = ConfigCompiler::CompileText(fileName, command, false);
+ expr = ConfigCompiler::CompileText(fileName, command);
if (expr) {
Value result = expr->Evaluate(scriptFrame);
if (Utility::PathExists(modulePath + "/include.conf")) {
Expression *expr = ConfigCompiler::CompileFile(modulePath + "/include.conf",
- true, String(), moduleName);
+ String(), moduleName);
if (!ExecuteExpression(expr))
success = false;
if (!configs.empty()) {
BOOST_FOREACH(const String& configPath, configs) {
- Expression *expression = ConfigCompiler::CompileFile(configPath, true, String(), "_etc");
+ Expression *expression = ConfigCompiler::CompileFile(configPath, String(), "_etc");
success = ExecuteExpression(expression);
delete expression;
if (!success)
void ConfigCompiler::CollectIncludes(std::vector<Expression *>& expressions,
const String& file, const String& zone, const String& module)
{
- expressions.push_back(CompileFile(file, true, zone, module));
+ expressions.push_back(CompileFile(file, zone, module));
}
/**
* @returns Configuration items.
*/
Expression *ConfigCompiler::CompileStream(const String& path,
- std::istream *stream, bool async, const String& zone, const String& module)
+ std::istream *stream, const String& zone, const String& module)
{
CONTEXT("Compiling configuration stream with name '" + path + "'");
* @param path The path.
* @returns Configuration items.
*/
-Expression *ConfigCompiler::CompileFile(const String& path, bool async,
- const String& zone, const String& module)
+Expression *ConfigCompiler::CompileFile(const String& path, const String& zone,
+ const String& module)
{
CONTEXT("Compiling configuration file '" + path + "'");
Log(LogInformation, "ConfigCompiler")
<< "Compiling config file: " << path;
- return CompileStream(path, &stream, async, zone, module);
+ return CompileStream(path, &stream, zone, module);
}
/**
* @returns Configuration items.
*/
Expression *ConfigCompiler::CompileText(const String& path, const String& text,
- bool async, const String& zone, const String& module)
+ const String& zone, const String& module)
{
std::stringstream stream(text);
- return CompileStream(path, &stream, async, zone, module);
+ return CompileStream(path, &stream, zone, module);
}
/**
Expression *Compile(void);
static Expression *CompileStream(const String& path, std::istream *stream,
- bool async = true, const String& zone = String(), const String& module = String());
- static Expression *CompileFile(const String& path, bool async = true,
const String& zone = String(), const String& module = String());
+ static Expression *CompileFile(const String& path, const String& zone = String(),
+ const String& module = String());
static Expression *CompileText(const String& path, const String& text,
- bool async = true, const String& zone = String(), const String& module = String());
+ const String& zone = String(), const String& module = String());
static void AddIncludeSearchDir(const String& dir);
namespace { \
void RegisterConfigFragment(void) \
{ \
- icinga::Expression *expression = icinga::ConfigCompiler::CompileText(name, fragment, false); \
+ icinga::Expression *expression = icinga::ConfigCompiler::CompileText(name, fragment); \
VERIFY(expression); \
icinga::ScriptFrame frame; \
expression->Evaluate(frame); \
Expression *expr = NULL;
Value result;
try {
- expr = ConfigCompiler::CompileText(fileName, m_Command, false);
+ expr = ConfigCompiler::CompileText(fileName, m_Command);
ScriptFrame frame;
frame.Locals = lsf.Locals;
frame.Self = lsf.Locals;
ConfigType::Ptr dtype = ConfigType::GetByName(type);
ASSERT(dtype);
- Expression *ufilter = ConfigCompiler::CompileText("<API query>", filter, false);
+ Expression *ufilter = ConfigCompiler::CompileText("<API query>", filter);
ScriptFrame frame;
frame.Sandboxed = true;