#include <hxcpp.h>

#ifndef INCLUDED_luxe_utils_JSON
#include <luxe/utils/JSON.h>
#endif
#ifndef INCLUDED_luxe_utils_json_JSONDecoder
#include <luxe/utils/json/JSONDecoder.h>
#endif
#ifndef INCLUDED_luxe_utils_json_JSONEncoder
#include <luxe/utils/json/JSONEncoder.h>
#endif
namespace luxe{
namespace utils{

Void JSON_obj::__construct()
{
	return null();
}

//JSON_obj::~JSON_obj() { }

Dynamic JSON_obj::__CreateEmpty() { return  new JSON_obj; }
hx::ObjectPtr< JSON_obj > JSON_obj::__new()
{  hx::ObjectPtr< JSON_obj > result = new JSON_obj();
	result->__construct();
	return result;}

Dynamic JSON_obj::__Create(hx::DynamicArray inArgs)
{  hx::ObjectPtr< JSON_obj > result = new JSON_obj();
	result->__construct();
	return result;}

::String JSON_obj::encode( Dynamic o){
	HX_STACK_FRAME("luxe.utils.JSON","encode",0xde290327,"luxe.utils.JSON.encode","luxe/utils/JSON.hx",52,0x4d81151f)
	HX_STACK_ARG(o,"o")
	HX_STACK_LINE(52)
	return ::luxe::utils::json::JSONEncoder_obj::__new(o)->getString();
}


STATIC_HX_DEFINE_DYNAMIC_FUNC1(JSON_obj,encode,return )

Dynamic JSON_obj::decode( ::String s,hx::Null< bool >  __o_strict){
bool strict = __o_strict.Default(true);
	HX_STACK_FRAME("luxe.utils.JSON","decode",0x49326e3f,"luxe.utils.JSON.decode","luxe/utils/JSON.hx",62,0x4d81151f)
	HX_STACK_ARG(s,"s")
	HX_STACK_ARG(strict,"strict")
{
		HX_STACK_LINE(62)
		return ::luxe::utils::json::JSONDecoder_obj::__new(s,strict)->getValue();
	}
}


STATIC_HX_DEFINE_DYNAMIC_FUNC2(JSON_obj,decode,return )

::String JSON_obj::stringify( Dynamic o){
	HX_STACK_FRAME("luxe.utils.JSON","stringify",0x6486a55a,"luxe.utils.JSON.stringify","luxe/utils/JSON.hx",72,0x4d81151f)
	HX_STACK_ARG(o,"o")
	HX_STACK_LINE(72)
	return ::luxe::utils::json::JSONEncoder_obj::__new(o)->getString();
}


STATIC_HX_DEFINE_DYNAMIC_FUNC1(JSON_obj,stringify,return )

Dynamic JSON_obj::parse( ::String s,hx::Null< bool >  __o_strict){
bool strict = __o_strict.Default(false);
	HX_STACK_FRAME("luxe.utils.JSON","parse",0xd79d0c42,"luxe.utils.JSON.parse","luxe/utils/JSON.hx",82,0x4d81151f)
	HX_STACK_ARG(s,"s")
	HX_STACK_ARG(strict,"strict")
{
		HX_STACK_LINE(82)
		return ::luxe::utils::json::JSONDecoder_obj::__new(s,strict)->getValue();
	}
}


STATIC_HX_DEFINE_DYNAMIC_FUNC2(JSON_obj,parse,return )


JSON_obj::JSON_obj()
{
}

Dynamic JSON_obj::__Field(const ::String &inName,bool inCallProp)
{
	switch(inName.length) {
	case 5:
		if (HX_FIELD_EQ(inName,"parse") ) { return parse_dyn(); }
		break;
	case 6:
		if (HX_FIELD_EQ(inName,"encode") ) { return encode_dyn(); }
		if (HX_FIELD_EQ(inName,"decode") ) { return decode_dyn(); }
		break;
	case 9:
		if (HX_FIELD_EQ(inName,"stringify") ) { return stringify_dyn(); }
	}
	return super::__Field(inName,inCallProp);
}

Dynamic JSON_obj::__SetField(const ::String &inName,const Dynamic &inValue,bool inCallProp)
{
	return super::__SetField(inName,inValue,inCallProp);
}

void JSON_obj::__GetFields(Array< ::String> &outFields)
{
	super::__GetFields(outFields);
};

static ::String sStaticFields[] = {
	HX_CSTRING("encode"),
	HX_CSTRING("decode"),
	HX_CSTRING("stringify"),
	HX_CSTRING("parse"),
	String(null()) };

#if HXCPP_SCRIPTABLE
static hx::StorageInfo *sMemberStorageInfo = 0;
#endif

static ::String sMemberFields[] = {
	String(null()) };

static void sMarkStatics(HX_MARK_PARAMS) {
	HX_MARK_MEMBER_NAME(JSON_obj::__mClass,"__mClass");
};

#ifdef HXCPP_VISIT_ALLOCS
static void sVisitStatics(HX_VISIT_PARAMS) {
	HX_VISIT_MEMBER_NAME(JSON_obj::__mClass,"__mClass");
};

#endif

Class JSON_obj::__mClass;

void JSON_obj::__register()
{
	hx::Static(__mClass) = hx::RegisterClass(HX_CSTRING("luxe.utils.JSON"), hx::TCanCast< JSON_obj> ,sStaticFields,sMemberFields,
	&__CreateEmpty, &__Create,
	&super::__SGetClass(), 0, sMarkStatics
#ifdef HXCPP_VISIT_ALLOCS
    , sVisitStatics
#endif
#ifdef HXCPP_SCRIPTABLE
    , sMemberStorageInfo
#endif
);
}

void JSON_obj::__boot()
{
}

} // end namespace luxe
} // end namespace utils
