WXP::DateTool Class Reference

This class manipulates dates. More...

#include "../include/DateTool.h"

List of all members.

Static Public Member Functions

static int getSeconds (const char *str)
static int getMinutes (const char *str)
static int getCurrent (String &str)
static int getCurrent (const char *encode, String &str)
static int decode (const char *str, Date &date)
static int decodeMonth (const char *str)
static const char * getMonthLower (int month)
static const char * getMonth (int month)
static const char * getMonthLong (int month)
static const char * getDayWeek (int day)
static int createLabel (const char *prefix, Date &date, Timezone &tz, int flag, String &str)
static int createLabel (const char *prefix, Date &date, Timezone &tz, String &str)
static int createLabel (Date &date, Timezone &tz, String &str)
static int createLabel (Date &date, String &str)
static int createLabel (Date &date, Timezone &tz, float hour, String &str)
static int createLabel (Date &date, Timezone &tz, const char *name, ForeTime &ftime, String &str)
static int createLabel (Date &date, Timezone &tz, const char *name, float hour, String &str)
static int createLabel (Date &date, const char *name, float hour, String &str)
static int createHourLabel (float hour, int flag, String &str)
static int print (int secs)

Static Public Attributes

static const int DAY_OF_WEEK = 0x1

Detailed Description

This class manipulates dates.

Author:
Dan Vietor

Member Function Documentation

int DateTool::createHourLabel ( float  hour,
int  flag,
String str 
) [static]

Creates a hour string converting hours to days if needed. Multiples of 12 go to x.5 days and multiples of 24 go to x days. Values <= 60 are left as hours unless flag set.

Parameters:
hour Hour value to convert
flag 1=use day values for hours < 60
str Output string

References WXP::String::clear(), WXP::String::copy(), WXP::Const::MISS, and WXP::String::printf().

Referenced by createLabel().

int DateTool::createLabel ( Date date,
Timezone tz,
const char *  name,
float  hour,
String str 
) [static]

Creates a label string from a date, forecast time and source label

Parameters:
date The date class to use
tz The timezone to offset the date
name The source of data label (such as model name)
hour The forecast time in hours
Return values:
str Output string

References WXP::Date::addSeconds(), WXP::String::append(), createHourLabel(), createLabel(), WXP::String::length(), WXP::Const::MISS, WXP::String::set(), and WXP::StrLib::valid().

int DateTool::createLabel ( Date date,
Timezone tz,
const char *  name,
ForeTime ftime,
String str 
) [static]

Creates a label string from a date, forecast time and source label

Parameters:
date The date class to use
tz The timezone to offset the date
name The source of data label (such as model name)
ftime The forecast time
Return values:
str Output string

References WXP::Date::addHours(), WXP::String::append(), createLabel(), WXP::ForeTime::getFore(), WXP::String::set(), and WXP::ForeTime::toTimeLabel().

int DateTool::createLabel ( Date date,
Timezone tz,
float  hour,
String str 
) [static]

Creates a label string from a date adding an hour offset

Parameters:
date The date class to use
tz The output timezone to use
hour Number of hours to offset date
Return values:
str Output string

References WXP::Date::addSeconds(), createLabel(), and WXP::Const::MISS.

int DateTool::createLabel ( Date date,
String str 
) [static]

Creates a label string from a date

Parameters:
date The date class to use
Return values:
str Output string

References createLabel().

int DateTool::createLabel ( const char *  prefix,
Date date,
Timezone tz,
int  flag,
String str 
) [static]
int DateTool::decode ( const char *  str,
Date date 
) [static]

Attempts to decode a string which contains a date and output a Date class

Parameters:
str String to decode
Return values:
date Date class to put result

References WXP::DateVal::day, decodeMonth(), WXP::DateVal::hour, WXP::Date::init(), WXP::DateVal::min, WXP::Const::MISS, WXP::DateVal::month, WXP::DateVal::sec, WXP::Date::set(), and WXP::DateVal::year.

Referenced by WXP::SfcXmlFile::open(), WXP::SfcWxpFile::open(), WXP::SfcUniFile::open(), WXP::SfcCdfFile::open(), and WXP::ImgWxpFile::readHeader().

int DateTool::decodeMonth ( const char *  str  )  [static]

Retrieves a integral month from string

Parameters:
str String to decode
Returns:
Integer month value (1-12)

Referenced by WXP::NameConv::decode(), decode(), and WXP::MosUFile::read().

int DateTool::getCurrent ( const char *  encode,
String str 
) [static]

Returns a string with the current date given a format

Parameters:
encode Format to use
Return values:
str Output string
See also:
Date::toText(char *,String &)

References WXP::StrLib::equal(), WXP::Date::set(), and WXP::Date::toText().

int DateTool::getCurrent ( String str  )  [static]

Returns a string with the current date

Return values:
str String with current date "yyyy mmm dd hh:mm:ssZ"

References WXP::Date::set(), and WXP::Date::toText().

Referenced by WXP::Message::print(), and WXP::PngFile::write().

const char * DateTool::getDayWeek ( int  day  )  [static]

Returns a string for the day of week

Parameters:
day Day of week (0-6)
Returns:
String value (SUN-SAT)
const char * DateTool::getMonth ( int  month  )  [static]

Returns a string for the month

Parameters:
month The month (1-12)
Returns:
String value (JAN-DEC)

Referenced by createLabel().

const char * DateTool::getMonthLong ( int  month  )  [static]

Returns a long string for the month (mixed case)

Parameters:
month The month (1-12)
Returns:
String value (January-December)
const char * DateTool::getMonthLower ( int  month  )  [static]

Returns a string for the month (lower case)

Parameters:
month The month (1-12)
Returns:
String value (JAN-DEC)

Referenced by WXP::NameConv::encode().

int DateTool::getSeconds ( const char *  str  )  [static]

Computes number of seconds from string

Parameters:
str The string to convert

References WXP::DateVal::day, WXP::Date::getSeconds(), WXP::DateVal::hour, WXP::DateVal::min, WXP::DateVal::month, WXP::Date::set(), and WXP::DateVal::year.

Referenced by WXP::Prog::readResrcFile().


The documentation for this class was generated from the following files:

Generated on 8 Jan 2010 for WXP C++ Library by  doxygen 1.6.1