30 fReadMantisseR =
true;
31 fReadMantisseF =
false;
32 fReadExponentSign =
false;
33 fReadExponent =
false;
36 fExponentNegative =
false;
54 <<
" to create it. " << endl;
67 for (
i = 0;
i < 8;
i++)
81 if (fStorage.empty()) {
82 const int ret = DecodeBuffer();
84 cout <<
"Error in ReadNextNumber ret=" <<
ret << endl;
89 data = fStorage.front();
95 for (
int i = 0;
i < length; ++
i) {
96 if (fStorage.empty()) {
97 const int ret = DecodeBuffer();
99 cout <<
"Error in FillArray i=" <<
i <<
" ret=" <<
ret << endl;
104 data[
i] = fStorage.front();
148 const int thereIsSize = (unpackSize != (
UInt64)(
Int64)-1);
150 if (inPos == inSize) {
156 SizeT inProcessed = inSize - inPos;
161 if (thereIsSize && outProcessed > unpackSize) {
162 outProcessed = (
SizeT)unpackSize;
167 inPos += inProcessed;
168 unpackSize -= outProcessed;
170 const char *strBuf = (
const char *)outBuf;
174 if (countC >=
int(outProcessed)) {
181 const char &
C = strBuf[countC];
186 if (
C ==
' ' ||
C ==
'\n') {
195 const double number = (fNegative ? -1 : 1) * (fMantisseR + fMantisseF /
pow(10, fMantisseFcount)) *
196 pow(10, (fExponentNegative ? -1 : 1) * fExponent);
201 fStartNumber =
false;
204 fReadMantisseR =
true;
205 fReadMantisseF =
false;
206 fReadExponentSign =
false;
207 fReadExponent =
false;
210 fExponentNegative =
false;
221 const int num =
C -
'0';
222 if (
num >= 0 &&
num <= 9) {
223 if (fReadMantisseR) {
225 fMantisseR = fMantisseR * 10 +
num;
226 }
else if (fReadMantisseF) {
228 fMantisseF = fMantisseF * 10 +
num;
230 }
else if (fReadExponent) {
231 fReadExponentSign =
false;
232 fExponent = fExponent * 10 +
num;
241 fReadMantisseR =
true;
242 }
else if (fReadExponentSign) {
243 fExponentNegative =
true;
244 fReadExponentSign =
false;
245 fReadExponent =
true;
247 cout <<
"LzmaFile: found \'" <<
C <<
"\' at wrong position. " << endl;
252 if (!fReadMantisseR) {
253 cout <<
"LzmaFile: found \'" <<
C <<
"\' at wrong position. " << endl;
256 fReadMantisseR =
false;
257 fReadMantisseF =
true;
263 if (!fReadMantisseR || !fReadMantisseF) {
264 fReadMantisseR =
false;
265 fReadMantisseF =
false;
266 fReadExponentSign =
true;
267 fReadExponent =
true;
271 cout <<
"LzmaFile: found \'" <<
C <<
"\' at wrong position. " << endl;
292 if (
res !=
SZ_OK || (thereIsSize && unpackSize == 0))
295 if (inProcessed == 0 && outProcessed == 0) {
307 int thereIsSize = (unpackSize != (
UInt64)(
Int64)-1);
310 if (inPos == inSize) {
316 SizeT inProcessed = inSize - inPos;
321 if (thereIsSize && outProcessed > unpackSize) {
322 outProcessed = (
SizeT)unpackSize;
327 inPos += inProcessed;
328 unpackSize -= outProcessed;
331 for (
k = 0;
k < outProcessed; ++
k) {
332 printf(
"%c", outBuf[
k]);
335 if (
res !=
SZ_OK || (thereIsSize && unpackSize == 0))
338 if (inProcessed == 0 && outProcessed == 0) {
void LzmaDec_Free(CLzmaDec *p, ISzAlloc *alloc)
void * MyAlloc(size_t size)
static void * SzAlloc(void *, size_t size)
unsigned long long int UInt64
void MyFree(void *address)
ret
prodAgent to be discontinued
SRes SeqInStream_Read(ISeqInStream *stream, void *buf, size_t size)
SRes ReadNextNumber(double &data)
static void SzFree(void *, void *address)
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
void File_Construct(CSzFile *p)
const char * kDataErrorMessage
const char * kCantReadMessage
const char * kCantWriteMessage
SRes FillArray(double *data, const int length)
const char * kCantAllocateMessage
#define LzmaDec_Construct(p)
WRes File_Close(CSzFile *p)
char data[epos_bytes_allocation]
void FileSeqInStream_CreateVTable(CFileSeqInStream *p)
void LzmaDec_Init(CLzmaDec *p)
SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status)
SRes LzmaDec_Allocate(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc)
SRes Open(const std::string &fileName)
WRes InFile_Open(CSzFile *p, const char *name)