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

version» Context lines:

pike.git/lib/modules/Calendar.pmod/Event.pmod:66:       //! Returns a mapping with time ranges mapped to events.    mapping(Calendar.TimeRanges.TimeRange:Event)    scan_events(Calendar.TimeRanges.TimeRange in)    {    array r=scan(in);    return mkmapping(r,allocate(sizeof(r),this));    }       //! Joins several events into one @[SuperEvent]. -  SuperEvent `|(Event ... with) +  protected SuperEvent `|(Event ... with)    {    with-=({0});    with|=({this});    if (sizeof(with)==1) return with[0];    return SuperEvent(with);    } -  SuperEvent ``|(Event with) { return `|(with); } +  protected SuperEvent ``|(Event with) { return `|(with); }       protected string _sprintf(int t)    {    return (t!='O')?0:sprintf("Event(%s:%O)",id,name);    }       protected array(Event) cast(string to)    {    if (to=="array")    return ({this});
pike.git/lib/modules/Calendar.pmod/Event.pmod:102:   }      //! A non-event.   class NullEvent   {    inherit Event;       //! This constant may be used to identify a NullEvent.    constant is_nullevent=1;    -  void create(string _id,string s,mixed ...args) +  protected void create(string _id,string s,mixed ...args)    {    id=_id;    name=s;    }       Calendar.TimeRanges.TimeRange next(void|Calendar.TimeRanges.TimeRange from,    void|int(0..1) including)    {    return 0;    }
pike.git/lib/modules/Calendar.pmod/Event.pmod:200:   //! to represent an event for a name.   class Nameday   {    inherit Day_Event;       //! This constant may be used to identify @[Nameday] objects.    constant is_nameday=1;       int jd;    -  void create(string _name,int _jd) +  protected void create(string _name,int _jd)    {    name=_name;    jd=_jd;    }       int scan_jd(Calendar.Calendar realm,int sjd,int(1..1)|int(-1..-1) direction)    {    if (direction==1) return sjd<=jd?jd:NODAY;    else return sjd>=jd?jd:NODAY;    }
pike.git/lib/modules/Calendar.pmod/Event.pmod:233:    //! This constant may be used to identify @[Namedays].    constant is_namedays=1;       int leapdayshift;    int first_year=-1;    int last_year=-1;       array namelist;    mapping lookup;    -  void create(string _id,string _name, +  protected void create(string _id,string _name,    array(array(string)) _names,    mapping(string:int|array(int)) _lookup,    void|int start,void|int stop,void|int _leapdayshift)    {    id=_id;    name=_name;    namelist=_names;    first_year=start||-1;    last_year=stop||-1;    leapdayshift=_leapdayshift||2000;
pike.git/lib/modules/Calendar.pmod/Event.pmod:384:    protected string _sprintf(int t)    {    return t=='O'?sprintf("Namedays(%s:%O)",id,name):0;    }       string describe()    {    return "Namedays";    }    -  SuperEvent|SuperNamedays|Namedays +  protected SuperEvent|SuperNamedays|Namedays    `|(SuperEvent|Namedays|SuperNamedays e,    mixed ...extra)    {    object(SuperEvent)|object(SuperNamedays)|object(Namedays) res;    if (e->is_nameday_wrapper && e->id==id && id!="?")    res=SuperNamedays(e->namedays|({this}),e->id);    else    {    array a=({e})|({this});    if (!sizeof(a)) res=this;
pike.git/lib/modules/Calendar.pmod/Event.pmod:468:    namedays(Calendar.TimeRanges.TimeRange t)    {    return predef::`|(@map(namedayss,"namedays",t));    }       array(string) names(Calendar.TimeRanges.TimeRange t)    {    return predef::`|(@map(namedayss,"names",t));    }    -  SuperEvent|SuperNamedays|Namedays +  protected SuperEvent|SuperNamedays|Namedays    `|(SuperEvent|Namedays|SuperNamedays e,    mixed ...extra)    {    if (e->is_namedays_wrapper)    return `|(this,@e->namedayss,@extra);    if (e->is_namedays && e->id==id)    return SuperNamedays(namedayss|({e}),id);    return predef::`|(e,this,@extra);    }   }
pike.git/lib/modules/Calendar.pmod/Event.pmod:1382:    Calendar.TimeRanges.TimeRange best=0;    foreach (events,Event e)    {    Calendar.TimeRanges.TimeRange y=e->previous(from,including);    if (!best || best->preceeds(y)) best=y;    else if (y->ends_with(best)) best|=y;    }    return best;    }    -  Event `|(Event|SuperEvent ... with) +  protected Event `|(Event|SuperEvent ... with)    {    with-=({0});    return SuperEvent(events|with,flags,"?");    } -  Event ``|(Event|SuperEvent with) { return `|(with); } +  protected Event ``|(Event|SuperEvent with) { return `|(with); }    -  Event `-(Event|SuperEvent ...subtract) +  protected Event `-(Event|SuperEvent ...subtract)    {    array(Event) res=events-subtract;    if (res==events) return this;    return SuperEvent(res,flags&res,"?");    }       protected array(Event) cast(string to)    {    if (to=="array")    return events;
pike.git/lib/modules/Calendar.pmod/Event.pmod:1415:    return (t!='O')?0:    (sizeof(events)>5    ? sprintf("SuperEvent(%s:%O,%O..%O [%d])",    id,events[0],events[1],events[-1],    sizeof(events))    : sprintf("SuperEvent(%s:%s)",    id,map(events,lambda(Event e) { return sprintf("%O",e); })*    ","));    }    -  Event `-> (string s) {return `[] (s);} -  Event `[](string s) +  protected Event `-> (string s) {return `[] (s);} +  protected Event `[](string s)    {    if (!id2event) id2event=mkmapping(events->id,events);    return    ::`[](s) ||    id2event[id+"/"+s] || id2event[s] ||    master()->resolv("Calendar")["Events"][id+"/"+s];    }    -  array(string) _indices() +  protected array(string) _indices()    {    if (!id2event) id2event=mkmapping(events->id,events);    return indices(id2event);    }    -  array(Event) _values() +  protected array(Event) _values()    {    if (!id2event) id2event=mkmapping(events->id,events);    return values(id2event);    }   }      //! Event containing information about when a timezone is changed.   class TZShift_Event   {    inherit Event;