icinga2/lib/base/scriptglobal.hpp

36 lines
665 B
C++
Raw Normal View History

/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
#ifndef SCRIPTGLOBAL_H
#define SCRIPTGLOBAL_H
#include "base/i2-base.hpp"
2018-08-07 13:55:41 +02:00
#include "base/namespace.hpp"
namespace icinga
{
/**
* Global script variables.
*
* @ingroup base
*/
2017-12-31 07:22:16 +01:00
class ScriptGlobal
{
public:
2017-12-14 15:37:20 +01:00
static Value Get(const String& name, const Value *defaultValue = nullptr);
static void Set(const String& name, const Value& value);
2018-08-07 13:55:41 +02:00
static void SetConst(const String& name, const Value& value);
static bool Exists(const String& name);
static void WriteToFile(const String& filename);
2018-08-07 13:55:41 +02:00
static Namespace::Ptr GetGlobals();
private:
2018-08-07 13:55:41 +02:00
static Namespace::Ptr m_Globals;
};
}
#endif /* SCRIPTGLOBAL_H */