示例#1
0
void RecordOutputMgr::printRecord(const Record *record, const QuickString & value)
{
    _afterVal = value;
    printRecord(record);
    if (!value.empty()) {
        tab();
        _outBuf.append(value);
    }
    newline();

    if (needsFlush()) flush();
}
示例#2
0
bool ComplementFile::fastForward(const QuickString &newChrom) {
	if (!newChrom.empty() && !_genomeFile->hasChrom(newChrom)) return false;

	int i= _currPosInGenomeList +1;
	while (i < (int)_chromList.size() && _chromList[i] != newChrom) {
		_outRecord.setChrName(_chromList[i]);
		_currStartPos = 0;
		int endPos = _genomeFile->getChromSize(_chromList[i]);
		printRecord(endPos);
		i++;
	}
	if (newChrom.empty()) return true;

	if (i== (int)_chromList.size()) {
		//reached end but didn't find new chrom. Genome and DB are not sorted in same order.
		cerr << "***** ERROR: genome file and input file are not sorted in same order. Exiting..." << endl;
		exit(1);
		//this is where we'd return false if we weren't exiting.
	}
	_currChrom = newChrom;
	_currPosInGenomeList = i;
	return true;
}
示例#3
0
void RecordOutputMgr::printRecord(const Record *record, const QuickString & value)
{	
	_afterVal = value;
	bool recordPrinted = false;
	if (record != NULL) {
		printRecord(record);
		recordPrinted = true;
	}
	if (!value.empty()) {
		if (recordPrinted) tab();
		_outBuf.append(value);
	}
	newline();

	if (needsFlush()) flush();
}