Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
examples/Jeep/JPrint.cc File Reference

Example program to test print auxiliaries. More...

#include <string>
#include <iostream>
#include <iomanip>
#include <vector>
#include "Jeep/JPrint.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Detailed Description

Example program to test print auxiliaries.

Author
mdejong

Definition in file examples/Jeep/JPrint.cc.

Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 16 of file examples/Jeep/JPrint.cc.

17 {
18  using namespace std;
19  using namespace JPP;
20 
21  int debug;
22 
23  try {
24 
25  JParser<> zap;
26 
27  zap['d'] = make_field(debug) = 1;
28 
29  zap(argc, argv);
30  }
31  catch(const exception &error) {
32  FATAL(error.what() << endl);
33  }
34 
35  for (int value = 1; value < 1000000000; value *= 10) {
36  cout << "CENTER <" << CENTER(12) << value << ">" << endl;
37  }
38 
39  for (int value = 1; value < 1000000000; value *= 10) {
40  cout << "FILL <" << FILL(12,'.') << value << ">" << FILL() << endl;
41  }
42 
43  for (int value = 1; value < 1000000000; value *= 10) {
44  cout << "RIGHT <" << RIGHT(12) << value << ">" << endl;
45  }
46 
47  for (int value = 1; value < 1000000000; value *= 10) {
48  cout << "LEFT <" << LEFT(12) << value << ">" << endl;
49  }
50 
51  for (double value = 0.123456; value < 100000; value *= 10) {
52  cout << "FIXED <" << FIXED(12,6) << value << ">" << endl;
53  }
54 
55  vector<int> buffer;
56 
57  for (int i = 0; i != 10; ++i) {
58  buffer.push_back(i);
59  }
60 
61  //cout << buffer << endl; // compiler error
62  cout << "JEEPZ " << JEEPZ() << buffer << endl;
63 }
Utility class to parse command line options.
Definition: JParser.hh:1493
Auxiliary data structure for floating point format specification.
Definition: JPrint.hh:481
Auxiliary data structure for alignment of data.
Definition: JPrint.hh:401
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1954
int debug
debug level
Definition: JSirene.cc:61
Auxiliary data structure for streaming of STL containers.
Definition: JPrint.hh:558
Auxiliary data structure for sequence of same character.
Definition: JPrint.hh:361
#define FATAL(A)
Definition: JMessage.hh:67