-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinput_reader.hpp
39 lines (31 loc) · 872 Bytes
/
input_reader.hpp
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
#pragma once
#include <Windows.h>
#include <tchar.h>
#include <vector>
#include "cpp_tstring.hpp"
#include "console.hpp"
struct BaseInputReader {
bool inputExhausted = false;
virtual bool getIsInputExhausted() {
return this->inputExhausted;
}
virtual unsigned long long int read() = 0;
virtual std::vector<unsigned long long int> readRemainingInput();
virtual ~BaseInputReader() {};
};
struct FileInputReader : BaseInputReader {
HANDLE hFile;
FileInputReader(tstring file);
virtual unsigned long long int read();
virtual bool getIsInputExhausted();
~FileInputReader();
};
struct ConsoleInputReader : BaseInputReader {
virtual unsigned long long int read();
virtual bool getIsInputExhausted();
};
struct TestInputReader : BaseInputReader {
unsigned long long int i = 1;
virtual unsigned long long int read();
virtual bool getIsInputExhausted();
};