Boost.Locale
boost::locale::calendar Class Reference

this class provides an access to general calendar information. More...

#include <boost/locale/date_time.hpp>

Public Member Functions

 calendar (std::ios_base &ios)
 
 calendar (const std::locale &l, const std::string &zone)
 
 calendar (const std::locale &l)
 
 calendar (const std::string &zone)
 
 calendar ()
 
 calendar (const calendar &other)
 copy calendar
 
calendaroperator= (const calendar &other)
 assign calendar
 
int minimum (period::period_type f) const
 Get minimum value for period f, For example for period::day it is 1.
 
int greatest_minimum (period::period_type f) const
 
int maximum (period::period_type f) const
 Get maximum value for period f, For example for Gregorian calendar's maximum period::day it is 31.
 
int least_maximum (period::period_type f) const
 Get least maximum value for period f, For example for Gregorian calendar's maximum period::day it is 28.
 
int first_day_of_week () const
 Get first day of week for specific calendar, for example for US it is 1 - Sunday for France it is 2 - Monday.
 
const std::locale & get_locale () const
 get calendar's locale
 
const std::string & get_time_zone () const
 get calendar's time zone
 
bool is_gregorian () const
 Check if the calendar is Gregorian.
 
bool operator== (const calendar &other) const
 Compare calendars for equivalence: i.e. calendar types, time zones etc.
 
bool operator!= (const calendar &other) const
 Opposite of ==.
 

Friends

class date_time
 

Detailed Description

this class provides an access to general calendar information.

This information is not connected to specific date but generic to locale, and timezone. It is used in obtaining general information about calendar and is essential for creation of date_time objects.

Examples
calendar.cpp.

Constructor & Destructor Documentation

◆ calendar() [1/5]

boost::locale::calendar::calendar ( std::ios_base &  ios)

Create calendar taking locale and timezone information from ios_base instance.

Exceptions
std::bad_castios does not have a locale with installed calendar_facet facet installed

◆ calendar() [2/5]

boost::locale::calendar::calendar ( const std::locale &  l,
const std::string &  zone 
)

Create calendar with locale l and time_zone zone

Exceptions
std::bad_castl does not have calendar_facet facet installed

◆ calendar() [3/5]

boost::locale::calendar::calendar ( const std::locale &  l)

Create calendar with locale l and default timezone

Exceptions
std::bad_castl does not have calendar_facet facet installed

◆ calendar() [4/5]

boost::locale::calendar::calendar ( const std::string &  zone)

Create calendar with default locale and timezone zone

Exceptions
std::bad_castglobal locale does not have calendar_facet facet installed

◆ calendar() [5/5]

boost::locale::calendar::calendar ( )

Create calendar with default locale and timezone

Exceptions
std::bad_castglobal locale does not have calendar_facet facet installed

Member Function Documentation

◆ greatest_minimum()

int boost::locale::calendar::greatest_minimum ( period::period_type  f) const

Get greatest possible minimum value for period f, For example for period::day it is 1, but may be different for other calendars.


The documentation for this class was generated from the following file: