Jpp
18.0.0
the software that should make you happy
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
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
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1514
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1989
JLANG::getline
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
Definition:
JString.hh:478
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JParser.hh
Utility class to parse command line options.
Generated by
1.8.5