2002-12-27 10:12:38 -05:00
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2000-07-15 15:51:35 -04:00
|
|
|
%% Name: datespan.tex
|
|
|
|
%% Purpose: wxDateSpan documentation
|
|
|
|
%% Author: Vadim Zeitlin
|
|
|
|
%% Modified by:
|
|
|
|
%% Created: 04.04.00
|
|
|
|
%% RCS-ID: $Id$
|
|
|
|
%% Copyright: (c) Vadim Zeitlin
|
2005-02-22 10:09:56 -05:00
|
|
|
%% License: wxWindows license
|
2000-07-15 15:51:35 -04:00
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
|
|
|
|
\section{\class{wxTimeSpan}}\label{wxtimespan}
|
|
|
|
|
2001-03-13 08:17:46 -05:00
|
|
|
wxTimeSpan class represents a time interval.
|
|
|
|
|
|
|
|
\wxheading{Derived from}
|
|
|
|
|
|
|
|
No base class
|
|
|
|
|
|
|
|
\wxheading{Include files}
|
|
|
|
|
|
|
|
<wx/datetime.h>
|
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{Date classes overview}{wxdatetimeoverview},\rtfsp
|
|
|
|
\helpref{wxDateTime}{wxdatetime}
|
|
|
|
|
|
|
|
\latexignore{\rtfignore{\wxheading{Function groups}}}
|
|
|
|
|
2006-04-01 19:58:44 -05:00
|
|
|
|
2004-09-21 09:24:41 -04:00
|
|
|
\membersection{Static functions}\label{timespanstaticfunctions}
|
2001-03-13 08:17:46 -05:00
|
|
|
|
2006-04-01 19:58:44 -05:00
|
|
|
\helpref{Milliseconds}{wxtimespanmilliseconds}\\
|
|
|
|
\helpref{Millisecond}{wxtimespanmillisecond}\\
|
2002-12-27 10:12:38 -05:00
|
|
|
\helpref{Seconds}{wxtimespanseconds}\\
|
|
|
|
\helpref{Second}{wxtimespansecond}\\
|
|
|
|
\helpref{Minutes}{wxtimespanminutes}\\
|
|
|
|
\helpref{Minute}{wxtimespanminute}\\
|
|
|
|
\helpref{Hours}{wxtimespanhours}\\
|
|
|
|
\helpref{Hour}{wxtimespanhour}\\
|
|
|
|
\helpref{Days}{wxtimespandays}\\
|
|
|
|
\helpref{Day}{wxtimespanday}\\
|
|
|
|
\helpref{Weeks}{wxtimespanweeks}\\
|
|
|
|
\helpref{Week}{wxtimespanweek}
|
|
|
|
|
2006-04-01 19:58:44 -05:00
|
|
|
|
2004-09-21 09:24:41 -04:00
|
|
|
\membersection{Constructors}\label{timespanconstructors}
|
2001-03-13 08:17:46 -05:00
|
|
|
|
2003-01-07 08:49:08 -05:00
|
|
|
\helpref{wxTimeSpan}{wxtimespanctor}
|
2001-03-13 08:17:46 -05:00
|
|
|
|
2006-04-01 19:58:44 -05:00
|
|
|
|
2004-09-21 09:24:41 -04:00
|
|
|
\membersection{Accessors}\label{timespanaccessors}
|
2001-03-13 08:17:46 -05:00
|
|
|
|
2002-12-27 10:12:38 -05:00
|
|
|
\helpref{GetSeconds}{wxtimespangetseconds}\\
|
|
|
|
\helpref{GetMinutes}{wxtimespangetminutes}\\
|
|
|
|
\helpref{GetHours}{wxtimespangethours}\\
|
|
|
|
\helpref{GetDays}{wxtimespangetdays}\\
|
|
|
|
\helpref{GetWeeks}{wxtimespangetweeks}\\
|
|
|
|
\helpref{GetValue}{wxtimespangetvalue}
|
|
|
|
|
2006-04-01 19:58:44 -05:00
|
|
|
|
2004-09-21 09:24:41 -04:00
|
|
|
\membersection{Operations}\label{timespanoperations}
|
2001-03-13 08:17:46 -05:00
|
|
|
|
2002-12-27 10:12:38 -05:00
|
|
|
\helpref{Add}{wxtimespanadd}\\
|
2004-10-22 15:15:35 -04:00
|
|
|
\helpref{Subtract}{wxtimespansubtract}\\
|
2002-12-27 10:12:38 -05:00
|
|
|
\helpref{Multiply}{wxtimespanmultiply}\\
|
|
|
|
\helpref{Negate}{wxtimespannegate}\\
|
|
|
|
\helpref{Neg}{wxtimespanneg}\\
|
|
|
|
\helpref{Abs}{wxtimespanabs}
|
|
|
|
|
2006-04-01 19:58:44 -05:00
|
|
|
|
2004-09-21 09:24:41 -04:00
|
|
|
\membersection{Tests}\label{timespantests}
|
2001-03-13 08:17:46 -05:00
|
|
|
|
2002-12-27 10:12:38 -05:00
|
|
|
\helpref{IsNull}{wxtimespanisnull}\\
|
|
|
|
\helpref{IsPositive}{wxtimespanispositive}\\
|
|
|
|
\helpref{IsNegative}{wxtimespanisnegative}\\
|
|
|
|
\helpref{IsEqualTo}{wxtimespanisequalto}\\
|
|
|
|
\helpref{IsLongerThan}{wxtimespanislongerthan}\\
|
|
|
|
\helpref{IsShorterThan}{wxtimespanisshorterthan}
|
|
|
|
|
2006-04-01 19:58:44 -05:00
|
|
|
|
2004-09-21 09:24:41 -04:00
|
|
|
\membersection{Formatting time spans}\label{timespanformatting}
|
2001-03-13 08:17:46 -05:00
|
|
|
|
|
|
|
\helpref{Format}{wxtimespanformat}
|
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
% Start of member function part %
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
|
|
|
|
\helponly{\insertatlevel{2}{
|
|
|
|
\wxheading{Members}
|
|
|
|
}}
|
|
|
|
|
2006-04-01 19:58:44 -05:00
|
|
|
|
2002-12-27 10:12:38 -05:00
|
|
|
\membersection{wxTimeSpan::Abs}\label{wxtimespanabs}
|
|
|
|
|
|
|
|
\constfunc{wxTimeSpan}{Abs}{\void}
|
|
|
|
|
|
|
|
Returns the absolute value of the timespan: does not modify the
|
|
|
|
object.
|
|
|
|
|
2006-04-01 19:58:44 -05:00
|
|
|
|
2002-12-27 10:12:38 -05:00
|
|
|
\membersection{wxTimeSpan::Add}\label{wxtimespanadd}
|
|
|
|
|
|
|
|
\constfunc{wxTimeSpan}{Add}{\param{const wxTimeSpan\& }{diff}}
|
|
|
|
|
|
|
|
\func{wxTimeSpan\&}{Add}{\param{const wxTimeSpan\& }{diff}}
|
|
|
|
|
|
|
|
\func{wxTimeSpan\&}{operator$+=$}{\param{const wxTimeSpan\&}{diff}}
|
|
|
|
|
|
|
|
Returns the sum of two timespans.
|
|
|
|
|
2006-04-01 19:58:44 -05:00
|
|
|
|
2002-12-27 10:12:38 -05:00
|
|
|
\membersection{wxTimeSpan::Days}\label{wxtimespandays}
|
|
|
|
|
|
|
|
\func{static wxTimespan}{Days}{\param{long }{days}}
|
|
|
|
|
|
|
|
Returns the timespan for the given number of days.
|
|
|
|
|
2006-04-01 19:58:44 -05:00
|
|
|
|
2002-12-27 10:12:38 -05:00
|
|
|
\membersection{wxTimeSpan::Day}\label{wxtimespanday}
|
|
|
|
|
|
|
|
\func{static wxTimespan}{Day}{\void}
|
|
|
|
|
|
|
|
Returns the timespan for one day.
|
|
|
|
|
2006-04-01 19:58:44 -05:00
|
|
|
|
2001-03-13 08:17:46 -05:00
|
|
|
\membersection{wxTimeSpan::Format}\label{wxtimespanformat}
|
|
|
|
|
2005-01-17 16:29:23 -05:00
|
|
|
\func{wxString}{Format}{\param{const wxChar * }{format = wxDefaultTimeSpanFormat}}
|
2001-03-13 08:17:46 -05:00
|
|
|
|
|
|
|
Returns the string containing the formatted representation of the time span.
|
|
|
|
The following format specifiers are allowed after \%:
|
|
|
|
|
|
|
|
\twocolwidtha{5cm}%
|
|
|
|
\begin{twocollist}\itemsep=0pt
|
|
|
|
\twocolitem{H}{number of {\bf H}ours}
|
|
|
|
\twocolitem{M}{number of {\bf M}inutes}
|
|
|
|
\twocolitem{S}{number of {\bf S}econds}
|
|
|
|
\twocolitem{l}{number of mi{\bf l}liseconds}
|
|
|
|
\twocolitem{D}{number of {\bf D}ays}
|
|
|
|
\twocolitem{E}{number of w{\bf E}eks}
|
|
|
|
\twocolitem{\%}{the percent character}
|
|
|
|
\end{twocollist}
|
|
|
|
|
|
|
|
Note that, for example, the number of hours in the description above is not
|
|
|
|
well defined: it can be either the total number of hours (for example, for a
|
|
|
|
time span of $50$ hours this would be $50$) or just the hour part of the time
|
|
|
|
span, which would be $2$ in this case as $50$ hours is equal to $2$ days and
|
|
|
|
$2$ hours.
|
|
|
|
|
|
|
|
wxTimeSpan resolves this ambiguity in the following way: if there had been,
|
|
|
|
indeed, the {\tt \%D} format specified preceding the {\tt \%H}, then it is
|
|
|
|
interpreted as $2$. Otherwise, it is $50$.
|
|
|
|
|
|
|
|
The same applies to all other format specifiers: if they follow a specifier of
|
|
|
|
larger unit, only the rest part is taken, otherwise the full value is used.
|
2000-07-15 15:51:35 -04:00
|
|
|
|
2006-04-01 19:58:44 -05:00
|
|
|
|
2002-12-27 10:12:38 -05:00
|
|
|
\membersection{wxTimeSpan::GetDays}\label{wxtimespangetdays}
|
|
|
|
|
|
|
|
\constfunc{int}{GetDays}{\void}
|
|
|
|
|
|
|
|
Returns the difference in number of days.
|
|
|
|
|
2006-04-01 19:58:44 -05:00
|
|
|
|
2002-12-27 10:12:38 -05:00
|
|
|
\membersection{wxTimeSpan::GetHours}\label{wxtimespangethours}
|
|
|
|
|
|
|
|
\constfunc{int}{GetHours}{\void}
|
|
|
|
|
|
|
|
Returns the difference in number of hours.
|
|
|
|
|
2006-04-01 19:58:44 -05:00
|
|
|
|
2002-12-27 10:12:38 -05:00
|
|
|
\membersection{wxTimeSpan::GetMilliseconds}\label{wxtimespangetmilliseconds}
|
|
|
|
|
|
|
|
\constfunc{wxLongLong}{GetMilliseconds}{\void}
|
|
|
|
|
|
|
|
Returns the difference in number of milliseconds.
|
|
|
|
|
2006-04-01 19:58:44 -05:00
|
|
|
|
2002-12-27 10:12:38 -05:00
|
|
|
\membersection{wxTimeSpan::GetMinutes}\label{wxtimespangetminutes}
|
|
|
|
|
|
|
|
\constfunc{int}{GetMinutes}{\void}
|
|
|
|
|
|
|
|
Returns the difference in number of minutes.
|
|
|
|
|
2006-04-01 19:58:44 -05:00
|
|
|
|
2002-12-27 10:12:38 -05:00
|
|
|
\membersection{wxTimeSpan::GetSeconds}\label{wxtimespangetseconds}
|
|
|
|
|
|
|
|
\constfunc{wxLongLong}{GetSeconds}{\void}
|
|
|
|
|
|
|
|
Returns the difference in number of seconds.
|
|
|
|
|
2006-04-01 19:58:44 -05:00
|
|
|
|
2002-12-27 10:12:38 -05:00
|
|
|
\membersection{wxTimeSpan::GetValue}\label{wxtimespangetvalue}
|
|
|
|
|
|
|
|
\constfunc{wxLongLong}{GetValue}{\void}
|
|
|
|
|
|
|
|
Returns the internal representation of timespan.
|
|
|
|
|
2006-04-01 19:58:44 -05:00
|
|
|
|
2002-12-27 10:12:38 -05:00
|
|
|
\membersection{wxTimeSpan::GetWeeks}\label{wxtimespangetweeks}
|
|
|
|
|
|
|
|
\constfunc{int}{GetWeeks}{\void}
|
|
|
|
|
|
|
|
Returns the difference in number of weeks.
|
|
|
|
|
2006-04-01 19:58:44 -05:00
|
|
|
|
2002-12-27 10:12:38 -05:00
|
|
|
\membersection{wxTimeSpan::Hours}\label{wxtimespanhours}
|
|
|
|
|
|
|
|
\func{static wxTimespan}{Hours}{\param{long }{hours}}
|
|
|
|
|
|
|
|
Returns the timespan for the given number of hours.
|
|
|
|
|
2006-04-01 19:58:44 -05:00
|
|
|
|
2002-12-27 10:12:38 -05:00
|
|
|
\membersection{wxTimeSpan::Hour}\label{wxtimespanhour}
|
|
|
|
|
|
|
|
\func{static wxTimespan}{Hour}{\void}
|
|
|
|
|
|
|
|
Returns the timespan for one hour.
|
|
|
|
|
2006-04-01 19:58:44 -05:00
|
|
|
|
2002-12-27 10:12:38 -05:00
|
|
|
\membersection{wxTimeSpan::IsEqualTo}\label{wxtimespanisequalto}
|
|
|
|
|
|
|
|
\constfunc{bool}{IsEqualTo}{\param{const wxTimeSpan\& }{ts}}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns {\tt true} if two timespans are equal.
|
2002-12-27 10:12:38 -05:00
|
|
|
|
2006-04-01 19:58:44 -05:00
|
|
|
|
2002-12-27 10:12:38 -05:00
|
|
|
\membersection{wxTimeSpan::IsLongerThan}\label{wxtimespanislongerthan}
|
|
|
|
|
|
|
|
\constfunc{bool}{IsLongerThan}{\param{const wxTimeSpan\& }{ts}}
|
|
|
|
|
|
|
|
Compares two timespans: works with the absolute values, i.e. -2
|
2003-01-17 19:16:34 -05:00
|
|
|
hours is longer than 1 hour. Also, it will return {\tt false} if
|
2002-12-27 10:12:38 -05:00
|
|
|
the timespans are equal in absolute value.
|
|
|
|
|
2006-04-01 19:58:44 -05:00
|
|
|
|
2002-12-27 10:12:38 -05:00
|
|
|
\membersection{wxTimeSpan::IsNegative}\label{wxtimespanisnegative}
|
|
|
|
|
|
|
|
\constfunc{bool}{IsNegative}{\void}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns {\tt true} if the timespan is negative.
|
2002-12-27 10:12:38 -05:00
|
|
|
|
2006-04-01 19:58:44 -05:00
|
|
|
|
2002-12-27 10:12:38 -05:00
|
|
|
\membersection{wxTimeSpan::IsNull}\label{wxtimespanisnull}
|
|
|
|
|
|
|
|
\constfunc{bool}{IsNull}{\void}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns {\tt true} if the timespan is empty.
|
2002-12-27 10:12:38 -05:00
|
|
|
|
2006-04-01 19:58:44 -05:00
|
|
|
|
2002-12-27 10:12:38 -05:00
|
|
|
\membersection{wxTimeSpan::IsPositive}\label{wxtimespanispositive}
|
|
|
|
|
|
|
|
\constfunc{bool}{IsPositive}{\void}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns {\tt true} if the timespan is positive.
|
2002-12-27 10:12:38 -05:00
|
|
|
|
2006-04-01 19:58:44 -05:00
|
|
|
|
2002-12-27 10:12:38 -05:00
|
|
|
\membersection{wxTimeSpan::IsShorterThan}\label{wxtimespanisshorterthan}
|
|
|
|
|
|
|
|
\constfunc{bool}{IsShorterThan}{\param{const wxTimeSpan\& }{ts}}
|
|
|
|
|
|
|
|
Compares two timespans: works with the absolute values, i.e. 1
|
2003-01-17 19:16:34 -05:00
|
|
|
hour is shorter than -2 hours. Also, it will return {\tt false} if
|
2002-12-27 10:12:38 -05:00
|
|
|
the timespans are equal in absolute value.
|
|
|
|
|
2006-04-01 19:58:44 -05:00
|
|
|
|
2002-12-27 10:12:38 -05:00
|
|
|
\membersection{wxTimeSpan::Minutes}\label{wxtimespanminutes}
|
|
|
|
|
|
|
|
\func{static wxTimespan}{Minutes}{\param{long }{min}}
|
|
|
|
|
|
|
|
Returns the timespan for the given number of minutes.
|
|
|
|
|
2006-04-01 19:58:44 -05:00
|
|
|
|
2002-12-27 10:12:38 -05:00
|
|
|
\membersection{wxTimeSpan::Minute}\label{wxtimespanminute}
|
|
|
|
|
|
|
|
\func{static wxTimespan}{Minute}{\void}
|
|
|
|
|
|
|
|
Returns the timespan for one minute.
|
|
|
|
|
2006-04-01 19:58:44 -05:00
|
|
|
|
2002-12-27 10:12:38 -05:00
|
|
|
\membersection{wxTimeSpan::Multiply}\label{wxtimespanmultiply}
|
|
|
|
|
|
|
|
\constfunc{wxTimeSpan}{Multiply}{\param{int }{n}}
|
|
|
|
|
|
|
|
\func{wxTimeSpan\&}{Multiply}{\param{int }{n}}
|
|
|
|
|
|
|
|
\func{wxTimeSpan\&}{operator$*=$}{\param{int }{n}}
|
|
|
|
|
|
|
|
Multiplies timespan by a scalar.
|
|
|
|
|
2006-04-01 19:58:44 -05:00
|
|
|
|
2002-12-27 10:12:38 -05:00
|
|
|
\membersection{wxTimeSpan::Negate}\label{wxtimespannegate}
|
|
|
|
|
|
|
|
\constfunc{wxTimeSpan}{Negate}{\void}
|
|
|
|
|
2004-10-22 15:15:35 -04:00
|
|
|
Returns timespan with inverted sign.
|
2002-12-27 10:12:38 -05:00
|
|
|
|
2006-04-01 19:58:44 -05:00
|
|
|
|
2002-12-27 10:12:38 -05:00
|
|
|
\membersection{wxTimeSpan::Neg}\label{wxtimespanneg}
|
|
|
|
|
|
|
|
\func{wxTimeSpan\&}{Neg}{\void}
|
|
|
|
|
|
|
|
\func{wxTimeSpan\&}{operator$-$}{\void}
|
|
|
|
|
|
|
|
Negate the value of the timespan.
|
|
|
|
|
2006-04-01 19:58:44 -05:00
|
|
|
|
|
|
|
\membersection{wxTimeSpan::Milliseconds}\label{wxtimespanmilliseconds}
|
|
|
|
|
|
|
|
\func{static wxTimespan}{Milliseconds}{\param{long }{ms}}
|
|
|
|
|
|
|
|
Returns the timespan for the given number of milliseconds.
|
|
|
|
|
|
|
|
|
|
|
|
\membersection{wxTimeSpan::Millisecond}\label{wxtimespanmillisecond}
|
|
|
|
|
|
|
|
\func{static wxTimespan}{Millisecond}{\void}
|
|
|
|
|
|
|
|
Returns the timespan for one millisecond.
|
|
|
|
|
|
|
|
|
2002-12-27 10:12:38 -05:00
|
|
|
\membersection{wxTimeSpan::Seconds}\label{wxtimespanseconds}
|
|
|
|
|
|
|
|
\func{static wxTimespan}{Seconds}{\param{long }{sec}}
|
|
|
|
|
|
|
|
Returns the timespan for the given number of seconds.
|
|
|
|
|
2006-04-01 19:58:44 -05:00
|
|
|
|
2002-12-27 10:12:38 -05:00
|
|
|
\membersection{wxTimeSpan::Second}\label{wxtimespansecond}
|
|
|
|
|
|
|
|
\func{static wxTimespan}{Second}{\void}
|
|
|
|
|
|
|
|
Returns the timespan for one second.
|
|
|
|
|
2006-04-01 19:58:44 -05:00
|
|
|
|
2004-10-22 15:15:35 -04:00
|
|
|
\membersection{wxTimeSpan::Subtract}\label{wxtimespansubtract}
|
2002-12-27 10:12:38 -05:00
|
|
|
|
2004-10-22 15:15:35 -04:00
|
|
|
\constfunc{wxTimeSpan}{Subtract}{\param{const wxTimeSpan\&}{diff}}
|
2002-12-27 10:12:38 -05:00
|
|
|
|
2004-10-22 15:15:35 -04:00
|
|
|
\func{wxTimeSpan\&}{Subtract}{\param{const wxTimeSpan\& }{diff}}
|
2002-12-27 10:12:38 -05:00
|
|
|
|
|
|
|
\func{wxTimeSpan\&}{operator$-=$}{\param{const wxTimeSpan\&}{diff}}
|
|
|
|
|
|
|
|
Returns the difference of two timespans.
|
|
|
|
|
2006-04-01 19:58:44 -05:00
|
|
|
|
2002-12-27 10:12:38 -05:00
|
|
|
\membersection{wxTimeSpan::Weeks}\label{wxtimespanweeks}
|
|
|
|
|
|
|
|
\func{static wxTimespan}{Weeks}{\param{long }{weeks}}
|
|
|
|
|
|
|
|
Returns the timespan for the given number of weeks.
|
|
|
|
|
2006-04-01 19:58:44 -05:00
|
|
|
|
2002-12-27 10:12:38 -05:00
|
|
|
\membersection{wxTimeSpan::Week}\label{wxtimespanweek}
|
|
|
|
|
|
|
|
\func{static wxTimespan}{Week}{\void}
|
|
|
|
|
|
|
|
Returns the timespan for one week.
|
|
|
|
|
2006-04-01 19:58:44 -05:00
|
|
|
|
2003-01-07 08:49:08 -05:00
|
|
|
\membersection{wxTimeSpan::wxTimeSpan}\label{wxtimespanctor}
|
2002-12-27 10:12:38 -05:00
|
|
|
|
|
|
|
\func{}{wxTimeSpan}{\void}
|
|
|
|
|
|
|
|
Default constructor, constructs a zero timespan.
|
|
|
|
|
|
|
|
\func{}{wxTimeSpan}{\param{long }{hours}, \param{long }{min}, \param{long }{sec}, \param{long }{msec}}
|
|
|
|
|
|
|
|
Constructs timespan from separate values for each component, with the date
|
|
|
|
set to 0. Hours are not restricted to 0..24 range, neither are
|
|
|
|
minutes, seconds or milliseconds.
|
|
|
|
|