Example program to test JLANG::JEquation class.
More...
#include <string>
#include <iostream>
#include <fstream>
#include <sstream>
#include <locale>
#include <iomanip>
#include <limits>
#include <iterator>
#include "JLang/JException.hh"
#include "JLang/JEquation.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::JEquation class.
- Author
- mdejong
Definition in file JEquation.cc.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 24 of file JEquation.cc.
33 JParser<> zap(
"Example program to test equation parsing");
40 catch(
const exception &error) {
41 FATAL(error.what() << endl);
47 const int KEY_WIDTH = 6;
48 const int VAL_WIDTH = 30;
51 const JEquationFacet facet(JEquationParameters(
"=",
";\n",
"./",
"#"));
53 ifstream
in(inputFile.c_str());
55 in.imbue(locale(
in.getloc(), facet.clone()));
57 cout << setw(4) <<
" " <<
' '
58 << setw(KEY_WIDTH) << left <<
"key" << SEP <<
' '
59 << setw(VAL_WIDTH) << left <<
"value" << endl;
61 cout << setw(KEY_WIDTH + 5) << setfill(
'-') << left <<
"-"
62 << setw(VAL_WIDTH + 0) << setfill(
'-') << left <<
"+" << setfill(
' ') << endl;
64 for (JEquation equation;
in >> equation; ) {
68 for ( ; facet.isDivision(equation.getSeparator()); ++
i) {
70 cout <<
"[" << setw(2) << right << i <<
"]" <<
' '
71 << setw(KEY_WIDTH) << left << equation.getKey() << SEP <<
' '
72 << setw(VAL_WIDTH) << left << equation.getValue() << endl;
74 equation.setEquation(facet);
77 cout <<
"[" << setw(2) << right << i <<
"]" <<
' '
78 << setw(KEY_WIDTH) << left << equation.getKey() << SEP <<
' '
79 << setw(VAL_WIDTH) << left << equation.getValue() << endl;
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
then fatal The output file must have the wildcard in the e g root fi eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in