Jpp  master_rocky-37-gf0c5bc59d
the software that should make you happy
Functions
JComment.cc File Reference

Example program to test file name handling using JEEP::JComment. More...

#include <iostream>
#include <sstream>
#include <iomanip>
#include <string>
#include "JSupport/JMeta.hh"
#include "Jeep/JComment.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 file name handling using JEEP::JComment.

Author
mdejong

Definition in file JComment.cc.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 18 of file JComment.cc.

19 {
20  using namespace std;
21  using namespace JPP;
22 
23  int debug;
24 
25  try {
26 
27  JParser<> zap("Example program to test comments.");
28 
29  zap['d'] = make_field(debug) = 1;
30 
31  zap(argc, argv);
32  }
33  catch(const exception &error) {
34  FATAL(error.what() << endl);
35  }
36 
37  JComment comment;
38 
39  comment.add("This is a comment");
40  comment.add(JMeta(argc, argv));
41 
42  NOTICE(comment);
43 
44  stringstream io;
45 
46  io << comment;
47 
48  JComment buffer;
49 
50  io >> buffer;
51 
52  DEBUG(buffer);
53 
54  ASSERT(comment == buffer);
55 
56  return 0;
57 }
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62
#define ASSERT(A,...)
Assert macro.
Definition: JMessage.hh:90
#define NOTICE(A)
Definition: JMessage.hh:64
#define FATAL(A)
Definition: JMessage.hh:67
int debug
debug level
Definition: JSirene.cc:69
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:2142
Utility class to parse command line options.
Definition: JParser.hh:1698
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JSTDTypes.hh:14
Auxiliary class for comment.
Definition: JComment.hh:43
JComment & add(const std::string &comment)
Add comment.
Definition: JComment.hh:100
Auxiliary class for ROOT I/O of application specific meta data.
Definition: JMeta.hh:72