Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Hydra Core Library Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

rwsf::TimeSpan

Group:  General

Local Index

Members

Header File

#include <rwsf/core/TimeSpan.h>

Description

rwsf::TimeSpan represents a period as defined by ISO8601. The serialized version of this type takes the format PnYnMnDTnHnMnS, where nY represents the number of years, nM the number of months, nD the number of days, T is the date/time separator, nH the number of hours, nM the number of minutes, and nS the number of seconds. The number of seconds can include decimal digits.

This class provides constructors to create a timespan instance, and convenience methods to access its different parts. An instance of this class can be constructed either from a valid duration string, or by providing values for each of the parts of a duration. This class also provides operators and methods to add a duration to an rwsf::DateTime instance, and to determine the ordering relationship between two durations

An instance of this class validates the data it contains whenever the data changes. If the string is valid, the object marks itself valid. If the string is invalid, the object marks itself invalid.

Public Constructors

TimeSpan(unsigned long years = 0,
         unsigned long months = 0,
         unsigned long days = 0,
         unsigned long hours = 0,
         unsigned long minutes = 0,
         double seconds = 0.0 );
TimeSpan(const std::string& duration);
TimeSpan(const TimeSpan& other);

Public Destructor

virtual
~TimeSpan();

Public Member Functions

virtual std::string
asString() const;
virtual int
compareTo(const TimeSpan& rhs);
virtual void
extract(const std::string& duration);
unsigned long
getDays() const;
unsigned long
getHours() const;
unsigned long
getMinutes() const;
unsigned long
getMonths() const;
double
getSeconds() const;
unsigned long
getYears() const;
virtual bool
isEqual(const TimeSpan& rhs);
bool
isNegative() const;
bool
isValid() const;
void
setDays(unsigned long days);
void
setHours(unsigned long hours);
void
setMinutes(unsigned long minutes);
void
setMonths(unsigned long months);
void
setSeconds(double seconds);
void
setYears(unsigned long years);

Public Member Operators

DateTime
operator+(const rwsf::DateTime& aDateTime ) const;
TimeSpan&
operator=(const TimeSpan& rhs); 
TimeSpan&
operator-();


Previous fileTop of DocumentContentsIndex pageNext file

©2004-2007 Copyright Quovadx, Inc. All Rights Reserved.
Quovadx and Rogue Wave are registered trademarks and HydraSDO is a trademark of Quovadx, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.