Jpp
Functions
examples/Jeep/JPrint.cc File Reference
#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

◆ main()

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 }
FIXED
Auxiliary data structure for floating point format specification.
Definition: JPrint.hh:481
std::vector< int >
JEEPZ
Auxiliary data structure for streaming of STL containers.
Definition: JPrint.hh:558
JPARSER::JParser
Utility class to parse command line options.
Definition: JParser.hh:1493
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JAAnetToolkit.hh:37
debug
int debug
debug level
Definition: JSirene.cc:59
FILL
Auxiliary data structure for sequence of same character.
Definition: JPrint.hh:361
JLANG::RIGHT
Definition: JTwosome.hh:18
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1954
std
Definition: jaanetDictionary.h:36
FATAL
#define FATAL(A)
Definition: JMessage.hh:67
CENTER
Auxiliary data structure for alignment of data.
Definition: JPrint.hh:401
JLANG::LEFT
Definition: JTwosome.hh:18