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
68
69
70
|
#ifndef _include_LzmaFile_h_
#define _include_LzmaFile_h_
#include "Types.h"
#include "7zFile.h"
#include "LzmaDec.h"
#include <string>
#include <queue>
#include "LzmaDec.h"
#include "Alloc.h"
#include "Types.h"
#include "7zFile.h"
#include <sstream>
#include <string>
#include <iostream>
#include <queue>
#define IN_BUF_SIZE (1 << 16)
#define OUT_BUF_SIZE (1 << 16)
struct LzmaFile {
LzmaFile();
SRes Open(const std::string& fileName);
SRes Close();
SRes DecodeAll();
SRes DecodeBuffer();
//SRes DecodeArray(double* data, const int length);
SRes ReadNextNumber(double& data);
SRes FillArray(double* data, const int length);
CFileSeqInStream inStream;
int res;
CLzmaDec state;
// std::ostringstream fStrNumber;
UInt64 unpackSize;
Byte inBuf[IN_BUF_SIZE];
Byte outBuf[OUT_BUF_SIZE];
std::queue<double> fStorage;
size_t inPos;
size_t inSize;
size_t outPos;
// string converting
bool fStartNumber;
bool fReadSign;
bool fReadMantisseR;
bool fReadMantisseF;
bool fReadExponentSign;
bool fReadExponent;
bool fNegative;
bool fExponentNegative;
double fMantisseR;
double fMantisseF;
int fMantisseFcount;
int fExponent;
};
#endif
|