All pastes #101250 Raw Edit

Unnamed

public cpp v1 · immutable
#101250 ·published 2006-07-26 19:25 UTC
rendered paste body
NS_IMETHODIMP lizLayer::GetAllFeature(PRUint32 *count, lizIFeature ***allFeature) {	if (!_OGRLayer) return NS_ERROR_NOT_INITIALIZED;	nsresult rv;	unsigned int fCount = _OGRLayer->GetFeatureCount();	unsigned int i = 0;	*count = fCount;	//FIXME: use malloc ???	*allFeature = (lizIFeature**)malloc(f	Count * sizeof(lizIFeature*));	OGRFeature * ft;	for (i = 0; i < fCount; i++) {		PR_fprintf(PR_STDERR, "--- %i / %i\n", i, fCount);		ft = _OGRLayer->GetNextFeature();		if (ft) {			//FIXME: check rv			nsCOMPtr<lizIFeature> alizFeature = do_CreateInstance("@3liz.org/geo/lizFeature;1", &rv);			alizFeature->Init((void *)ft);			NS_ADDREF((*allFeature)[i] = alizFeature);		}	}	return NS_OK;}