#include <hxcpp.h>

#ifndef INCLUDED_Std
#include <Std.h>
#endif
#ifndef INCLUDED_Type
#include <Type.h>
#endif
#ifndef INCLUDED_haxe_CallStack
#include <haxe/CallStack.h>
#endif
#ifndef INCLUDED_haxe_StackItem
#include <haxe/StackItem.h>
#endif
#ifndef INCLUDED_massive_haxe_Exception
#include <massive/haxe/Exception.h>
#endif
#ifndef INCLUDED_massive_haxe_util_ReflectUtil
#include <massive/haxe/util/ReflectUtil.h>
#endif
#ifndef INCLUDED_massive_munit_MUnitException
#include <massive/munit/MUnitException.h>
#endif
#ifndef INCLUDED_massive_munit_UnhandledException
#include <massive/munit/UnhandledException.h>
#endif

HX_DEFINE_STACK_FRAME(_hx_pos_c8bdd1bc462988ff_48_new,"massive.munit.UnhandledException","new",0x1b256705,"massive.munit.UnhandledException.new","massive/munit/UnhandledException.hx",48,0x46824609)
HX_LOCAL_STACK_FRAME(_hx_pos_c8bdd1bc462988ff_54_formatLocation,"massive.munit.UnhandledException","formatLocation",0x55771a07,"massive.munit.UnhandledException.formatLocation","massive/munit/UnhandledException.hx",54,0x46824609)
HX_LOCAL_STACK_FRAME(_hx_pos_c8bdd1bc462988ff_62_getStackTrace,"massive.munit.UnhandledException","getStackTrace",0x11f4c538,"massive.munit.UnhandledException.getStackTrace","massive/munit/UnhandledException.hx",62,0x46824609)
namespace massive{
namespace munit{

void UnhandledException_obj::__construct( ::Dynamic source,::String testLocation){
            	HX_STACKFRAME(&_hx_pos_c8bdd1bc462988ff_48_new)
HXLINE(  49)		::String _hx_tmp = ::Std_obj::string(source);
HXDLIN(  49)		super::__construct((_hx_tmp + this->formatLocation(source,testLocation)),null());
HXLINE(  50)		this->type = ( (::String)(::massive::haxe::util::ReflectUtil_obj::here(hx::SourceInfo(HX_("UnhandledException.hx",d2,78,21,40),50,HX_("massive.munit.UnhandledException",93,80,42,45),HX_("new",60,d0,53,00)))->__Field(HX_("className",a3,92,3d,dc),hx::paccDynamic)) );
            	}

Dynamic UnhandledException_obj::__CreateEmpty() { return new UnhandledException_obj; }

void *UnhandledException_obj::_hx_vtable = 0;

Dynamic UnhandledException_obj::__Create(hx::DynamicArray inArgs)
{
	hx::ObjectPtr< UnhandledException_obj > _hx_result = new UnhandledException_obj();
	_hx_result->__construct(inArgs[0],inArgs[1]);
	return _hx_result;
}

bool UnhandledException_obj::_hx_isInstanceOf(int inClassId) {
	if (inClassId<=(int)0x6b60f4c9) {
		if (inClassId<=(int)0x01643b41) {
			return inClassId==(int)0x00000001 || inClassId==(int)0x01643b41;
		} else {
			return inClassId==(int)0x6b60f4c9;
		}
	} else {
		return inClassId==(int)0x7ce6b12b;
	}
}

::String UnhandledException_obj::formatLocation( ::Dynamic source,::String testLocation){
            	HX_STACKFRAME(&_hx_pos_c8bdd1bc462988ff_54_formatLocation)
HXLINE(  55)		::String stackTrace = (HX_(" at ",ad,d3,70,15) + testLocation);
HXLINE(  56)		::String stack = this->getStackTrace(source);
HXLINE(  57)		bool _hx_tmp;
HXDLIN(  57)		if (hx::IsNotNull( stack )) {
HXLINE(  57)			_hx_tmp = (stack.length > (int)1);
            		}
            		else {
HXLINE(  57)			_hx_tmp = false;
            		}
HXDLIN(  57)		if (_hx_tmp) {
HXLINE(  57)			stackTrace = (stackTrace + (HX_(" ",20,00,00,00) + stack.substr((int)1,null())));
            		}
HXLINE(  58)		return stackTrace;
            	}

HX_DEFINE_DYNAMIC_FUNC2(UnhandledException_obj,formatLocation,return )

::String UnhandledException_obj::getStackTrace( ::Dynamic source){
            	HX_STACKFRAME(&_hx_pos_c8bdd1bc462988ff_62_getStackTrace)
HXLINE(  63)		::String s = HX_("",00,00,00,00);
HXLINE(  72)		if ((s == HX_("",00,00,00,00))) {
HXLINE(  74)			::Array< ::Dynamic> stack = ::haxe::CallStack_obj::exceptionStack();
HXLINE(  75)			while((stack->length > (int)0)){
HXLINE(  77)				 ::haxe::StackItem _g = stack->shift().StaticCast<  ::haxe::StackItem >();
HXDLIN(  77)				if (hx::IsNotNull( _g )) {
HXLINE(  77)					switch((int)(_hx_getEnumValueIndex(_g))){
            						case (int)2: {
HXLINE(  79)							int line = _g->_hx_getInt(2);
HXDLIN(  79)							::String file = _g->_hx_getString(1);
HXDLIN(  79)							s = (s + ((((HX_("\tat ",64,eb,3c,06) + file) + HX_(" (",08,1c,00,00)) + line) + HX_(")\n",c1,23,00,00)));
            						}
            						break;
            						case (int)3: {
HXLINE(  80)							::String method = _g->_hx_getString(1);
HXDLIN(  80)							::String classname = _g->_hx_getString(0);
HXDLIN(  80)							s = (s + ((((HX_("\tat ",64,eb,3c,06) + classname) + HX_("#",23,00,00,00)) + method) + HX_("\n",0a,00,00,00)));
            						}
            						break;
            						default:{
            						}
            					}
            				}
            			}
            		}
HXLINE(  90)		return s;
            	}

HX_DEFINE_DYNAMIC_FUNC1(UnhandledException_obj,getStackTrace,return )

hx::ObjectPtr< UnhandledException_obj > UnhandledException_obj::__new( ::Dynamic source,::String testLocation) {
	hx::ObjectPtr< UnhandledException_obj > __this = new UnhandledException_obj();
	__this->__construct(source,testLocation);
	return __this;
}

hx::ObjectPtr< UnhandledException_obj > UnhandledException_obj::__alloc(hx::Ctx *_hx_ctx, ::Dynamic source,::String testLocation) {
	UnhandledException_obj *__this = (UnhandledException_obj*)(hx::Ctx::alloc(_hx_ctx, sizeof(UnhandledException_obj), true, "massive.munit.UnhandledException"));
	*(void **)__this = UnhandledException_obj::_hx_vtable;
	__this->__construct(source,testLocation);
	return __this;
}

UnhandledException_obj::UnhandledException_obj()
{
}

hx::Val UnhandledException_obj::__Field(const ::String &inName,hx::PropertyAccess inCallProp)
{
	switch(inName.length) {
	case 13:
		if (HX_FIELD_EQ(inName,"getStackTrace") ) { return hx::Val( getStackTrace_dyn() ); }
		break;
	case 14:
		if (HX_FIELD_EQ(inName,"formatLocation") ) { return hx::Val( formatLocation_dyn() ); }
	}
	return super::__Field(inName,inCallProp);
}

#if HXCPP_SCRIPTABLE
static hx::StorageInfo *UnhandledException_obj_sMemberStorageInfo = 0;
static hx::StaticInfo *UnhandledException_obj_sStaticStorageInfo = 0;
#endif

static ::String UnhandledException_obj_sMemberFields[] = {
	HX_HCSTRING("formatLocation","\x8c","\x48","\x0b","\x26"),
	HX_HCSTRING("getStackTrace","\x53","\x8e","\xb0","\x85"),
	::String(null()) };

static void UnhandledException_obj_sMarkStatics(HX_MARK_PARAMS) {
	HX_MARK_MEMBER_NAME(UnhandledException_obj::__mClass,"__mClass");
};

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

#endif

hx::Class UnhandledException_obj::__mClass;

void UnhandledException_obj::__register()
{
	hx::Object *dummy = new UnhandledException_obj;
	UnhandledException_obj::_hx_vtable = *(void **)dummy;
	hx::Static(__mClass) = new hx::Class_obj();
	__mClass->mName = HX_HCSTRING("massive.munit.UnhandledException","\x93","\x80","\x42","\x45");
	__mClass->mSuper = &super::__SGetClass();
	__mClass->mConstructEmpty = &__CreateEmpty;
	__mClass->mConstructArgs = &__Create;
	__mClass->mGetStaticField = &hx::Class_obj::GetNoStaticField;
	__mClass->mSetStaticField = &hx::Class_obj::SetNoStaticField;
	__mClass->mMarkFunc = UnhandledException_obj_sMarkStatics;
	__mClass->mStatics = hx::Class_obj::dupFunctions(0 );
	__mClass->mMembers = hx::Class_obj::dupFunctions(UnhandledException_obj_sMemberFields);
	__mClass->mCanCast = hx::TCanCast< UnhandledException_obj >;
#ifdef HXCPP_VISIT_ALLOCS
	__mClass->mVisitFunc = UnhandledException_obj_sVisitStatics;
#endif
#ifdef HXCPP_SCRIPTABLE
	__mClass->mMemberStorageInfo = UnhandledException_obj_sMemberStorageInfo;
#endif
#ifdef HXCPP_SCRIPTABLE
	__mClass->mStaticStorageInfo = UnhandledException_obj_sStaticStorageInfo;
#endif
	hx::_hx_RegisterClass(__mClass->mName, __mClass);
}

} 
}
// Generated by Haxe 3.4.7
#include <hxcpp.h>

#ifndef INCLUDED_Std
#include <Std.h>
#endif
#ifndef INCLUDED_Type
#include <Type.h>
#endif
#ifndef INCLUDED_haxe_CallStack
#include <haxe/CallStack.h>
#endif
#ifndef INCLUDED_haxe_StackItem
#include <haxe/StackItem.h>
#endif
#ifndef INCLUDED_massive_haxe_Exception
#include <massive/haxe/Exception.h>
#endif
#ifndef INCLUDED_massive_haxe_util_ReflectUtil
#include <massive/haxe/util/ReflectUtil.h>
#endif
#ifndef INCLUDED_massive_munit_MUnitException
#include <massive/munit/MUnitException.h>
#endif
#ifndef INCLUDED_massive_munit_UnhandledException
#include <massive/munit/UnhandledException.h>
#endif

HX_DEFINE_STACK_FRAME(_hx_pos_c8bdd1bc462988ff_48_new,"massive.munit.UnhandledException","new",0x1b256705,"massive.munit.UnhandledException.new","massive/munit/UnhandledException.hx",48,0x46824609)
HX_LOCAL_STACK_FRAME(_hx_pos_c8bdd1bc462988ff_54_formatLocation,"massive.munit.UnhandledException","formatLocation",0x55771a07,"massive.munit.UnhandledException.formatLocation","massive/munit/UnhandledException.hx",54,0x46824609)
HX_LOCAL_STACK_FRAME(_hx_pos_c8bdd1bc462988ff_62_getStackTrace,"massive.munit.UnhandledException","getStackTrace",0x11f4c538,"massive.munit.UnhandledException.getStackTrace","massive/munit/UnhandledException.hx",62,0x46824609)
namespace massive{
namespace munit{

void UnhandledException_obj::__construct( ::Dynamic source,::String testLocation){
            	HX_STACKFRAME(&_hx_pos_c8bdd1bc462988ff_48_new)
HXLINE(  49)		::String _hx_tmp = ::Std_obj::string(source);
HXDLIN(  49)		super::__construct((_hx_tmp + this->formatLocation(source,testLocation)),null());
HXLINE(  50)		this->type = ( (::String)(::massive::haxe::util::ReflectUtil_obj::here(hx::SourceInfo(HX_("UnhandledException.hx",d2,78,21,40),50,HX_("massive.munit.UnhandledException",93,80,42,45),HX_("new",60,d0,53,00)))->__Field(HX_("className",a3,92,3d,dc),hx::paccDynamic)) );
            	}

Dynamic UnhandledException_obj::__CreateEmpty() { return new UnhandledException_obj; }

void *UnhandledException_obj::_hx_vtable = 0;

Dynamic UnhandledException_obj::__Create(hx::DynamicArray inArgs)
{
	hx::ObjectPtr< UnhandledException_obj > _hx_result = new UnhandledException_obj();
	_hx_result->__construct(inArgs[0],inArgs[1]);
	return _hx_result;
}

bool UnhandledException_obj::_hx_isInstanceOf(int inClassId) {
	if (inClassId<=(int)0x6b60f4c9) {
		if (inClassId<=(int)0x01643b41) {
			return inClassId==(int)0x00000001 || inClassId==(int)0x01643b41;
		} else {
			return inClassId==(int)0x6b60f4c9;
		}
	} else {
		return inClassId==(int)0x7ce6b12b;
	}
}

::String UnhandledException_obj::formatLocation( ::Dynamic source,::String testLocation){
            	HX_STACKFRAME(&_hx_pos_c8bdd1bc462988ff_54_formatLocation)
HXLINE(  55)		::String stackTrace = (HX_(" at ",ad,d3,70,15) + testLocation);
HXLINE(  56)		::String stack = this->getStackTrace(source);
HXLINE(  57)		bool _hx_tmp;
HXDLIN(  57)		if (hx::IsNotNull( stack )) {
HXLINE(  57)			_hx_tmp = (stack.length > (int)1);
            		}
            		else {
HXLINE(  57)			_hx_tmp = false;
            		}
HXDLIN(  57)		if (_hx_tmp) {
HXLINE(  57)			stackTrace = (stackTrace + (HX_(" ",20,00,00,00) + stack.substr((int)1,null())));
            		}
HXLINE(  58)		return stackTrace;
            	}


HX_DEFINE_DYNAMIC_FUNC2(UnhandledException_obj,formatLocation,return )

::String UnhandledException_obj::getStackTrace( ::Dynamic source){
            	HX_STACKFRAME(&_hx_pos_c8bdd1bc462988ff_62_getStackTrace)
HXLINE(  63)		::String s = HX_("",00,00,00,00);
HXLINE(  72)		if ((s == HX_("",00,00,00,00))) {
HXLINE(  74)			::Array< ::Dynamic> stack = ::haxe::CallStack_obj::exceptionStack();
HXLINE(  75)			while((stack->length > (int)0)){
HXLINE(  77)				 ::haxe::StackItem _g = stack->shift().StaticCast<  ::haxe::StackItem >();
HXDLIN(  77)				if (hx::IsNotNull( _g )) {
HXLINE(  77)					switch((int)(_hx_getEnumValueIndex(_g))){
            						case (int)2: {
HXLINE(  79)							int line = _g->_hx_getInt(2);
HXDLIN(  79)							::String file = _g->_hx_getString(1);
HXDLIN(  79)							s = (s + ((((HX_("\tat ",64,eb,3c,06) + file) + HX_(" (",08,1c,00,00)) + line) + HX_(")\n",c1,23,00,00)));
            						}
            						break;
            						case (int)3: {
HXLINE(  80)							::String method = _g->_hx_getString(1);
HXDLIN(  80)							::String classname = _g->_hx_getString(0);
HXDLIN(  80)							s = (s + ((((HX_("\tat ",64,eb,3c,06) + classname) + HX_("#",23,00,00,00)) + method) + HX_("\n",0a,00,00,00)));
            						}
            						break;
            						default:{
            						}
            					}
            				}
            			}
            		}
HXLINE(  90)		return s;
            	}


HX_DEFINE_DYNAMIC_FUNC1(UnhandledException_obj,getStackTrace,return )


hx::ObjectPtr< UnhandledException_obj > UnhandledException_obj::__new( ::Dynamic source,::String testLocation) {
	hx::ObjectPtr< UnhandledException_obj > __this = new UnhandledException_obj();
	__this->__construct(source,testLocation);
	return __this;
}

hx::ObjectPtr< UnhandledException_obj > UnhandledException_obj::__alloc(hx::Ctx *_hx_ctx, ::Dynamic source,::String testLocation) {
	UnhandledException_obj *__this = (UnhandledException_obj*)(hx::Ctx::alloc(_hx_ctx, sizeof(UnhandledException_obj), true, "massive.munit.UnhandledException"));
	*(void **)__this = UnhandledException_obj::_hx_vtable;
	__this->__construct(source,testLocation);
	return __this;
}

UnhandledException_obj::UnhandledException_obj()
{
}

hx::Val UnhandledException_obj::__Field(const ::String &inName,hx::PropertyAccess inCallProp)
{
	switch(inName.length) {
	case 13:
		if (HX_FIELD_EQ(inName,"getStackTrace") ) { return hx::Val( getStackTrace_dyn() ); }
		break;
	case 14:
		if (HX_FIELD_EQ(inName,"formatLocation") ) { return hx::Val( formatLocation_dyn() ); }
	}
	return super::__Field(inName,inCallProp);
}

#if HXCPP_SCRIPTABLE
static hx::StorageInfo *UnhandledException_obj_sMemberStorageInfo = 0;
static hx::StaticInfo *UnhandledException_obj_sStaticStorageInfo = 0;
#endif

static ::String UnhandledException_obj_sMemberFields[] = {
	HX_HCSTRING("formatLocation","\x8c","\x48","\x0b","\x26"),
	HX_HCSTRING("getStackTrace","\x53","\x8e","\xb0","\x85"),
	::String(null()) };

static void UnhandledException_obj_sMarkStatics(HX_MARK_PARAMS) {
	HX_MARK_MEMBER_NAME(UnhandledException_obj::__mClass,"__mClass");
};

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

#endif

hx::Class UnhandledException_obj::__mClass;

void UnhandledException_obj::__register()
{
	hx::Object *dummy = new UnhandledException_obj;
	UnhandledException_obj::_hx_vtable = *(void **)dummy;
	hx::Static(__mClass) = new hx::Class_obj();
	__mClass->mName = HX_HCSTRING("massive.munit.UnhandledException","\x93","\x80","\x42","\x45");
	__mClass->mSuper = &super::__SGetClass();
	__mClass->mConstructEmpty = &__CreateEmpty;
	__mClass->mConstructArgs = &__Create;
	__mClass->mGetStaticField = &hx::Class_obj::GetNoStaticField;
	__mClass->mSetStaticField = &hx::Class_obj::SetNoStaticField;
	__mClass->mMarkFunc = UnhandledException_obj_sMarkStatics;
	__mClass->mStatics = hx::Class_obj::dupFunctions(0 /* sStaticFields */);
	__mClass->mMembers = hx::Class_obj::dupFunctions(UnhandledException_obj_sMemberFields);
	__mClass->mCanCast = hx::TCanCast< UnhandledException_obj >;
#ifdef HXCPP_VISIT_ALLOCS
	__mClass->mVisitFunc = UnhandledException_obj_sVisitStatics;
#endif
#ifdef HXCPP_SCRIPTABLE
	__mClass->mMemberStorageInfo = UnhandledException_obj_sMemberStorageInfo;
#endif
#ifdef HXCPP_SCRIPTABLE
	__mClass->mStaticStorageInfo = UnhandledException_obj_sStaticStorageInfo;
#endif
	hx::_hx_RegisterClass(__mClass->mName, __mClass);
}

} // end namespace massive
} // end namespace munit
