]> granicus.if.org Git - icinga2/blob - lib/base/scriptglobal.hpp
Merge pull request #7185 from Icinga/bugfix/gelfwriter-wrong-log-facility
[icinga2] / lib / base / scriptglobal.hpp
1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
2
3 #ifndef SCRIPTGLOBAL_H
4 #define SCRIPTGLOBAL_H
5
6 #include "base/i2-base.hpp"
7 #include "base/namespace.hpp"
8
9 namespace icinga
10 {
11
12 /**
13  * Global script variables.
14  *
15  * @ingroup base
16  */
17 class ScriptGlobal
18 {
19 public:
20         static Value Get(const String& name, const Value *defaultValue = nullptr);
21         static void Set(const String& name, const Value& value, bool overrideFrozen = false);
22         static void SetConst(const String& name, const Value& value);
23         static bool Exists(const String& name);
24
25         static void WriteToFile(const String& filename);
26
27         static Namespace::Ptr GetGlobals();
28
29 private:
30         static Namespace::Ptr m_Globals;
31 };
32
33 }
34
35 #endif /* SCRIPTGLOBAL_H */