pike.git / lib / modules / Calendar.pmod / TimeRanges.pmod

version» Context lines:

pike.git/lib/modules/Calendar.pmod/TimeRanges.pmod:1:   //! module Calendar    - // $Id: TimeRanges.pmod,v 1.35 2008/06/28 16:36:54 nilsson Exp $ + // $Id: TimeRanges.pmod,v 1.36 2008/11/04 15:49:23 mast Exp $      #pike __REAL_VERSION__      #define zero int(0..0)      program SuperTimeRange=cSuperTimeRange;      string calendar_name() { return "TimeRanges"; }      object calendar_object=this;
pike.git/lib/modules/Calendar.pmod/TimeRanges.pmod:290:    TimeRange prev()    {    return this-1;    }      //! method TimeRange `*(int n)   //! This changes the amount of time in   //! the time period. <tt>t*17</tt> is   //! the same as doing <tt>t-><ref>set_size</ref>(t,17)</tt>.    -  function ``* = `*; +  TimeRange ``* (int n) {return `* (n);}    TimeRange `*(int|float n)    {    return set_size((int)n,this);    }      //! method array(TimeRange) `/(int|float n)   //! method array(TimeRange) split(int|float n, void|TimeRange with)   //! This divides the called timerange into   //! n pieces. The returned timerange type   //! is not neccesarily of the same type as the called one.
pike.git/lib/modules/Calendar.pmod/TimeRanges.pmod:691:   //! Gives the cut on the called time period   //! with another time period. The result is   //! zero if the two periods doesn't overlap.   //! <pre>   //! &gt;- the past the future -&lt;   //! |-------called-------|   //! |-------other--------|   //! &gt;----- cut -----&lt;   //! </pre>    -  function ``& = `&; +  TimeRange|zero ``& (TimeRange with, mixed... extra) +  {return `& (with, @extra);}    TimeRange|zero `&(TimeRange with, mixed ...extra)    {    if (with->is_nulltimerange)    return with;    array(int(-1..1)) a=_compare(with);    if (a[END_BEGIN]<0 || a[BEGIN_END]>0)    return nulltimerange; // no overlap, no extra       if (with->is_supertimerange)    return predef::`&(with,this,@extra); // let it handle that...
pike.git/lib/modules/Calendar.pmod/TimeRanges.pmod:727:   //! method TimeRange `|(TimeRange with)   //! Gives the union on the called time period   //! and another time period.   //! <pre>   //! &gt;- the past the future -&lt;   //! |-------called-------|   //! |-------other--------|   //! &lt;----------union----------&gt;   //! </pre>    -  function ``| = `|; +  TimeRange ``| (TimeRange with, mixed... extra) {return `| (with, @extra);}    TimeRange `|(TimeRange with,mixed ...extra)    {    if (with->is_nulltimerange)    return sizeof(extra)?`|(@extra):this;    array(int(-1..1)) a=_compare(with);    TimeRange from,to;       if (a[END_BEGIN]<0 || a[BEGIN_END]>0)    from=SuperTimeRange( sort(({this,with})) ); // no overlap    else
pike.git/lib/modules/Calendar.pmod/TimeRanges.pmod:766:   //! and another time period, ie the union without   //! the cut. The result is zero if the   //! two periods were the same.   //! <pre>   //! &gt;- the past the future -&lt;   //! |-------called-------|   //! |-------other--------|   //! &lt;----| |----> - exclusive or   //! </pre>    -  function ``^ = `^; +  TimeRange ``^ (TimeRange with, mixed... extra) {return `^ (with, @extra);}    TimeRange `^(TimeRange with,mixed ... extra)    {    if (with->is_supertimerange)    return `^(with,this,@extra); // let it handle that...    if (with->is_nulltimerange)    return sizeof(extra)?`^(@extra):this;       TimeRange res;       array(int(-1..1)) a=_compare(with);