<commit_before>package extension.chartboost;

#if android
import openfl.utils.JNI;
#end

#if ios
import flash.Lib;
#end

#if (android || ios)
@:allow(extension.Chartboost) class Chartboost
{
	// Must be called before use of any other methods in this class
	public static function init(?appId:String, ?appSignature:String):Void {
		#if ios
		if (appId == null || appSignature == null) {
			throw "Chartboost appId/appSignature not passed. On iOS appId and appSignature parameters must be passed in Chartboost.init.";
		}
		#end
		
		Chartboost.initBindings();
		
		#if ios
		init_chartboost(appId, appSignature);
		#end
	}
	
	public static function setListener(listener:ChartboostListener):Void {
		if (set_listener == null) {
			#if android
			set_listener = JNI.createStaticMethod(packageName, "setListener", "(Lorg/haxe/lime/HaxeObject;)V");
			#end
			#if ios
			set_listener = Lib.load(namespaceName, "set_listener", 1);
			#end
		}
		
		set_listener(listener);
	}
	
	public static function showInterstitial(id:String):Void {
		show_interstitial(id);
	}

	public static function cacheInterstitial(id:String):Void {
		cache_interstitial(id);
	}

	public static function hasCachedInterstitial(id:String):Bool {
		return has_cached_interstitial(id);
	}
	
	public static function showMoreApps(id:String):Void {
		show_more_apps(id);
	}
	
	public static function cacheMoreApps(id:String):Void {
		cache_more_apps(id);
	}
	
	public static function hasCachedMoreApps(id:String):Bool {
		return has_cached_more_apps(id);
	}
	
	public static function showRewardedVideo(id:String):Void {
		show_rewarded_video(id);
	}
	
	public static function cacheRewardedVideo(id:String):Void {
		cache_rewarded_video(id);
	}
	
	public static function hasCachedRewardedVideo(id:String):Bool {
		return has_cached_rewarded_video(id);
	}
	
	private static function initBindings() {		
		#if ios
		if (init_chartboost == null) {
			init_chartboost = Lib.load(namespaceName, "init_chartboost", 2);
		}
		#end
		
		if (set_listener == null) {
			#if android
			set_listener = JNI.createStaticMethod(packageName, "setListener", "(Lorg/haxe/lime/HaxeObject;)V");
			#end
			#if ios
			set_listener = Lib.load(namespaceName, "set_listener", 1);
			#end
		}
		if (show_interstitial == null) {
			#if android
			show_interstitial = JNI.createStaticMethod(packageName, "showInterstitial", "(Ljava/lang/String;)V");
			#end
			#if ios
			show_interstitial = Lib.load(namespaceName, "show_interstitial", 1);
			#end
		}
		if (cache_interstitial == null) {
			#if android
			cache_interstitial = JNI.createStaticMethod(packageName, "cacheInterstitial", "(Ljava/lang/String;)V");
			#end
			#if ios
			cache_interstitial = Lib.load(namespaceName, "cache_interstitial", 1);
			#end
		}
		if (has_cached_interstitial == null) {
			#if android
			has_cached_interstitial = JNI.createStaticMethod(packageName, "hasCachedInterstitial", "(Ljava/lang/String;)Z");
			#end
			#if ios
			has_cached_interstitial = Lib.load(namespaceName, "has_cached_interstitial", 1);
			#end
		}
		if (show_more_apps == null) {
			#if android
			show_more_apps = JNI.createStaticMethod(packageName, "showMoreApps", "(Ljava/lang/String;)V");
			#end
			#if ios
			show_more_apps = Lib.load(namespaceName, "show_more_apps", 1);
			#end
		}
		if (cache_more_apps == null) {
			#if android
			cache_more_apps = JNI.createStaticMethod(packageName, "cacheMoreApps", "(Ljava/lang/String;)V");
			#end
			#if ios
			cache_more_apps = Lib.load(namespaceName, "cache_more_apps", 1);
			#end
		}
		if (has_cached_more_apps == null) {
			#if android
			has_cached_more_apps = JNI.createStaticMethod(packageName, "hasCachedMoreApps", "(Ljava/lang/String;)Z");
			#end
			#if ios
			has_cached_more_apps = Lib.load(namespaceName, "has_cached_more_apps", 1);
			#end
		}
		if (show_rewarded_video == null) {
			#if android
			show_rewarded_video = JNI.createStaticMethod(packageName, "showRewardedVideo", "(Ljava/lang/String;)V");
			#end
			#if ios
			show_rewarded_video = Lib.load(namespaceName, "show_rewarded_video", 1);
			#end
		}
		if (cache_rewarded_video == null) {
			#if android
			cache_rewarded_video = JNI.createStaticMethod(packageName, "cacheRewardedVideo", "(Ljava/lang/String;)V");
			#end
			#if ios
			cache_rewarded_video = Lib.load(namespaceName, "cache_rewarded_video", 1);
			#end
		}
		if (has_cached_rewarded_video == null) {
			#if android
			has_cached_rewarded_video = JNI.createStaticMethod(packageName, "hasCachedRewardedVideo", "(Ljava/lang/String;)Z");
			#end
			#if ios
			has_cached_rewarded_video = Lib.load(namespaceName, "has_cached_rewarded_video", 1);
			#end
		}
	}
	
	#if android
	private static var packageName:String = "com/samcodes/chartboost/ChartboostExtension";
	#end
	#if ios
	private static var namespaceName:String = "samcodes";
	#end
	
	#if ios
	private static var init_chartboost:Dynamic = null;
	#end
	private static var set_listener:Dynamic = null;
	private static var show_interstitial:Dynamic = null;
	private static var cache_interstitial:Dynamic = null;
	private static var has_cached_interstitial:Dynamic = null;
	private static var show_more_apps:Dynamic = null;
	private static var cache_more_apps:Dynamic = null;
	private static var has_cached_more_apps:Dynamic = null;
	private static var show_rewarded_video:Dynamic = null;
	private static var cache_rewarded_video:Dynamic = null;
	private static var has_cached_rewarded_video:Dynamic = null;
}
#end<commit_msg>Fix dumb bug, Lib.load first parm is ndll name, not cpp namespace name<commit_after>package extension.chartboost;

#if android
import openfl.utils.JNI;
#end

#if ios
import flash.Lib;
#end

#if (android || ios)
@:allow(extension.Chartboost) class Chartboost
{
	// Must be called before use of any other methods in this class
	public static function init(?appId:String, ?appSignature:String):Void {
		#if ios
		if (appId == null || appSignature == null) {
			throw "Chartboost appId/appSignature not passed. On iOS appId and appSignature parameters must be passed in Chartboost.init.";
		}
		#end
		
		Chartboost.initBindings();
		
		#if ios
		init_chartboost(appId, appSignature);
		#end
	}
	
	public static function setListener(listener:ChartboostListener):Void {		
		set_listener(listener);
	}
	
	public static function showInterstitial(id:String):Void {
		show_interstitial(id);
	}

	public static function cacheInterstitial(id:String):Void {
		cache_interstitial(id);
	}

	public static function hasCachedInterstitial(id:String):Bool {
		return has_cached_interstitial(id);
	}
	
	public static function showMoreApps(id:String):Void {
		show_more_apps(id);
	}
	
	public static function cacheMoreApps(id:String):Void {
		cache_more_apps(id);
	}
	
	public static function hasCachedMoreApps(id:String):Bool {
		return has_cached_more_apps(id);
	}
	
	public static function showRewardedVideo(id:String):Void {
		show_rewarded_video(id);
	}
	
	public static function cacheRewardedVideo(id:String):Void {
		cache_rewarded_video(id);
	}
	
	public static function hasCachedRewardedVideo(id:String):Bool {
		return has_cached_rewarded_video(id);
	}
	
	private static function initBindings() {
		#if android
		var packageName:String = "com/samcodes/chartboost/ChartboostExtension";
		#end
		#if ios
		var ndllName:String = "samcodeschartboost";
		#end
		
		#if ios
		if (init_chartboost == null) {
			init_chartboost = Lib.load(ndllName, "init_chartboost", 2);
		}
		#end
		
		if (set_listener == null) {
			#if android
			set_listener = JNI.createStaticMethod(packageName, "setListener", "(Lorg/haxe/lime/HaxeObject;)V");
			#end
			#if ios
			set_listener = Lib.load(ndllName, "set_listener", 1);
			#end
		}
		if (show_interstitial == null) {
			#if android
			show_interstitial = JNI.createStaticMethod(packageName, "showInterstitial", "(Ljava/lang/String;)V");
			#end
			#if ios
			show_interstitial = Lib.load(ndllName, "show_interstitial", 1);
			#end
		}
		if (cache_interstitial == null) {
			#if android
			cache_interstitial = JNI.createStaticMethod(packageName, "cacheInterstitial", "(Ljava/lang/String;)V");
			#end
			#if ios
			cache_interstitial = Lib.load(ndllName, "cache_interstitial", 1);
			#end
		}
		if (has_cached_interstitial == null) {
			#if android
			has_cached_interstitial = JNI.createStaticMethod(packageName, "hasCachedInterstitial", "(Ljava/lang/String;)Z");
			#end
			#if ios
			has_cached_interstitial = Lib.load(ndllName, "has_cached_interstitial", 1);
			#end
		}
		if (show_more_apps == null) {
			#if android
			show_more_apps = JNI.createStaticMethod(packageName, "showMoreApps", "(Ljava/lang/String;)V");
			#end
			#if ios
			show_more_apps = Lib.load(ndllName, "show_more_apps", 1);
			#end
		}
		if (cache_more_apps == null) {
			#if android
			cache_more_apps = JNI.createStaticMethod(packageName, "cacheMoreApps", "(Ljava/lang/String;)V");
			#end
			#if ios
			cache_more_apps = Lib.load(ndllName, "cache_more_apps", 1);
			#end
		}
		if (has_cached_more_apps == null) {
			#if android
			has_cached_more_apps = JNI.createStaticMethod(packageName, "hasCachedMoreApps", "(Ljava/lang/String;)Z");
			#end
			#if ios
			has_cached_more_apps = Lib.load(ndllName, "has_cached_more_apps", 1);
			#end
		}
		if (show_rewarded_video == null) {
			#if android
			show_rewarded_video = JNI.createStaticMethod(packageName, "showRewardedVideo", "(Ljava/lang/String;)V");
			#end
			#if ios
			show_rewarded_video = Lib.load(ndllName, "show_rewarded_video", 1);
			#end
		}
		if (cache_rewarded_video == null) {
			#if android
			cache_rewarded_video = JNI.createStaticMethod(packageName, "cacheRewardedVideo", "(Ljava/lang/String;)V");
			#end
			#if ios
			cache_rewarded_video = Lib.load(ndllName, "cache_rewarded_video", 1);
			#end
		}
		if (has_cached_rewarded_video == null) {
			#if android
			has_cached_rewarded_video = JNI.createStaticMethod(packageName, "hasCachedRewardedVideo", "(Ljava/lang/String;)Z");
			#end
			#if ios
			has_cached_rewarded_video = Lib.load(ndllName, "has_cached_rewarded_video", 1);
			#end
		}
	}
	
	#if ios
	private static var init_chartboost:Dynamic = null;
	#end
	private static var set_listener:Dynamic = null;
	private static var show_interstitial:Dynamic = null;
	private static var cache_interstitial:Dynamic = null;
	private static var has_cached_interstitial:Dynamic = null;
	private static var show_more_apps:Dynamic = null;
	private static var cache_more_apps:Dynamic = null;
	private static var has_cached_more_apps:Dynamic = null;
	private static var show_rewarded_video:Dynamic = null;
	private static var cache_rewarded_video:Dynamic = null;
	private static var has_cached_rewarded_video:Dynamic = null;
}
#end
{'fraction_non_alphanumeric': 0.11300018786398647, 'fraction_numerical': 0.002160435844448619, 'mean_word_length': 4.789559543230016, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '909581', 'n_tokens_mistral': 4247, 'n_tokens_neox': 3705, 'n_words': 778}