2019-02-25 08:48:22 -05:00
|
|
|
/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
|
2014-12-12 09:19:23 -05:00
|
|
|
|
|
|
|
|
#include "base/number.hpp"
|
|
|
|
|
#include "base/convert.hpp"
|
2015-01-21 02:47:45 -05:00
|
|
|
#include "base/function.hpp"
|
|
|
|
|
#include "base/functionwrapper.hpp"
|
2014-12-12 09:33:02 -05:00
|
|
|
#include "base/scriptframe.hpp"
|
2014-12-12 09:19:23 -05:00
|
|
|
|
|
|
|
|
using namespace icinga;
|
|
|
|
|
|
2018-01-03 22:25:35 -05:00
|
|
|
static String NumberToString()
|
2014-12-12 09:19:23 -05:00
|
|
|
{
|
2014-12-12 09:33:02 -05:00
|
|
|
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
|
2016-06-16 09:14:35 -04:00
|
|
|
return vframe->Self;
|
2014-12-12 09:19:23 -05:00
|
|
|
}
|
|
|
|
|
|
2018-01-03 22:25:35 -05:00
|
|
|
Object::Ptr Number::GetPrototype()
|
2014-12-12 09:19:23 -05:00
|
|
|
{
|
2018-01-11 05:17:38 -05:00
|
|
|
static Dictionary::Ptr prototype = new Dictionary({
|
|
|
|
|
{ "to_string", new Function("Number#to_string", NumberToString, {}, true) }
|
|
|
|
|
});
|
2014-12-12 09:19:23 -05:00
|
|
|
|
|
|
|
|
return prototype;
|
|
|
|
|
}
|