-
Notifications
You must be signed in to change notification settings - Fork 0
/
le.h
67 lines (58 loc) · 1.54 KB
/
le.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
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
/*
* =====================================================================================
*
* Filename: le.h
*
* Description: arquivo header para leitura de arquivos de indice invertido
*
* Version: 1.0
* Created: 02/18/14 23:08:16
* Revision: none
* Compiler: gcc
*
* Author: YOUR NAME (),
* Organization:
*
* =====================================================================================
*/
#include <iostream>
#include <deque>
#include <fstream>
#include <vector>
#include <cmath>
#include <string>
using namespace std;
class Le{
protected:
deque<unsigned int> buffer;
string nome_arquivo;
unsigned long int conta_bits;
streampos tamanho_arquivo;
public:
Le(string narquivo);
virtual ~Le(){};
//metodos de get's e set's
void inicia_nome_arquivo(string narquivo);
void inicia_tamanho_arquivo();
void inicia_conta_bits(unsigned int cb);
unsigned long int pega_conta_bits();
int ler_tripla(deque<unsigned int>& v,int nnum);
int ler_tripla_pos(deque<unsigned int>& v,int pos);
//metodos virtuais
virtual int ler_numero() =0;
virtual void carrega_buffer(ifstream& arquivo,int nnum) =0;
};
class LeNormal:public Le{
public:
LeNormal(string narquivo);
~LeNormal();
int ler_numero();
void carrega_buffer(ifstream& arquivo,int nnum);
};
class LeCompacta: public Le{
public:
LeCompacta(string narquivo);
~LeCompacta();
int ler_numero();
void carrega_buffer(ifstream& arquivo,int nnum);
};