#include #include #include #include "Jeep/JScale.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" using namespace std; #define PRINT(out, scale) {\ out << setw(8) << left << #scale << ' ' \ << scientific << setprecision(0) << getValue(scale) << ' ' \ << getUnit(scale) \ << endl; \ } /** * \file * Example program to test JEEP::JScale_t enumeration. * \author mdejong */ int main(int argc, char* argv[]) { using namespace std; char unit; int debug; try { JParser<> zap; zap['U'] = make_field(unit) = ' '; zap['d'] = make_field(debug) = 1; zap(argc, argv); } catch(const exception &error) { FATAL(error.what() << endl); } using namespace JPP; cout << "unit [" << unit << "] " << scientific << setprecision(0) << getValue(getScale(unit)) << endl; PRINT(cout, femto_t); PRINT(cout, pico_t); PRINT(cout, nano_t); PRINT(cout, micro_t); PRINT(cout, milli_t); PRINT(cout, unit_t); PRINT(cout, kilo_t); PRINT(cout, mega_t); PRINT(cout, tera_t); PRINT(cout, peta_t); PRINT(cout, exa_t); }