Example program to test JLANG::JWhiteSpacesFacet class.
More...
#include <string>
#include <iostream>
#include <fstream>
#include <locale>
#include <iomanip>
#include "JLang/JWhiteSpacesFacet.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
Example program to test JLANG::JWhiteSpacesFacet class.
- Author
- mdejong
Definition in file JWhiteSpacesFacet.cc.
◆ main()
int main |
( |
int | argc, |
|
|
char ** | argv ) |
Definition at line 20 of file JWhiteSpacesFacet.cc.
21{
23
24 string ws;
25 string inputFile;
27
28 try {
29
30 JParser<> zap(
"Example program to test white spaces handling using facet.");
31
35
36 zap(argc, argv);
37 }
38 catch(const exception &error) {
39 FATAL(error.what() << endl);
40 }
41
42
44
45
46 if (inputFile == "") {
47
48 for ( ; ; ) {
49
50 cout << "> " << flush;
51
52 string buffer;
53
55
56 if (buffer != "") {
57
58 istringstream is(buffer);
59
61
63
64 for (
string key; is >>
key; ) {
66 }
67
68 } else
69
70 break;
71 }
72
73 } else {
74
75 ifstream in(inputFile.c_str());
76
78
79 for (
string key; in >>
key; ) {
81 }
82
83 in.close();
84 }
85}
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Auxiliary class to specify white space character(s) in currect locale.
Utility class to parse command line options.
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).