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.33 2007/10/12 13:05:51 grubba Exp $ + // $Id: TimeRanges.pmod,v 1.34 2008/02/07 01:39:53 mast Exp $      #pike __REAL_VERSION__      #define zero int(0..0)      program SuperTimeRange=cSuperTimeRange;      string calendar_name() { return "TimeRanges"; }      object calendar_object=this;      string _sprintf(int t) { return (t=='O')?calendar_name():0; }    - .Ruleset default_rules=Calendar.default_rules; + Calendar.Ruleset default_rules=Calendar.default_rules;      //------------------------------------------------------------------------   //! class TimeRange   //! This is the base class (usually implemented by e.g. Calendar   //! subclasses like Calendar.Second) for any time measurement and   //! calendrar information. It defines all the things you can do   //! with a time range or any time period.   //!   //! A TimeRange doubles as both a fixed period in   //! time, and an amount of time. For instance,
pike.git/lib/modules/Calendar.pmod/TimeRanges.pmod:29:   //! ahead (unaligning it with the week period,   //! and thereby reducing it to just 7 days),   //! no matter when in time the actual day were.   //!   //------------------------------------------------------------------------      class TimeRange   {    constant is_timerange=1;    -  .Ruleset rules; +  Calendar.Ruleset rules;      //! method void create("unix",int unixtime)   //! method void create("unix",int unixtime,int seconds_len)   //! Create the timerange from unix time (as given by   //! <tt>time(2)</tt>), with eventually the size of   //! the time range in the same unit, seconds.   //!   //! method void create("julian",int|float julian_day)   //! Create the timerange from a julian day, the   //! standardized method of counting days. If
pike.git/lib/modules/Calendar.pmod/TimeRanges.pmod:872:    return res;    }      //! method TimeRange set_ruleset(Ruleset r)   //! method TimeRange ruleset(Ruleset r)   //! Set or get the current ruleset.   //! note:   //! this may include timezone shanges,   //! and change the time of day.    -  this_program set_ruleset(.Ruleset r); -  .Ruleset ruleset() +  this_program set_ruleset(Calendar.Ruleset r); +  Calendar.Ruleset ruleset()    {    return rules;    }      //! method TimeRange set_timezone(Timezone tz)   //! method TimeRange set_timezone(string tz)   //! method TimeZone timezone()   //! Set or get the current timezone (including dst) rule.   //!   //! note:   //! The time-of-day may very well   //! change when you change timezone.   //!   //! To get the time of day for a specified timezone,   //! select the timezone before getting the time of day:   //!   //! <tt>Year(2003)-&gt;...-&gt;set_timezone(TimeZone.CET)-&gt;...-&gt;hour(14)-&gt;...</tt>   //!    -  this_program set_timezone(string|.Rule.Timezone tz) +  this_program set_timezone(string|Calendar.Rule.Timezone tz)    {    return set_ruleset(rules->set_timezone(tz));    }    -  .Rule.Timezone timezone() +  Calendar.Rule.Timezone timezone()    {    return rules->timezone;    }      //! method TimeRange set_language(Rule.Language lang)   //! method TimeRange set_language(string lang)   //! method Language language()   //! Set or get the current language rule.    -  this_program set_language(string|.Rule.Language lang) +  this_program set_language(string|Calendar.Rule.Language lang)    {    return set_ruleset(rules->set_language(lang));    }    -  .Rule.Language language() +  Calendar.Rule.Language language()    {    return rules->language;    }      //! method Calendar calendar()   //! Simply gives back the calendar in use, for instance   //! Calendar.ISO or Calendar.Discordian.       object calendar()    {
pike.git/lib/modules/Calendar.pmod/TimeRanges.pmod:1136:    case 'O':    return "SuperTimeRange("+    map(parts,"_sprintf",'O')*", "+")";    case 't':    return "SuperTimeRange("+    map(parts,"_sprintf",'t')*", "+")";    }    return ::_sprintf(t,m);    }    -  TimeRange set_timezone(string|.Rule.Timezone tz) +  TimeRange set_timezone(string|Calendar.Rule.Timezone tz)    {   // fixme?    return `|(@map(parts,"set_timezone",tz));    }   }      //! module Calendar   //! constant TimeRange nulltimerange   //! This represents the null time range,   //! which, to differ from the zero time range