GffPlusRecord.cpp 1.41 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#include "GffPlusRecord.h"
#include "SingleLineDelimTextFileReader.h"

GffPlusRecord::GffPlusRecord()
: _numPrintFields(0)
{
}

GffPlusRecord::~GffPlusRecord() {

}

bool GffPlusRecord::initFromFile(SingleLineDelimTextFileReader *fileReader)
{
	if (!GffRecord::initFromFile(fileReader)) {
		return false;
	}
	_plusFields.setNumOffsetFields(GffRecord::getNumFields());
	return _plusFields.initFromFile(fileReader);
}


void GffPlusRecord::clear() {
	GffRecord::clear();
	_plusFields.clear();
}

void GffPlusRecord::print(QuickString &outBuf) const
{
	GffRecord::print(outBuf);
	_plusFields.printFields(outBuf);
}

void GffPlusRecord::print(QuickString &outBuf, int start, int end) const
{
	GffRecord::print(outBuf, start, end);
	_plusFields.printFields(outBuf);
}

void GffPlusRecord::print(QuickString &outBuf, const QuickString & start, const QuickString & end) const
{
	GffRecord::print(outBuf, start, end);
	_plusFields.printFields(outBuf);
}


void GffPlusRecord::printNull(QuickString &outBuf) const
{
	GffRecord::printNull(outBuf);
	for (int i=_numFields; i < _numPrintFields; i++) {
		outBuf.append("\t.");
	}
}

const QuickString &GffPlusRecord::getField(int fieldNum) const
{
	if (fieldNum > _numFields) {
		return _plusFields.getField(fieldNum);
	}
	return GffRecord::getField(fieldNum);
}

bool GffPlusRecord::isNumericField(int fieldNum) {

	if (fieldNum < 9) {
		return GffRecord::isNumericField(fieldNum);
	}
	return true;
}