-
Notifications
You must be signed in to change notification settings - Fork 0
/
InputReader.h
34 lines (29 loc) · 1006 Bytes
/
InputReader.h
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
#ifndef INPUTREADER_H
#define INPUTREADER_H
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <fstream>
#include "Utils.h"
#include "Alphabet.h"
class InputReader
{
public:
InputReader();
virtual bool init(const std::string &fileName, uint64 offsetStart = 0)=0;
virtual std::string nextValidToken(uint64 *currentFileOffset)=0;
virtual void closeFile()=0;
bool isProcessed () {return this->processed;}
void setProcessed(bool val) {this->processed=val;}
char getSentinel(); //returns a character one less than first valid alphabet char - to sort properly
short getAlphabetSize() {return this->alphabet->getSize();}
short getBinID (char alphabetChar){return this->alphabet->getBinID(alphabetChar);}
char getUnifiedCharacter(char originalCharacter){return this->alphabet->getUnifiedCharacter(originalCharacter);}
void setSentinel(){this->alphabet->setSentinel();}
protected:
Alphabet *alphabet;
private:
bool processed;
};
#endif