8 #ifndef BOOST_LOCALE_DATE_TIME_HPP_INCLUDED
9 #define BOOST_LOCALE_DATE_TIME_HPP_INCLUDED
11 #include <boost/locale/config.hpp>
13 # pragma warning(push)
14 # pragma warning(disable : 4275 4251 4231 4660)
17 #include <boost/locale/hold_ptr.hpp>
18 #include <boost/locale/date_time_facet.hpp>
19 #include <boost/locale/formatting.hpp>
20 #include <boost/locale/time_zone.hpp>
408 periods_.push_back(f);
423 return 4+periods_.size();
431 throw std::out_of_range(
"Invalid index to date_time_period");
435 return periods_[n-4];
439 std::vector<date_time_period> periods_;
449 for(
unsigned i=0;i<b.
size();i++)
460 for(
unsigned i=0;i<b.
size();i++)
488 calendar(std::locale
const &l,std::string
const &zone);
537 int first_day_of_week()
const;
542 std::locale get_locale()
const;
546 std::string get_time_zone()
const;
551 bool is_gregorian()
const;
854 bool is_in_daylight_saving_time()
const;
873 template<
typename CharType>
874 std::basic_ostream<CharType> &operator<<(std::basic_ostream<CharType> &out,
date_time const &t)
876 double time_point = t.
time();
879 display_flags == flags::date
880 || display_flags == flags::time
881 || display_flags == flags::datetime
882 || display_flags == flags::strftime
900 template<
typename CharType>
906 display_flags == flags::date
907 || display_flags == flags::time
908 || display_flags == flags::datetime
909 || display_flags == flags::strftime
1139 #pragma warning(pop)
period_type am_pm()
Definition: date_time.hpp:133
period_type week_of_year()
Definition: date_time.hpp:145
period_type minute()
Definition: date_time.hpp:137
The week number within current month.
Definition: date_time_facet.hpp:53
period::period_type type
The type of period, i.e. era, year, day etc.
Definition: date_time.hpp:58
Definition: date_time_facet.hpp:44
period_type extended_year()
Definition: date_time.hpp:91
date_time_period saturday()
Definition: date_time.hpp:306
date_time_period_set()
Definition: date_time.hpp:382
date_time const & end() const
Definition: date_time.hpp:968
date_time_period const & operator[](size_t n) const
Definition: date_time.hpp:428
Definition: date_time_facet.hpp:39
Year, it is calendar specific, for example 2011 in Gregorian calendar.
Definition: date_time_facet.hpp:34
this class that represents a set of periods,
Definition: date_time.hpp:376
date_time_period january()
Definition: date_time.hpp:233
date_time_period november()
Definition: date_time.hpp:273
date_time operator+(period::period_type f) const
Definition: date_time.hpp:665
size_t size() const
Definition: date_time.hpp:413
date_time_error(std::string const &e)
Definition: date_time.hpp:44
This class represents a period: a pair of two date_time objects.
Definition: date_time.hpp:932
date_time const & operator>>=(period::period_type f)
Definition: date_time.hpp:719
date_time_period march()
Definition: date_time.hpp:241
period_type day_of_week()
Definition: date_time.hpp:112
The number of day in year, starting from 1, in Gregorian [1..366].
Definition: date_time_facet.hpp:38
int get(period::period_type f) const
Definition: date_time.hpp:948
date_time_period monday()
Definition: date_time.hpp:286
date_time_period february()
Definition: date_time.hpp:237
date_time_period april()
Definition: date_time.hpp:245
bool operator<(segment< IteratorL > const &l, segment< IteratorR > const &r)
Compare two segments.
Definition: segment.hpp:255
period_type first_day_of_week()
Definition: date_time.hpp:153
bool operator<=(segment< IteratorL > const &l, segment< IteratorR > const &r)
Compare two segments.
Definition: segment.hpp:261
this class provides an access to general calendar information.
Definition: date_time.hpp:473
date_time_period august()
Definition: date_time.hpp:261
date_time_period am()
Definition: date_time.hpp:310
bool operator>=(segment< IteratorL > const &l, segment< IteratorR > const &r)
Compare two segments.
Definition: segment.hpp:273
date_time_period october()
Definition: date_time.hpp:269
void add(date_time_period f)
Definition: date_time.hpp:402
bool operator==(BaseIterator const &l, boundary_point< BaseIterator > const &r)
Definition: boundary_point.hpp:142
int operator/(period::period_type f) const
Definition: date_time.hpp:657
date_time_period december()
Definition: date_time.hpp:277
period_type era()
Definition: date_time.hpp:83
period_type hour()
Definition: date_time.hpp:125
a smart pointer similar to std::auto_ptr but it is non-copyable and the underlying object has the sam...
Definition: hold_ptr.hpp:18
void display_flags(uint64_t flags)
static ios_info & get(std::ios_base &ios)
date_time const & operator-=(period::period_type f)
Definition: date_time.hpp:688
The week number in the year.
Definition: date_time_facet.hpp:52
24 clock hour [0..23]
Definition: date_time_facet.hpp:47
Special invalid value, should not be used directly.
Definition: date_time_facet.hpp:32
The day of month, calendar specific, in Gregorian [1..31].
Definition: date_time_facet.hpp:37
period_type day_of_week_local()
Definition: date_time.hpp:121
minute [0..59]
Definition: date_time_facet.hpp:50
date_time_period operator+() const
Definition: date_time.hpp:63
The month of year, calendar specific, in Gregorian [0..11].
Definition: date_time_facet.hpp:36
Local day of week, for example in France Monday is 1, in US Sunday is 1, [1..7].
Definition: date_time_facet.hpp:46
date_time_period operator-(period::period_type f)
Definition: date_time.hpp:326
period_type day_of_week_in_month()
Definition: date_time.hpp:117
date_time_period operator*(period::period_type f, T v)
Definition: date_time.hpp:335
12 clock hour [0..11]
Definition: date_time_facet.hpp:48
This class represents a pair of period_type and the integer values that describes its amount...
Definition: date_time.hpp:56
date_time_period pm()
Definition: date_time.hpp:314
period_type day()
Definition: date_time.hpp:99
int get(period::period_type f) const
period_type year()
Definition: date_time.hpp:87
period_type week_of_month()
Definition: date_time.hpp:149
date_time_period_set operator-(date_time_period_set const &a, date_time_period_set const &b)
Definition: date_time.hpp:457
date_time_period wednesday()
Definition: date_time.hpp:294
date_time const & operator<<=(period::period_type f)
Definition: date_time.hpp:712
This error is thrown in case of invalid state that occurred.
Definition: date_time.hpp:39
date_time_period thursday()
Definition: date_time.hpp:298
am or pm marker [0..1]
Definition: date_time_facet.hpp:49
date_time_period_set(period::period_type f)
Definition: date_time.hpp:388
date_time_period_set(date_time_period const &fl)
Definition: date_time.hpp:395
date_time_period sunday()
Definition: date_time.hpp:282
std::basic_ostream< CharType > & operator<<(std::basic_ostream< CharType > &out, date_time const &t)
Definition: date_time.hpp:874
date_time_period friday()
Definition: date_time.hpp:302
date_time operator>>(period::period_type f) const
Definition: date_time.hpp:704
int operator/(period::period_type f) const
Definition: date_time.hpp:956
date_time_period tuesday()
Definition: date_time.hpp:290
int value
Definition: date_time.hpp:59
date_time_period operator+(period::period_type f)
Definition: date_time.hpp:319
date_time_duration(date_time const &first, date_time const &second)
Definition: date_time.hpp:939
period_type day_of_year()
Definition: date_time.hpp:103
date_time_period operator-() const
Definition: date_time.hpp:67
Era i.e. AC, BC in Gregorian and Julian calendar, range [0,1].
Definition: date_time_facet.hpp:33
First day of week, constant, for example Sunday in US = 1, Monday in France = 2.
Definition: date_time_facet.hpp:54
date_time_period_set operator+(date_time_period_set const &a, date_time_period_set const &b)
Definition: date_time.hpp:446
period_type hour_12()
Definition: date_time.hpp:129
std::basic_istream< CharType > & operator>>(std::basic_istream< CharType > &in, date_time &t)
Definition: date_time.hpp:901
Extended year for Gregorian/Julian calendars, where 1 BC == 0, 2 BC == -1.
Definition: date_time_facet.hpp:35
period_type invalid()
Definition: date_time.hpp:79
date_time const & operator+=(period::period_type f)
Definition: date_time.hpp:681
date_time_period june()
Definition: date_time.hpp:253
date_time operator<<(period::period_type f) const
Definition: date_time.hpp:696
date_time_period may()
Definition: date_time.hpp:249
this class represents a date time and allows to perform various operation according to the locale set...
Definition: date_time.hpp:590
std::ios_base & time(std::ios_base &ios)
Definition: formatting.hpp:328
date_time const & start() const
Definition: date_time.hpp:964
date_time operator-(period::period_type f) const
Definition: date_time.hpp:673
int difference(date_time const &other, period::period_type f) const
date_time_period(period::period_type f=period::period_type(), int v=1)
Definition: date_time.hpp:72
bool operator>(segment< IteratorL > const &l, segment< IteratorR > const &r)
Compare two segments.
Definition: segment.hpp:267
period_type second()
Definition: date_time.hpp:141
second [0..59]
Definition: date_time_facet.hpp:51
period_type month()
Definition: date_time.hpp:95
date_time_period july()
Definition: date_time.hpp:257
bool operator!=(BaseIterator const &l, boundary_point< BaseIterator > const &r)
Definition: boundary_point.hpp:150
date_time_period september()
Definition: date_time.hpp:265
This class holds a type that represents certain period of time like year, hour, second and so on...
Definition: date_time_facet.hpp:70