PLearn 0.1
Public Member Functions | Static Protected Attributes
PLearn::JulianDateCommand Class Reference

#include <JulianDateCommand.h>

Inheritance diagram for PLearn::JulianDateCommand:
Inheritance graph
[legend]
Collaboration diagram for PLearn::JulianDateCommand:
Collaboration graph
[legend]

List of all members.

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.

Detailed Description

Definition at line 53 of file JulianDateCommand.h.


Constructor & Destructor Documentation

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"
        ) 
{}

Member Function Documentation

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;
}

Here is the call graph for this function:


Member Data Documentation

This allows to register the 'JulianDateCommand' command in the command registry.

Definition at line 60 of file JulianDateCommand.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines