CppCMS
|
#include <booster/booster/locale/date_time_facet.h>
This class defines generic calendar class, it is used by date_time and calendar objects internally. It is less useful for end users, but it is build for localization backend implementation
Type that defines how to fetch the value
virtual void booster::locale::abstract_calendar::adjust_value | ( | period::marks::period_mark | p, |
update_type | u, | ||
int | difference | ||
) | [pure virtual] |
Adjust period's p value by difference items using a update_type u. Note: not all values are adjustable
virtual abstract_calendar* booster::locale::abstract_calendar::clone | ( | ) | const [pure virtual] |
Make a polymorphic copy of the calendar
virtual int booster::locale::abstract_calendar::difference | ( | abstract_calendar const * | other, |
period::marks::period_mark | p | ||
) | const [pure virtual] |
Calculate the difference between this calendar and other in p units
virtual int booster::locale::abstract_calendar::get_option | ( | calendar_option_type | opt | ) | const [pure virtual] |
Get option for calendar, currently only check if it is Gregorian calendar
virtual posix_time booster::locale::abstract_calendar::get_time | ( | ) | const [pure virtual] |
Get current time point
virtual std::string booster::locale::abstract_calendar::get_timezone | ( | ) | const [pure virtual] |
Get current time zone, empty - system one
virtual int booster::locale::abstract_calendar::get_value | ( | period::marks::period_mark | p, |
value_type | v | ||
) | const [pure virtual] |
Get specific value for period p according to a value_type v
virtual void booster::locale::abstract_calendar::normalize | ( | ) | [pure virtual] |
Recalculate all periods after setting them, should be called after use of set_value() function.
virtual bool booster::locale::abstract_calendar::same | ( | abstract_calendar const * | other | ) | const [pure virtual] |
Check of two calendars have same rules
virtual void booster::locale::abstract_calendar::set_option | ( | calendar_option_type | opt, |
int | v | ||
) | [pure virtual] |
Set option for calendar, for future use
virtual void booster::locale::abstract_calendar::set_time | ( | posix_time const & | p | ) | [pure virtual] |
Set current time point
virtual void booster::locale::abstract_calendar::set_timezone | ( | std::string const & | tz | ) | [pure virtual] |
Set time zone, empty - use system
virtual void booster::locale::abstract_calendar::set_value | ( | period::marks::period_mark | p, |
int | value | ||
) | [pure virtual] |
Set specific value for period p, note not all values are settable.
After call of set_value you may want to call normalize() function to make sure vall periods are updated, if you set sereral fields that are part of single date/time representation you should call set_value several times and then call normalize().
If normalize() is not called after set_value, the behavior is undefined