Jpp 19.3.0-rc.3
the software that should make you happy
Loading...
Searching...
No Matches
JObjectWriter.cc File Reference

Example program to test JLANG::JObjectWriter class. More...

#include <string>
#include <iostream>
#include <iomanip>
#include "JLang/JTypeList.hh"
#include "JLang/JObjectWriter.hh"
#include "JLang/JASCIIFileWriter.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 JLANG::JObjectWriter class.

Author
mdejong

Definition in file JObjectWriter.cc.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 20 of file JObjectWriter.cc.

21{
22 using namespace std;
23
24 string outputFile;
25 int debug;
26
27 try {
28
29 JParser<> zap("Example program to test object writing class.");
30
31 zap['o'] = make_field(outputFile);
32 zap['d'] = make_field(debug) = 0;
33
34 zap(argc, argv);
35 }
36 catch(const exception &error) {
37 FATAL(error.what() << endl);
38 }
39
40
41 using namespace JPP;
42
43 typedef
44 JTypeList<int,
45 JTypeList<string> > JTypelist_t;
46
48
49 out.reset(new JASCIIFileWriter<JTypelist_t>(outputFile.c_str(), "\n"));
50
51 out.put(1);
52 out.put("noot");
53 out.put(3);
54
55 out.close();
56}
string outputFile
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:72
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
Object(s) writing to ASCII file.
virtual void reset() override
Reset pointer.
Utility class to parse command line options.
Definition JParser.hh:1698
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
virtual void close() override
Close device.
virtual bool put(const T &object) override
Object output.
Auxiliary class for object writing with named access.
Type list.
Definition JTypeList.hh:23