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