Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
JEcho.cc
Go to the documentation of this file.
1#include <string>
2#include <iostream>
3#include <iomanip>
4#include <algorithm>
5
6#include "Jeep/JParser.hh"
7#include "Jeep/JMessage.hh"
8
9
10/**
11 * \file
12 *
13 * Auxiliary program to echo (reverted) string.
14 * \author mdejong
15 */
16int main(int argc, char* argv[])
17{
18 using namespace std;
19
20 bool revert;
21
22 try {
23
24 JParser<> zap("Auxiliary program to echo (reverted) string.");
25
26 zap['r'] = make_field(revert);
27
28 zap(argc, argv);
29 }
30 catch(const exception &error) {
31 FATAL(error.what() << endl);
32 }
33
34
35 string buffer;
36
37 while (getline(cin,buffer) && buffer != "") {
38
39 if (revert)
40 reverse(buffer.begin(), buffer.end());
41
42 cout << buffer << endl;
43 }
44}
int main(int argc, char *argv[])
Definition JEcho.cc:16
General purpose messaging.
#define FATAL(A)
Definition JMessage.hh:67
Utility class to parse command line options.
#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