|
PLearn 0.1
|
#include <JulianDateCommand.h>


Public Member Functions | |
| JulianDateCommand () | |
| virtual void | run (const vector< string > &args) |
| The actual implementation of the 'JulianDateCommand' command. | |
Static Protected Attributes | |
| static PLearnCommandRegistry | reg_ |
| This allows to register the 'JulianDateCommand' command in the command registry. | |
Definition at line 53 of file JulianDateCommand.h.
| PLearn::JulianDateCommand::JulianDateCommand | ( | ) |
Definition at line 55 of file JulianDateCommand.cc.
:
PLearnCommand("jdate",
"Convert a Julian Date into a JJ/MM/YYYY date",
"Usage: jdate <julian_day_number> \n"
" To get the equivalent JJ/MM/YYYY date \n"
)
{}
| void PLearn::JulianDateCommand::run | ( | const vector< string > & | args | ) | [virtual] |
The actual implementation of the 'JulianDateCommand' command.
Implements PLearn::PLearnCommand.
Definition at line 66 of file JulianDateCommand.cc.
References PLearn::PDate::day, PLearn::endl(), PLearn::PDate::month, PLERROR, PLearn::toint(), and PLearn::PDate::year.
{
if (args.size() != 1)
PLERROR("jdate expect only 1 argument, the juliay day number");
int jdn = toint(args[0]);
PDate date(jdn);
int dd = date.day;
int mm = date.month;
int yyyy = date.year;
cout << args[0] << " correspond to " << dd << "/" << mm << "/" << yyyy << endl;
}

PLearnCommandRegistry PLearn::JulianDateCommand::reg_ [static, protected] |
This allows to register the 'JulianDateCommand' command in the command registry.
Definition at line 60 of file JulianDateCommand.h.
1.7.4