Blame view

morfeusz/deserialization/InterpsGroupsReader.cpp 746 Bytes
Michał Lenart authored
1
2
3
4
5
6
7
8
/* 
 * File:   InterpsGroupsReader.cpp
 * Author: mlenart
 * 
 * Created on 16 maj 2014, 12:50
 */

#include "InterpsGroupsReader.hpp"
Michał Lenart authored
9
#include "deserialization/deserializationUtils.hpp"
Michał Lenart authored
10
Michał Lenart authored
11
12
namespace morfeusz {
Michał Lenart authored
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
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;
}
Michał Lenart authored
39
40

}