SAGA API  v9.6
CSG_TimeSpan Class Reference

#include <datetime.h>

Public Member Functions

 CSG_TimeSpan (void)
 
 CSG_TimeSpan (const CSG_TimeSpan &ts)
 
 CSG_TimeSpan (const sLong &diff)
 
 CSG_TimeSpan (double hours)
 
 CSG_TimeSpan (long hours, long min=0, sLong sec=0, sLong msec=0)
 
CSG_TimeSpanAdd (const CSG_TimeSpan &ts)
 
CSG_TimeSpanSubtract (const CSG_TimeSpan &ts)
 
CSG_TimeSpanMultiply (int n)
 
CSG_TimeSpanoperator+= (const CSG_TimeSpan &ts)
 
CSG_TimeSpanoperator-= (const CSG_TimeSpan &ts)
 
CSG_TimeSpanoperator*= (int n)
 
CSG_TimeSpan Add (const CSG_TimeSpan &ts) const
 
CSG_TimeSpan Subtract (const CSG_TimeSpan &ts) const
 
CSG_TimeSpan Multiply (int n) const
 
CSG_TimeSpan operator+ (const CSG_TimeSpan &ts) const
 
CSG_TimeSpan operator- (const CSG_TimeSpan &ts) const
 
CSG_TimeSpan operator* (int n) const
 
CSG_TimeSpan Abs (void) const
 
CSG_TimeSpan Negate (void) const
 
CSG_TimeSpanNeg (void)
 
CSG_TimeSpanoperator- (void)
 
bool is_Null (void) const
 
bool is_Positive (void) const
 
bool is_Negative (void) const
 
bool operator! (void) const
 
bool is_EqualTo (const CSG_TimeSpan &ts) const
 
bool is_LongerThan (const CSG_TimeSpan &ts) const
 
bool is_ShorterThan (const CSG_TimeSpan &ts) const
 
bool operator< (const CSG_TimeSpan &ts) const
 
bool operator<= (const CSG_TimeSpan &ts) const
 
bool operator== (const CSG_TimeSpan &ts) const
 
bool operator!= (const CSG_TimeSpan &ts) const
 
bool operator>= (const CSG_TimeSpan &ts) const
 
bool operator> (const CSG_TimeSpan &ts) const
 
int Get_Weeks (void) const
 
int Get_Days (void) const
 
int Get_Hours (void) const
 
int Get_Minutes (void) const
 
sLong Get_Seconds (void) const
 
sLong Get_Milliseconds (void) const
 
sLong Get_Value (void) const
 
CSG_String Format (const CSG_String &format="") const
 

Static Public Member Functions

static CSG_TimeSpan Milliseconds (sLong ms)
 
static CSG_TimeSpan Seconds (sLong sec)
 
static CSG_TimeSpan Minutes (long min)
 
static CSG_TimeSpan Hours (long hours)
 
static CSG_TimeSpan Days (long days)
 
static CSG_TimeSpan Weeks (long days)
 
static CSG_TimeSpan Millisecond (void)
 
static CSG_TimeSpan Second (void)
 
static CSG_TimeSpan Minute (void)
 
static CSG_TimeSpan Hour (void)
 
static CSG_TimeSpan Day (void)
 
static CSG_TimeSpan Week (void)
 

Friends

class CSG_DateTime
 

Detailed Description

Definition at line 90 of file datetime.h.

Constructor & Destructor Documentation

◆ CSG_TimeSpan() [1/5]

CSG_TimeSpan::CSG_TimeSpan ( void  )
inline

Definition at line 96 of file datetime.h.

◆ CSG_TimeSpan() [2/5]

CSG_TimeSpan::CSG_TimeSpan ( const CSG_TimeSpan ts)
inline

Definition at line 97 of file datetime.h.

◆ CSG_TimeSpan() [3/5]

CSG_TimeSpan::CSG_TimeSpan ( const sLong diff)
inline

Definition at line 98 of file datetime.h.

◆ CSG_TimeSpan() [4/5]

CSG_TimeSpan::CSG_TimeSpan ( double  hours)
inline

Definition at line 99 of file datetime.h.

◆ CSG_TimeSpan() [5/5]

CSG_TimeSpan::CSG_TimeSpan ( long  hours,
long  min = 0,
sLong  sec = 0,
sLong  msec = 0 
)
inline

Definition at line 100 of file datetime.h.

Member Function Documentation

◆ Abs()

CSG_TimeSpan CSG_TimeSpan::Abs ( void  ) const
inline

Definition at line 137 of file datetime.h.

◆ Add() [1/2]

CSG_TimeSpan& CSG_TimeSpan::Add ( const CSG_TimeSpan ts)
inline

Definition at line 121 of file datetime.h.

◆ Add() [2/2]

CSG_TimeSpan CSG_TimeSpan::Add ( const CSG_TimeSpan ts) const
inline

Definition at line 129 of file datetime.h.

◆ Day()

static CSG_TimeSpan CSG_TimeSpan::Day ( void  )
inlinestatic

Definition at line 117 of file datetime.h.

◆ Days()

static CSG_TimeSpan CSG_TimeSpan::Days ( long  days)
inlinestatic

Definition at line 110 of file datetime.h.

◆ Format()

CSG_String CSG_TimeSpan::Format ( const CSG_String format = "") const

Definition at line 65 of file datetime.cpp.

References CSG_String::c_str(), and CSG_String::is_Empty().

Referenced by CSG_Tool::Execute().

◆ Get_Days()

int CSG_TimeSpan::Get_Days ( void  ) const
inline

Definition at line 160 of file datetime.h.

◆ Get_Hours()

int CSG_TimeSpan::Get_Hours ( void  ) const
inline

Definition at line 161 of file datetime.h.

Referenced by CSG_Tool::Execute().

◆ Get_Milliseconds()

sLong CSG_TimeSpan::Get_Milliseconds ( void  ) const
inline

Definition at line 164 of file datetime.h.

Referenced by CSG_Tool::Execute().

◆ Get_Minutes()

int CSG_TimeSpan::Get_Minutes ( void  ) const
inline

Definition at line 162 of file datetime.h.

Referenced by CSG_Tool::Execute().

◆ Get_Seconds()

sLong CSG_TimeSpan::Get_Seconds ( void  ) const
inline

Definition at line 163 of file datetime.h.

Referenced by CSG_Tool::Execute().

◆ Get_Value()

sLong CSG_TimeSpan::Get_Value ( void  ) const
inline

Definition at line 165 of file datetime.h.

◆ Get_Weeks()

int CSG_TimeSpan::Get_Weeks ( void  ) const
inline

Definition at line 159 of file datetime.h.

◆ Hour()

static CSG_TimeSpan CSG_TimeSpan::Hour ( void  )
inlinestatic

Definition at line 116 of file datetime.h.

◆ Hours()

static CSG_TimeSpan CSG_TimeSpan::Hours ( long  hours)
inlinestatic

Definition at line 109 of file datetime.h.

◆ is_EqualTo()

bool CSG_TimeSpan::is_EqualTo ( const CSG_TimeSpan ts) const
inline

Definition at line 148 of file datetime.h.

◆ is_LongerThan()

bool CSG_TimeSpan::is_LongerThan ( const CSG_TimeSpan ts) const
inline

Definition at line 149 of file datetime.h.

◆ is_Negative()

bool CSG_TimeSpan::is_Negative ( void  ) const
inline

Definition at line 144 of file datetime.h.

◆ is_Null()

bool CSG_TimeSpan::is_Null ( void  ) const
inline

Definition at line 142 of file datetime.h.

◆ is_Positive()

bool CSG_TimeSpan::is_Positive ( void  ) const
inline

Definition at line 143 of file datetime.h.

◆ is_ShorterThan()

bool CSG_TimeSpan::is_ShorterThan ( const CSG_TimeSpan ts) const
inline

Definition at line 150 of file datetime.h.

◆ Millisecond()

static CSG_TimeSpan CSG_TimeSpan::Millisecond ( void  )
inlinestatic

Definition at line 113 of file datetime.h.

◆ Milliseconds()

static CSG_TimeSpan CSG_TimeSpan::Milliseconds ( sLong  ms)
inlinestatic

Definition at line 106 of file datetime.h.

◆ Minute()

static CSG_TimeSpan CSG_TimeSpan::Minute ( void  )
inlinestatic

Definition at line 115 of file datetime.h.

◆ Minutes()

static CSG_TimeSpan CSG_TimeSpan::Minutes ( long  min)
inlinestatic

Definition at line 108 of file datetime.h.

◆ Multiply() [1/2]

CSG_TimeSpan& CSG_TimeSpan::Multiply ( int  n)
inline

Definition at line 123 of file datetime.h.

◆ Multiply() [2/2]

CSG_TimeSpan CSG_TimeSpan::Multiply ( int  n) const
inline

Definition at line 131 of file datetime.h.

◆ Neg()

CSG_TimeSpan& CSG_TimeSpan::Neg ( void  )
inline

Definition at line 139 of file datetime.h.

◆ Negate()

CSG_TimeSpan CSG_TimeSpan::Negate ( void  ) const
inline

Definition at line 138 of file datetime.h.

◆ operator!()

bool CSG_TimeSpan::operator! ( void  ) const
inline

Definition at line 146 of file datetime.h.

◆ operator!=()

bool CSG_TimeSpan::operator!= ( const CSG_TimeSpan ts) const
inline

Definition at line 155 of file datetime.h.

◆ operator*()

CSG_TimeSpan CSG_TimeSpan::operator* ( int  n) const
inline

Definition at line 135 of file datetime.h.

◆ operator*=()

CSG_TimeSpan& CSG_TimeSpan::operator*= ( int  n)
inline

Definition at line 127 of file datetime.h.

◆ operator+()

CSG_TimeSpan CSG_TimeSpan::operator+ ( const CSG_TimeSpan ts) const
inline

Definition at line 133 of file datetime.h.

◆ operator+=()

CSG_TimeSpan& CSG_TimeSpan::operator+= ( const CSG_TimeSpan ts)
inline

Definition at line 125 of file datetime.h.

References CSG_DateTime::Add().

◆ operator-() [1/2]

CSG_TimeSpan CSG_TimeSpan::operator- ( const CSG_TimeSpan ts) const
inline

Definition at line 134 of file datetime.h.

◆ operator-() [2/2]

CSG_TimeSpan& CSG_TimeSpan::operator- ( void  )
inline

Definition at line 140 of file datetime.h.

◆ operator-=()

CSG_TimeSpan& CSG_TimeSpan::operator-= ( const CSG_TimeSpan ts)
inline

Definition at line 126 of file datetime.h.

References CSG_DateTime::Subtract().

◆ operator<()

bool CSG_TimeSpan::operator< ( const CSG_TimeSpan ts) const
inline

Definition at line 152 of file datetime.h.

◆ operator<=()

bool CSG_TimeSpan::operator<= ( const CSG_TimeSpan ts) const
inline

Definition at line 153 of file datetime.h.

◆ operator==()

bool CSG_TimeSpan::operator== ( const CSG_TimeSpan ts) const
inline

Definition at line 154 of file datetime.h.

◆ operator>()

bool CSG_TimeSpan::operator> ( const CSG_TimeSpan ts) const
inline

Definition at line 157 of file datetime.h.

◆ operator>=()

bool CSG_TimeSpan::operator>= ( const CSG_TimeSpan ts) const
inline

Definition at line 156 of file datetime.h.

◆ Second()

static CSG_TimeSpan CSG_TimeSpan::Second ( void  )
inlinestatic

Definition at line 114 of file datetime.h.

◆ Seconds()

static CSG_TimeSpan CSG_TimeSpan::Seconds ( sLong  sec)
inlinestatic

Definition at line 107 of file datetime.h.

◆ Subtract() [1/2]

CSG_TimeSpan& CSG_TimeSpan::Subtract ( const CSG_TimeSpan ts)
inline

Definition at line 122 of file datetime.h.

◆ Subtract() [2/2]

CSG_TimeSpan CSG_TimeSpan::Subtract ( const CSG_TimeSpan ts) const
inline

Definition at line 130 of file datetime.h.

◆ Week()

static CSG_TimeSpan CSG_TimeSpan::Week ( void  )
inlinestatic

Definition at line 118 of file datetime.h.

◆ Weeks()

static CSG_TimeSpan CSG_TimeSpan::Weeks ( long  days)
inlinestatic

Definition at line 111 of file datetime.h.

Friends And Related Function Documentation

◆ CSG_DateTime

friend class CSG_DateTime
friend

Definition at line 92 of file datetime.h.


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