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;
175 if (countC >=
int(outProcessed)) {
182 const char &
C = strBuf[countC];
187 if (
C ==
' ' ||
C ==
'\n') {
196 const double number = (fNegative ? -1 : 1) * (fMantisseR + fMantisseF /
pow(10, fMantisseFcount)) *
197 pow(10, (fExponentNegative ? -1 : 1) * fExponent);
203 fStartNumber =
false;
206 fReadMantisseR =
true;
207 fReadMantisseF =
false;
208 fReadExponentSign =
false;
209 fReadExponent =
false;
212 fExponentNegative =
false;
223 const int num =
C -
'0';
224 if (
num >= 0 &&
num <= 9) {
225 if (fReadMantisseR) {
227 fMantisseR = fMantisseR * 10 +
num;
228 }
else if (fReadMantisseF) {
230 fMantisseF = fMantisseF * 10 +
num;
232 }
else if (fReadExponent) {
233 fReadExponentSign =
false;
234 fExponent = fExponent * 10 +
num;
243 fReadMantisseR =
true;
244 }
else if (fReadExponentSign) {
245 fExponentNegative =
true;
246 fReadExponentSign =
false;
247 fReadExponent =
true;
249 cout <<
"LzmaFile: found \'" <<
C <<
"\' at wrong position. " << endl;
254 if (!fReadMantisseR) {
255 cout <<
"LzmaFile: found \'" <<
C <<
"\' at wrong position. " << endl;
258 fReadMantisseR =
false;
259 fReadMantisseF =
true;
265 if (!fReadMantisseR || !fReadMantisseF) {
266 fReadMantisseR =
false;
267 fReadMantisseF =
false;
268 fReadExponentSign =
true;
269 fReadExponent =
true;
273 cout <<
"LzmaFile: found \'" <<
C <<
"\' at wrong position. " << endl;
294 if (
res !=
SZ_OK || (thereIsSize && unpackSize == 0))
297 if (inProcessed == 0 && outProcessed == 0) {
309 int thereIsSize = (unpackSize != (
UInt64)(
Int64)-1);
312 if (inPos == inSize) {
318 SizeT inProcessed = inSize - inPos;
323 if (thereIsSize && outProcessed > unpackSize) {
324 outProcessed = (
SizeT)unpackSize;
329 inPos += inProcessed;
330 unpackSize -= outProcessed;
333 for (
k = 0;
k < outProcessed; ++
k) {
334 printf(
"%c", outBuf[
k]);
337 if (
res !=
SZ_OK || (thereIsSize && unpackSize == 0))
340 if (inProcessed == 0 && outProcessed == 0) {