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

version» Context lines:

pike.git/lib/modules/Calendar.pmod/Event.pmod:12:      function(mixed...:TimeRange) std_day=master()->resolv("Calendar")["Day"];   function(mixed...:TimeRange) std_second=master()->resolv("Calendar")["Second"];      // ----------------------------------------------------------------   // base classes   // ----------------------------------------------------------------      //! module Calendar   //! submodule Event - //! subclass Event + //! class Event   //! <ref>Event</ref> is a base class, defining what   //! methods an Event need to have.      //! method array(TimeRange) scan(TimeRange in)   //! This calculates the eventual events that   //! is contained or overlapped by the given timerange.   //!   //! Example:   //! <tt>Event.christmas_eve->scan(Year(2000))</tt>   //! => <tt>({ Day(Sun 24 Dec 2000) })</tt>
pike.git/lib/modules/Calendar.pmod/Event.pmod:124:    }       TimeRange previous(void|TimeRange from,void|int(0..1) including)    {    return 0;    }   }      //! module Calendar   //! submodule Event - //! subclass Day_Event + //! class Day_Event   //! <ref>Day_Event</ref> is a base class, extending <ref>Event</ref>   //! for events that are single days, using julian day numbers   //! for the calculations.   //!   //! method array(TimeRange) scan(TimeRange in)   //! method TimeRange next(TimeRange from)   //! method TimeRange next(TimeRange from,int(0..1) including)   //! These methods are implemented, using the   //! virtual method <ref>scan_jd</ref>.   //! see also: Event
pike.git/lib/modules/Calendar.pmod/Event.pmod:185:    :(from->julian_day()-1));    jd=scan_jd(from->calendar(),jd+nd-1,-1);    if (jd==NODAY) return 0;    return (from->calendar()->Day)("julian_r",jd,from->ruleset())*nd;    }   }         //! module Calendar   //! submodule Event - //! subclass Nameday + //! class Nameday   //! This is created by the <ref>Namedays</ref> classes   //! to represent an event for a name.      class Nameday   {    inherit Day_Event;       constant is_nameday=1;       int jd;
pike.git/lib/modules/Calendar.pmod/Event.pmod:217:    }       string _sprintf(int t)    {    return t=='O'?sprintf("Nameday(%s:%O)",id,name):0;    }   }      //! module Calendar   //! submodule Event - //! subclass Namedays + //! class Namedays   //! This contains a ruleset about namedays.   //! inherits Event      class Namedays   {    inherit Event;    constant is_namedays=1;       int leapdayshift;    int first_year=-1;
pike.git/lib/modules/Calendar.pmod/Event.pmod:637:    }       string describe()    {    return sprintf("%s %2d julian",M_NAME[mn],md);    }   }      //! module Calendar   //! submodule Event - //! subclass Date + //! class Date   //! This class represents the event of a given gregorian date.   //! For instance,   //! <tt>Event.Date(12,10)->next(Day())</tt>   //! finds the next 12 of October.   //!   //! method void create(int month_day,int month)   //! The event is created by a given month day and   //! a month number (1=January, 12=December).      class Date
pike.git/lib/modules/Calendar.pmod/Event.pmod:691:    if (direction==1)    [y,yjd,leap]=gregorian_yjd(yjd+365+leap);    else    [y,yjd,leap]=gregorian_yjd(yjd-1);    }    }   }      //! module Calendar   //! submodule Event - //! subclass Date_Weekday + //! class Date_Weekday   //! This class represents the event that a given gregorian date appears   //! a given weekday.   //! For instance,   //! <tt>Event.Date_Weekday(12,10,5)->next(Day())</tt>   //! finds the next 12 of October that is a friday.   //!   //! method void create(int month_day,int month,int weekday)   //! The event is created by a given month day,   //! a month number (1=January, 12=December), and a   //! weekday number (1=Monday, 7=Sunday).
pike.git/lib/modules/Calendar.pmod/Event.pmod:756:    if (direction==1)    [y,yjd,leap]=gregorian_yjd(yjd+365+leap);    else    [y,yjd,leap]=gregorian_yjd(yjd-1);    }    }   }      //! module Calendar   //! submodule Event - //! subclass Monthday_Weekday + //! class Monthday_Weekday   //! This class represents the event that a given gregorian   //! day of month appears a given weekday.   //! For instance,   //! <tt>Event.Monthday_Weekday(13,5)->next(Day())</tt>   //! finds the next friday the 13th.   //!   //! method void create(int month_day,int weekday)   //! The event is created by a given month day,   //! and a weekday number (1=Monday, 7=Sunday).   //!
pike.git/lib/modules/Calendar.pmod/Event.pmod:822:    if (w[i]==jd_wd && z[i]<=jd &&    z[i]-yjd<M_ED[leap][i+1]) return z[i];    [y,yjd,leap]=gregorian_yjd(yjd-1);    }    }    }   }      //! module Calendar   //! submodule Event - //! subclass Weekday + //! class Weekday   //! This class represents any given weekday.   //! For instance,   //! <tt>Event.Weekday(5)->next(Day())</tt>   //! finds the next friday.   //!   //! These are also available as the pre-defined events   //! "monday", "tuesday", "wednesday", "thursday",   //! "friday", "saturday" and "sunday".   //!   //! method void create(int weekday)
pike.git/lib/modules/Calendar.pmod/Event.pmod:1080:    string describe()    {    return sprintf("%s %2d %s %+2d %s [<=%+d]",    M_NAME[mn],md,WD_NAME[wd],n,    inclusive?"incl":"",offset);    }   }      //! module Calendar   //! submodule Event - //! subclass SuperEvent + //! class SuperEvent   //! This class holds any number of events,   //! and adds the functionality of event flags.   //!   //! note:   //! Scanning (scan_events,next,etc) will drop flag information.   //! Dig out what you need with -><ref>holidays</ref> et al first.      class SuperEvent   {    inherit Event;