Cryptography Reference
In-Depth Information
The format settings for the output of
LINT
objects can all be carried out with
the help of the manipulators presented in Table 15-2.
Table 15-2.
LINT
manipulators and their effects
Manipulator
Effect: Form of the Output of LINT Values
LintBin
as binary numbers
LintDec
as decimal numbers
LintHex
as hexadecimal numbers
LintOct
as octal numbers
LintLwr
with lowercase letters
a, b, c, d, e, f
for hexadecimal
representation
LintUpr
with uppercase letters
A, B, C, D, E, F
for hexadecimal
representation
LintShowbase
with prefix for the numerical representation
(
0x
or
0X
for hexadecimal,
0b
for binary)
LintNobase
without prefix for numerical representation
LintShowlength
indicating the number of digits
LintNolength
without indicating the number of digits
In addition to the manipulators of Table 15-2, which require no argument,
the manipulators
LINT_omanip<int> SetLintFlags (int flags)
and
LINT_omanip<int> ResetLintFlags (int flags)
are available, which can be used as alternatives to the status functions
LINT::setf()
and
LINT::unsetf()
:
cout << SetLintFlags (LINT::flag) << ...; // turn on
cout << ResetLintFlags (LINT::flag) << ...; // turn off
For the implementation of these manipulators the reader is referred to the
sources (
flintpp.h
and
flintpp.cpp
) in connection with the explanation of the
template
class
omanip<T>
in [Pla2], Chapter 10. The
LINT
flags are shown once
again in Table 15-3.