Boost.Locale
|
#include <boost/locale/date_time_facet.hpp>
Public Types | |
enum | value_type { absolute_minimum, actual_minimum, greatest_minimum, current, least_maximum, actual_maximum, absolute_maximum } |
Type that defines how to fetch the value. More... | |
enum | update_type { move, roll } |
A way to update the value. More... | |
enum | calendar_option_type { is_gregorian, is_dst } |
Information about calendar. More... | |
Public Member Functions | |
virtual abstract_calendar * | clone () const =0 |
Make a polymorphic copy of the calendar. | |
virtual void | set_value (period::marks::period_mark m, int value)=0 |
virtual void | normalize ()=0 |
Recalculate all periods after setting them, should be called after use of set_value() function. | |
virtual int | get_value (period::marks::period_mark m, value_type v) const =0 |
Get specific value for period p according to a value_type v. | |
virtual void | set_time (const posix_time &p)=0 |
Set current time point. | |
virtual posix_time | get_time () const =0 |
Get current time point. | |
virtual double | get_time_ms () const =0 |
Get current time since epoch in milliseconds. | |
virtual void | set_option (calendar_option_type opt, int v)=0 |
Set option for calendar, for future use. | |
virtual int | get_option (calendar_option_type opt) const =0 |
Get option for calendar, currently only check if it is Gregorian calendar. | |
virtual void | adjust_value (period::marks::period_mark m, update_type u, int difference)=0 |
virtual int | difference (const abstract_calendar &other, period::marks::period_mark m) const =0 |
Calculate the difference between this calendar and other in p units. | |
virtual void | set_timezone (const std::string &tz)=0 |
Set time zone, empty - use system. | |
virtual std::string | get_timezone () const =0 |
Get current time zone, empty - system one. | |
virtual bool | same (const abstract_calendar *other) const =0 |
Check of two calendars have same rules. | |
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.
|
pure virtual |
Adjust period's p value by difference items using a update_type u. Note: not all values are adjustable
|
pure virtual |
Set specific value for period p, note not all values are settable.
After calling set_value you may want to call normalize() function to make sure all periods are updated, if you set several fields that are part of a 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