#include #include #include #include #include "JLang/JTypeList.hh" #include "JLang/JObjectOutput.hh" #include "JLang/JStreamObjectOutput.hh" #include "JLang/JObjectWriter.hh" #include "JLang/JASCIIFileWriter.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * \file * * Example program to test JLANG::JObjectOutput class. * \author mdejong */ int main(int argc, char **argv) { using namespace std; int debug; try { JParser<> zap("Example program to test object output."); zap['d'] = make_field(debug) = 3; zap(argc, argv); } catch(const exception &error) { FATAL(error.what() << endl); } using namespace JPP; typedef JTYPELIST::typelist JTypelist_t; stringstream io; JObjectOutput* out = new JStreamObjectOutput(io, "\n"); const int ival = 1; const int fval = 3.1415; const string sval = "aap"; out->put(ival); out->put(fval); out->put(sval); int __ival; float __fval; string __sval; io >> __ival >> __fval >> __sval; ASSERT(ival == __ival); ASSERT(fval == __fval); ASSERT(sval == __sval); delete out; return 0; }