static int32_t countOverlapsEntry(GTFtree *t, GTFentry *e, uint32_t start, uint32_t end, int strand, int matchType, int strandType, int direction, int32_t max, FILTER_ENTRY_FUNC ffunc) { int dir; int32_t cnt = 0; if(!e) return cnt; switch(matchType) { case GTF_MATCH_EXACT : if((dir = rangeExact(start, end, e)) == 0) { cnt = 1; } break; case GTF_MATCH_WITHIN : if((dir = rangeAny(start, end, e)) == 0) { if(rangeWithin(start, end, e) == 0) cnt = 1; } break; case GTF_MATCH_CONTAIN : if((dir = rangeAny(start, end, e)) == 0) { if(rangeContains(start, end, e) == 0) cnt = 1; } break; case GTF_MATCH_START : if((dir = rangeStart(start, end, e)) == 0) { cnt = 1; } break; case GTF_MATCH_END : if((dir = rangeEnd(start, end, e)) == 0) { cnt = 1; } break; default : if((dir = rangeAny(start, end, e)) == 0) { cnt = 1; } break; } if(cnt) { if(!matchingStrand(e, strand, strandType)) cnt = 0; } if(cnt && ffunc) { if(!ffunc(t, e)) cnt = 0; } if(max && cnt >= max) return max; if(direction) { if(dir > 0) return cnt; return cnt + countOverlapsEntry(t, e->right, start, end, strand, matchType, strandType, direction, max, ffunc); } else { if(dir < 0) return cnt; return cnt + countOverlapsEntry(t, e->left, start, end, strand, matchType, strandType, direction, max, ffunc); } }
static void pushOverlaps(overlapSet *os, GTFtree *t, GTFentry *e, uint32_t start, uint32_t end, int comparisonType, int direction, FILTER_ENTRY_FUNC ffunc) { int dir; int keep = 1; if(!e) return; if(ffunc) keep = ffunc(t, e); switch(comparisonType) { case GTF_MATCH_EXACT : if((dir = rangeExact(start, end, e)) == 0) { if(keep) os_push(os, e); } break; case GTF_MATCH_WITHIN : if((dir = rangeAny(start, end, e)) == 0) { if(keep) if(rangeWithin(start, end ,e) == 0) os_push(os, e); } break; case GTF_MATCH_CONTAIN : if((dir = rangeAny(start, end, e)) == 0) { if(keep) if(rangeContains(start, end, e) == 0) os_push(os, e); } break; case GTF_MATCH_START : if((dir = rangeStart(start, end, e)) == 0) { if(keep) os_push(os, e); } break; case GTF_MATCH_END : if((dir = rangeEnd(start, end, e)) == 0) { if(keep) os_push(os, e); } break; default : if((dir = rangeAny(start, end, e)) == 0) { if(keep) os_push(os, e); } break; } if(direction) { if(dir > 0) return; pushOverlaps(os, t, e->right, start, end, comparisonType, direction, ffunc); } else { if(dir < 0) return; pushOverlaps(os, t, e->left, start, end, comparisonType, direction, ffunc); } }
bool QXmlUtils::isBaseChar(const QChar c) { return rangeContains(g_base_begin, g_base_end, c); }
bool QXmlUtils::isExtender(const QChar c) { return rangeContains(g_extender_begin, g_extender_end, c); }
bool QXmlUtils::isDigit(const QChar c) { return rangeContains(g_digit_begin, g_digit_end, c); }
bool QXmlUtils::isCombiningChar(const QChar c) { return rangeContains(g_combining_begin, g_combining_end, c); }
bool QXmlUtils::isIdeographic(const QChar c) { return rangeContains(g_ideographic_begin, g_ideographic_end, c); }