7 #ifndef BOOST_LOCALE_DATE_TIME_HPP_INCLUDED 8 #define BOOST_LOCALE_DATE_TIME_HPP_INCLUDED 10 #include <boost/locale/date_time_facet.hpp> 11 #include <boost/locale/formatting.hpp> 12 #include <boost/locale/hold_ptr.hpp> 13 #include <boost/locale/time_zone.hpp> 19 # pragma warning(push) 20 # pragma warning(disable : 4275 4251 4231 4660) 405 periods_.push_back(f);
420 return 4+periods_.size();
428 throw std::out_of_range(
"Invalid index to date_time_period");
432 return periods_[n-4];
436 std::vector<date_time_period> periods_;
446 for(
unsigned i=0;i<b.
size();i++)
457 for(
unsigned i=0;i<b.
size();i++)
485 calendar(std::locale
const &l,std::string
const &zone);
534 int first_day_of_week()
const;
539 std::locale get_locale()
const;
543 std::string get_time_zone()
const;
548 bool is_gregorian()
const;
851 bool is_in_daylight_saving_time()
const;
870 template<
typename CharType>
873 double time_point = t.
time();
876 display_flags == flags::date
877 || display_flags == flags::time
878 || display_flags == flags::datetime
879 || display_flags == flags::strftime
897 template<
typename CharType>
903 display_flags == flags::date
904 || display_flags == flags::time
905 || display_flags == flags::datetime
906 || display_flags == flags::strftime
922 #pragma warning(push) 923 #pragma warning(disable:4512) //assignment operator could not be generated 925 class date_time_duration {
1143 #pragma warning(pop) period_type am_pm()
Definition: date_time.hpp:130
int get(period::period_type f) const
period_type week_of_year()
Definition: date_time.hpp:142
period_type minute()
Definition: date_time.hpp:134
The week number within current month.
Definition: date_time_facet.hpp:52
period::period_type type
The type of period, i.e. era, year, day etc.
Definition: date_time.hpp:55
Definition: date_time_facet.hpp:43
period_type extended_year()
Definition: date_time.hpp:88
date_time_period saturday()
Definition: date_time.hpp:303
date_time_period_set()
Definition: date_time.hpp:379
int get(period::period_type f) const
Definition: date_time.hpp:949
Definition: date_time_facet.hpp:38
Year, it is calendar specific, for example 2011 in Gregorian calendar.
Definition: date_time_facet.hpp:33
this class that represents a set of periods,
Definition: date_time.hpp:373
date_time_period january()
Definition: date_time.hpp:230
int difference(date_time const &other, period::period_type f) const
date_time_period november()
Definition: date_time.hpp:270
date_time_error(std::string const &e)
Definition: date_time.hpp:41
This class represents a period: a pair of two date_time objects.
Definition: date_time.hpp:933
date_time const & operator>>=(period::period_type f)
Definition: date_time.hpp:716
date_time_period march()
Definition: date_time.hpp:238
period_type day_of_week()
Definition: date_time.hpp:109
The number of day in year, starting from 1, in Gregorian [1..366].
Definition: date_time_facet.hpp:37
date_time_period monday()
Definition: date_time.hpp:283
date_time_period february()
Definition: date_time.hpp:234
date_time_period april()
Definition: date_time.hpp:242
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:150
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:470
date_time_period august()
Definition: date_time.hpp:258
int operator/(period::period_type f) const
Definition: date_time.hpp:957
date_time_period operator+() const
Definition: date_time.hpp:60
date_time_period am()
Definition: date_time.hpp:307
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:266
date_time operator<<(period::period_type f) const
Definition: date_time.hpp:693
void add(date_time_period f)
Definition: date_time.hpp:399
date_time operator+(period::period_type f) const
Definition: date_time.hpp:662
bool operator==(BaseIterator const &l, boundary_point< BaseIterator > const &r)
Definition: boundary_point.hpp:141
date_time const & start() const
Definition: date_time.hpp:965
date_time_period december()
Definition: date_time.hpp:274
period_type era()
Definition: date_time.hpp:80
period_type hour()
Definition: date_time.hpp:122
a smart pointer similar to std::auto_ptr but it is non-copyable and the underlying object has the sam...
Definition: hold_ptr.hpp:19
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:685
The week number in the year.
Definition: date_time_facet.hpp:51
24 clock hour [0..23]
Definition: date_time_facet.hpp:46
Special invalid value, should not be used directly.
Definition: date_time_facet.hpp:31
The day of month, calendar specific, in Gregorian [1..31].
Definition: date_time_facet.hpp:36
period_type day_of_week_local()
Definition: date_time.hpp:118
minute [0..59]
Definition: date_time_facet.hpp:49
The month of year, calendar specific, in Gregorian [0..11].
Definition: date_time_facet.hpp:35
Local day of week, for example in France Monday is 1, in US Sunday is 1, [1..7].
Definition: date_time_facet.hpp:45
date_time_period operator-(period::period_type f)
Definition: date_time.hpp:323
date_time_period operator *(period::period_type f, T v)
Definition: date_time.hpp:332
period_type day_of_week_in_month()
Definition: date_time.hpp:114
date_time const & end() const
Definition: date_time.hpp:969
12 clock hour [0..11]
Definition: date_time_facet.hpp:47
date_time operator-(period::period_type f) const
Definition: date_time.hpp:670
This class represents a pair of period_type and the integer values that describes its amount....
Definition: date_time.hpp:53
date_time_period pm()
Definition: date_time.hpp:311
period_type day()
Definition: date_time.hpp:96
period_type year()
Definition: date_time.hpp:84
period_type week_of_month()
Definition: date_time.hpp:146
date_time_period const & operator[](size_t n) const
Definition: date_time.hpp:425
date_time_period_set operator-(date_time_period_set const &a, date_time_period_set const &b)
Definition: date_time.hpp:454
date_time_period wednesday()
Definition: date_time.hpp:291
date_time const & operator<<=(period::period_type f)
Definition: date_time.hpp:709
This error is thrown in case of invalid state that occurred.
Definition: date_time.hpp:36
date_time_period thursday()
Definition: date_time.hpp:295
am or pm marker [0..1]
Definition: date_time_facet.hpp:48
date_time_period_set(period::period_type f)
Definition: date_time.hpp:385
date_time_period_set(date_time_period const &fl)
Definition: date_time.hpp:392
date_time_period sunday()
Definition: date_time.hpp:279
std::basic_ostream< CharType > & operator<<(std::basic_ostream< CharType > &out, date_time const &t)
Definition: date_time.hpp:871
size_t size() const
Definition: date_time.hpp:410
date_time_period friday()
Definition: date_time.hpp:299
date_time_period tuesday()
Definition: date_time.hpp:287
int value
Definition: date_time.hpp:56
date_time_period operator+(period::period_type f)
Definition: date_time.hpp:316
date_time_duration(date_time const &first, date_time const &second)
Definition: date_time.hpp:940
period_type day_of_year()
Definition: date_time.hpp:100
Era i.e. AC, BC in Gregorian and Julian calendar, range [0,1].
Definition: date_time_facet.hpp:32
First day of week, constant, for example Sunday in US = 1, Monday in France = 2.
Definition: date_time_facet.hpp:53
date_time_period_set operator+(date_time_period_set const &a, date_time_period_set const &b)
Definition: date_time.hpp:443
period_type hour_12()
Definition: date_time.hpp:126
std::basic_istream< CharType > & operator>>(std::basic_istream< CharType > &in, date_time &t)
Definition: date_time.hpp:898
Extended year for Gregorian/Julian calendars, where 1 BC == 0, 2 BC == -1.
Definition: date_time_facet.hpp:34
period_type invalid()
Definition: date_time.hpp:76
date_time const & operator+=(period::period_type f)
Definition: date_time.hpp:678
date_time_period june()
Definition: date_time.hpp:250
date_time_period may()
Definition: date_time.hpp:246
this class represents a date time and allows to perform various operation according to the locale set...
Definition: date_time.hpp:587
date_time operator>>(period::period_type f) const
Definition: date_time.hpp:701
date_time_period operator-() const
Definition: date_time.hpp:64
std::ios_base & time(std::ios_base &ios)
Definition: formatting.hpp:328
date_time_period(period::period_type f=period::period_type(), int v=1)
Definition: date_time.hpp:69
bool operator>(segment< IteratorL > const &l, segment< IteratorR > const &r)
Compare two segments.
Definition: segment.hpp:267
period_type second()
Definition: date_time.hpp:138
second [0..59]
Definition: date_time_facet.hpp:50
period_type month()
Definition: date_time.hpp:92
date_time_period july()
Definition: date_time.hpp:254
bool operator!=(BaseIterator const &l, boundary_point< BaseIterator > const &r)
Definition: boundary_point.hpp:149
date_time_period september()
Definition: date_time.hpp:262
int operator/(period::period_type f) const
Definition: date_time.hpp:654
This class holds a type that represents certain period of time like year, hour, second and so on.
Definition: date_time_facet.hpp:69