]> granicus.if.org Git - icinga2/blob - lib/base/number-script.cpp
Merge pull request #7185 from Icinga/bugfix/gelfwriter-wrong-log-facility
[icinga2] / lib / base / number-script.cpp
1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
2
3 #include "base/number.hpp"
4 #include "base/convert.hpp"
5 #include "base/function.hpp"
6 #include "base/functionwrapper.hpp"
7 #include "base/scriptframe.hpp"
8
9 using namespace icinga;
10
11 static String NumberToString()
12 {
13         ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
14         return vframe->Self;
15 }
16
17 Object::Ptr Number::GetPrototype()
18 {
19         static Dictionary::Ptr prototype = new Dictionary({
20                 { "to_string", new Function("Number#to_string", NumberToString, {}, true) }
21         });
22
23         return prototype;
24 }
25