#include "stdafx.h"
#include "CLucene.h"
//#include "bindings.h"
//#include "binding_arrays.h"

void Debug::PrintUnclosedObjects(){
#if defined(LUCENE_ENABLE_MEMLEAKTRACKING)
	CL_NS(debug)::LuceneBase::__cl_PrintUnclosedObjects();

#endif
}
void Debug::SetDebugValidityCheck(bool on){
#if defined(LUCENE_ENABLE_MEMLEAKTRACKING)
	_lucene_run_objectcheck = on;
#endif
}

bool Debug::IsBooleanQuery(const CL_NS(search)::Query* q){
	return q->getQueryName() == CL_NS(search)::BooleanQuery::getClassName();
}
CL_NS(search)::BooleanQuery* Debug::ToBooleanQuery(CL_NS(search)::Query* q){
	if (!IsBooleanQuery(q))
		_CLTHROWA(CL_ERR_InvalidCast,"Not a valid cast");
	return (CL_NS(search)::BooleanQuery*)q;
}
