Cryptography Reference
In-Depth Information
LINT::panic (E_LINT_EOF, "ifstream operator>>", 0, __LINE__);
}
if (DIGITS_L (ln.n_l) < CLINTMAXSHORT)
{
for(inti=1;i<=DIGITS_L (ln.n_l); i++)
{
if (read_ind_ushort (s, &ln.n_l[i]))
{
LINT::panic (E_LINT_EOF, "ifstream operator>>", 0, __LINE__);
}
}
}
// No paranoia! Check the imported value!
if (vcheck_l (ln.n_l) == 0)
{
ln.status = E_LINT_OK;
}
else
{
ln.status = E_LINT_INV;
}
return s;
}
To open a file from which the
LINT
object is to be read it is again necessary to
set the
ios
flag
ios::binary
:
LINT r, s;
// ...
ifstream fin;
fin.open ("test.io", ios::in | ios::binary);
fin>>r>>s;
// ...
fin.close();
In the importation of
LINT
objects the
insert
operator
>>
checks whether the
values read represent the numerical representation of a valid
LINT
object. If this
is not the case, the member datum
status
is set to
E_LINT_INV
, and the specified
target object is thereby marked as “uninitialized.” On the next operation on this
object the
LINT
error handler is invoked, which is what we shall study in more
detail in the next chapter.