Jpp
examples
JSystem
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
*/
16
int
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
}
JMessage.hh
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1493
JParser.hh
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1954
std
Definition:
jaanetDictionary.h:36
main
int main(int argc, char *argv[])
Definition:
JEcho.cc:16
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JLANG::getline
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
Definition:
JString.hh:468
Generated by
1.8.16