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

version» Context lines:

pike.git/lib/modules/Calendar.pmod/TimeRanges.pmod:308:    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. + //! is not necessarily of the same type as the called one.   //! If the optional timerange is specified then the resulting timeranges   //! will be multiples of that range (except for the last one).   //!   //! known bugs:   //! These are currently not defined for   //! <ref to=SuperTimeRange>supertimeranges</ref>.      //! method int `/(TimeRange with)   //! method int how_many(TimeRange with)   //! This calculates how many instances of the given
pike.git/lib/modules/Calendar.pmod/TimeRanges.pmod:681:   //! known bugs:   //! _equal is not currently possible to overload,   //! due to weird bugs, so equal uses `== for now.       int(0..1) `==(mixed what)    {    return objectp(what) && functionp(what->ruleset) &&    what->ruleset()==ruleset() && equals(what);    }    -  int __hash(); +  protected int __hash();      // int(0..1) _equal(TimeRange what)   // {   // return equals(what);   // }      //! method TimeRange `&(TimeRange with)   //! Gives the cut on the called time period   //! with another time period. The result is   //! zero if the two periods doesn't overlap.
pike.git/lib/modules/Calendar.pmod/TimeRanges.pmod:937:   //! method Calendar calendar()   //! Simply gives back the calendar in use, for instance   //! Calendar.ISO or Calendar.Discordian.       object calendar()    {    return calendar_object;    }       -  protected string _sprintf(int t,mapping m) +  protected string _sprintf(int t)    {    switch (t)    {    case 'O':    return "TimeRange()";    case 't':    return "Calendar."+calendar_name()+".TimeRange";    default:    return 0;    }
pike.git/lib/modules/Calendar.pmod/TimeRanges.pmod:1131:    for (int i=0; i<sizeof(parts); i++)    if (parts[i]>with->parts[i]) return 1;    return 0;    }       protected int __hash()    {    return predef::`+(@map(parts,"__hash"));    }    -  protected string _sprintf(int t,mapping m) +  protected string _sprintf(int t)    {    switch (t)    {    case 'O':    return "SuperTimeRange("+    map(parts,"_sprintf",'O')*", "+")";    case 't':    return "SuperTimeRange("+    map(parts,"_sprintf",'t')*", "+")";    } -  return ::_sprintf(t,m); +  return ::_sprintf(t);    }       TimeRange set_timezone(string|Calendar.Rule.Timezone tz)    {   // fixme?    return `|(@map(parts,"set_timezone",tz));    }   }      //! module Calendar
pike.git/lib/modules/Calendar.pmod/TimeRanges.pmod:1252:    this_program subtract(TimeRange with, mixed ...extra)    {    return this;    }       int(1..1) `!()    {    return 1;    }    -  protected string _sprintf(int t,mapping m) +  protected int __hash()    { -  +  return 0; +  } +  +  protected string _sprintf(int t) +  {    switch (t)    {    case 'O': return "NullTimeRange";    case 't': return "Calendar."+calendar_name()+".NullTimeRange"; -  default: return ::_sprintf(t,m); +  default: return ::_sprintf(t);    }    }   }      cNullTimeRange nulltimerange=NullTimeRange();      // helper functions      protected mapping(function:TimeRange) program2stuff=([]);      protected TimeRange promote_program(function p)   {    TimeRange x;    if ( (x=program2stuff[p]) ) return x;    x=[object(TimeRange)]p();    if (!x->is_timerange)    error("Not a timerange program: %O\n",p);    return program2stuff[p]=x;   }