InterpsGroupsReader.cpp
746 Bytes
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
/*
* File: InterpsGroupsReader.cpp
* Author: mlenart
*
* Created on 16 maj 2014, 12:50
*/
#include "InterpsGroupsReader.hpp"
#include "deserialization/deserializationUtils.hpp"
namespace morfeusz {
InterpsGroupsReader::InterpsGroupsReader()
: currPtr(NULL), endPtr(NULL) {
}
InterpsGroupsReader::InterpsGroupsReader(const unsigned char* ptr, long size)
: currPtr(ptr), endPtr(ptr + size) {
}
InterpsGroupsReader::~InterpsGroupsReader() {
}
bool InterpsGroupsReader::hasNext() const {
return currPtr < endPtr;
}
InterpsGroup InterpsGroupsReader::getNext() {
InterpsGroup ig;
ig.type = readInt8(currPtr);
ig.size = readInt16(currPtr);
ig.ptr = currPtr;
currPtr += ig.size;
return ig;
}
}