92 catch(
const exception &error) {
93 FATAL(error.what() << endl);
96 for (
int value = 1; value < 1000000000; value *= 10) {
97 cout <<
"CENTER <" <<
CENTER(12) << value <<
">" << endl;
100 for (
int value = 1; value < 1000000000; value *= 10) {
101 cout <<
"FILL <" <<
FILL(12,
'.') << value <<
">" <<
FILL() << endl;
104 for (
int value = 1; value < 1000000000; value *= 10) {
105 cout <<
"RIGHT <" <<
RIGHT(12) << value <<
">" << endl;
108 for (
int value = 1; value < 1000000000; value *= 10) {
109 cout <<
"LEFT <" <<
LEFT(12) << value <<
">" << endl;
112 for (
double value = 0.123456; value < 100000; value *= 10) {
113 cout <<
"FIXED <" <<
FIXED(12,6) << value <<
">" << endl;
118 const double c = 12.34;
123 cout << setprecision(3);
125 cout <<
"A <" <<
a <<
">" << endl;
126 cout <<
"c <" << c <<
">" << endl;
127 cout <<
"B <" << b <<
">" << endl;
128 cout <<
"c <" << c <<
">" << endl;
130 setFormat<A>(
JFormat_t(12, 3, std::ios::scientific));
131 setFormat<B>(
JFormat_t( 5, 2, std::ios::fixed));
133 cout <<
"A <" <<
a <<
">" << endl;
134 cout <<
"c <" << c <<
">" << endl;
135 cout <<
"B <" << b <<
">" << endl;
136 cout <<
"c <" << c <<
">" << endl;
148 const int i = 123456;
150 os[0] << setw(12) << left << i;
151 os[1] <<
LEFT(12) << i;
153 ASSERT(os[0].str() == os[1].str(),
"<" << os[0].str() <<
"> == <" << os[1].str() <<
">");
158 const int i = 123456;
160 os[0] << setw(12) << right << i;
161 os[1] <<
RIGHT(12) << i;
163 ASSERT(os[0].str() == os[1].str(),
"<" << os[0].str() <<
"> == <" << os[1].str() <<
">");
168 const int i = 123456;
170 os[0] << setw(12) << setfill(
'0') << i;
171 os[1] <<
FILL(12,
'0') << i;
173 ASSERT(os[0].str() == os[1].str(),
"<" << os[0].str() <<
"> == <" << os[1].str() <<
">");
178 const double x = 123.456;
180 os[0] << setw(12) << setprecision(5) << fixed << x;
181 os[1] <<
FIXED(12,5) << x;
183 ASSERT(os[0].str() == os[1].str(),
"<" << os[0].str() <<
"> == <" << os[1].str() <<
">");
188 const double x = 123.456;
190 os[0] << setw(12) << setprecision(2) << scientific << x;
193 ASSERT(os[0].str() == os[1].str(),
"<" << os[0].str() <<
"> == <" << os[1].str() <<
">");
199 cout <<
LAMBDA([
v = V](ostream& out) {
for (
const auto& i :
v) { out <<
" " << i; } }) << endl;
Utility class to parse command line options.
Auxiliary data structure for floating point format specification.
Auxiliary data structure for alignment of data.
static const double C
Physics constants.
#define ASSERT(A,...)
Assert macro.
Auxiliary data structure to convert (lambda) function to printable object.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
std::ostream & shortprint(std::ostream &out)
Set short printing.
Auxiliary data structure for sequence of same character.
std::ostream & longprint(std::ostream &out)
Set long printing.
Auxiliary data structure for floating point format specification.
source $JPP_DIR setenv csh $JPP_DIR eval JShellParser o a A
std::ostream & mediumprint(std::ostream &out)
Set medium printing.