| Boost.Locale

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- File List

date_time.hpp
1 //
2 // Copyright (c) 2009-2011 Artyom Beilis (Tonkikh)
3 //
4 // Distributed under the Boost Software License, Version 1.0. (See
5 // accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
7 //
8 #ifndef BOOST_LOCALE_DATE_TIME_HPP_INCLUDED
9 #define BOOST_LOCALE_DATE_TIME_HPP_INCLUDED
10
11 #include <boost/locale/config.hpp>
12 #ifdef BOOST_MSVC
13 # pragma warning(push)
14 # pragma warning(disable : 4275 4251 4231 4660)
15 #endif
16
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>
21 #include <locale>
22 #include <vector>
23 #include <stdexcept>
24
25
26 namespace boost {
27 namespace locale {
34
35
39 class BOOST_SYMBOL_VISIBLE date_time_error : public std::runtime_error {
40 public:
44 date_time_error(std::string const &e) : std::runtime_error(e) {}
45 };
46
47
56 struct date_time_period
57 {
58 period::period_type type;
59 int value;
60 date_time_period operator+() const { return *this; }
67 date_time_period operator-() const { return date_time_period(type,-value); }
68
72 date_time_period(period::period_type f=period::period_type(),int v=1) : type(f), value(v) {}
73 };
74
75 namespace period {
79 inline period_type invalid(){ return period_type(marks::invalid); }
83 inline period_type era(){ return period_type(marks::era); }
87 inline period_type year(){ return period_type(marks::year); }
91 inline period_type extended_year(){ return period_type(marks::extended_year); }
95 inline period_type month(){ return period_type(marks::month); }
99 inline period_type day(){ return period_type(marks::day); }
103 inline period_type day_of_year(){ return period_type(marks::day_of_year); }
112 inline period_type day_of_week(){ return period_type(marks::day_of_week); }
117 inline period_type day_of_week_in_month(){ return period_type(marks::day_of_week_in_month); }
121 inline period_type day_of_week_local(){ return period_type(marks::day_of_week_local); }
125 inline period_type hour(){ return period_type(marks::hour); }
129 inline period_type hour_12(){ return period_type(marks::hour_12); }
133 inline period_type am_pm(){ return period_type(marks::am_pm); }
137 inline period_type minute(){ return period_type(marks::minute); }
141 inline period_type second(){ return period_type(marks::second); }
145 inline period_type week_of_year(){ return period_type(marks::week_of_year); }
149 inline period_type week_of_month(){ return period_type(marks::week_of_month); }
153 inline period_type first_day_of_week(){ return period_type(marks::first_day_of_week); }
154
158 inline date_time_period era(int v) { return date_time_period(era(),v); }
162 inline date_time_period year(int v) { return date_time_period(year(),v); }
166 inline date_time_period extended_year(int v) { return date_time_period(extended_year(),v); }
170 inline date_time_period month(int v) { return date_time_period(month(),v); }
174 inline date_time_period day(int v) { return date_time_period(day(),v); }
178 inline date_time_period day_of_year(int v) { return date_time_period(day_of_year(),v); }
187 inline date_time_period day_of_week(int v) { return date_time_period(day_of_week(),v); }
192 inline date_time_period day_of_week_in_month(int v) { return date_time_period(day_of_week_in_month(),v); }
196 inline date_time_period day_of_week_local(int v) { return date_time_period(day_of_week_local(),v); }
200 inline date_time_period hour(int v) { return date_time_period(hour(),v); }
204 inline date_time_period hour_12(int v) { return date_time_period(hour_12(),v); }
208 inline date_time_period am_pm(int v) { return date_time_period(am_pm(),v); }
212 inline date_time_period minute(int v) { return date_time_period(minute(),v); }
216 inline date_time_period second(int v) { return date_time_period(second(),v); }
220 inline date_time_period week_of_year(int v) { return date_time_period(week_of_year(),v); }
224 inline date_time_period week_of_month(int v) { return date_time_period(week_of_month(),v); }
228 inline date_time_period first_day_of_week(int v) { return date_time_period(first_day_of_week(),v); }
229
233 inline date_time_period january() { return date_time_period(month(),0); }
237 inline date_time_period february() { return date_time_period(month(),1); }
241 inline date_time_period march() { return date_time_period(month(),2); }
245 inline date_time_period april() { return date_time_period(month(),3); }
249 inline date_time_period may() { return date_time_period(month(),4); }
253 inline date_time_period june() { return date_time_period(month(),5); }
257 inline date_time_period july() { return date_time_period(month(),6); }
261 inline date_time_period august() { return date_time_period(month(),7); }
265 inline date_time_period september() { return date_time_period(month(),8); }
269 inline date_time_period october() { return date_time_period(month(),9); }
273 inline date_time_period november() { return date_time_period(month(),10); }
277 inline date_time_period december() { return date_time_period(month(),11); }
278
282 inline date_time_period sunday() { return date_time_period(day_of_week(),1); }
286 inline date_time_period monday() { return date_time_period(day_of_week(),2); }
290 inline date_time_period tuesday() { return date_time_period(day_of_week(),3); }
294 inline date_time_period wednesday() { return date_time_period(day_of_week(),4); }
298 inline date_time_period thursday() { return date_time_period(day_of_week(),5); }
302 inline date_time_period friday() { return date_time_period(day_of_week(),6); }
306 inline date_time_period saturday() { return date_time_period(day_of_week(),7); }
310 inline date_time_period am() { return date_time_period(am_pm(),0); }
314 inline date_time_period pm() { return date_time_period(am_pm(),1); }
315
319 inline date_time_period operator+(period::period_type f)
320 {
321 return date_time_period(f);
322 }
326 inline date_time_period operator-(period::period_type f)
327 {
328 return date_time_period(f,-1);
329 }
330
334 template<typename T>
335 date_time_period operator*(period::period_type f,T v)
336 {
337 return date_time_period(f,v);
338 }
339
343 template<typename T>
344 date_time_period operator*(T v,period::period_type f)
345 {
346 return date_time_period(f,v);
347 }
351 template<typename T>
352 date_time_period operator*(T v,date_time_period f)
353 {
354 return date_time_period(f.type,f.value*v);
355 }
356
360 template<typename T>
361 date_time_period operator*(date_time_period f,T v)
362 {
363 return date_time_period(f.type,f.value*v);
364 }
365
366
367 } // period
368
369
376 class date_time_period_set {
377 public:
378
382 date_time_period_set()
383 {
384 }
388 date_time_period_set(period::period_type f)
389 {
390 basic_[0]=date_time_period(f);
391 }
395 date_time_period_set(date_time_period const &fl)
396 {
397 basic_[0]=fl;
398 }
402 void add(date_time_period f)
403 {
404 size_t n=size();
405 if(n < 4)
406 basic_[n]=f;
407 else
408 periods_.push_back(f);
409 }
413 size_t size() const
414 {
415 if(basic_[0].type == period::period_type())
416 return 0;
417 if(basic_[1].type == period::period_type())
418 return 1;
419 if(basic_[2].type == period::period_type())
420 return 2;
421 if(basic_[3].type == period::period_type())
422 return 3;
423 return 4+periods_.size();
424 }
428 date_time_period const &operator[](size_t n) const
429 {
430 if(n >= size())
431 throw std::out_of_range("Invalid index to date_time_period");
432 if(n < 4)
433 return basic_[n];
434 else
435 return periods_[n-4];
436 }
437 private:
438 date_time_period basic_[4];
439 std::vector<date_time_period> periods_;
440 };
441
442
446 inline date_time_period_set operator+(date_time_period_set const &a,date_time_period_set const &b)
447 {
448 date_time_period_set s(a);
449 for(unsigned i=0;i<b.size();i++)
450 s.add(b[i]);
451 return s;
452 }
453
457 inline date_time_period_set operator-(date_time_period_set const &a,date_time_period_set const &b)
458 {
459 date_time_period_set s(a);
460 for(unsigned i=0;i<b.size();i++)
461 s.add(-b[i]);
462 return s;
463 }
464
465
473 class BOOST_LOCALE_DECL calendar {
474 public:
475
482 calendar(std::ios_base &ios);
488 calendar(std::locale const &l,std::string const &zone);
494 calendar(std::locale const &l);
500 calendar(std::string const &zone);
506 calendar();
507 ~calendar();
508
512 calendar(calendar const &other);
516 calendar const &operator=(calendar const &other);
517
521 int minimum(period::period_type f) const;
525 int greatest_minimum(period::period_type f) const;
529 int maximum(period::period_type f) const;
533 int least_maximum(period::period_type f) const;
534
537 int first_day_of_week() const;
538
542 std::locale get_locale() const;
546 std::string get_time_zone() const;
547
551 bool is_gregorian() const;
552
556 bool operator==(calendar const &other) const;
560 bool operator!=(calendar const &other) const;
561
562 private:
563 friend class date_time;
564 std::locale locale_;
565 std::string tz_;
566 hold_ptr<abstract_calendar> impl_;
567 };
568
589
590 class BOOST_LOCALE_DECL date_time {
591 public:
592
598 date_time();
602 date_time(date_time const &other);
606 date_time(date_time const &other,date_time_period_set const &set);
610 date_time const &operator=(date_time const &other);
611 ~date_time();
612
618 date_time(double time);
622 date_time(double time,calendar const &cal);
626 date_time(calendar const &cal);
627
633 date_time(date_time_period_set const &set);
637 date_time(date_time_period_set const &set,calendar const &cal);
638
639
643 date_time const &operator=(date_time_period_set const &f);
644
648 void set(period::period_type f,int v);
652 int get(period::period_type f) const;
653
657 int operator/(period::period_type f) const
658 {
659 return get(f);
660 }
661
665 date_time operator+(period::period_type f) const
666 {
667 return *this+date_time_period(f);
668 }
669
673 date_time operator-(period::period_type f) const
674 {
675 return *this-date_time_period(f);
676 }
677
681 date_time const &operator+=(period::period_type f)
682 {
683 return *this+=date_time_period(f);
684 }
688 date_time const &operator-=(period::period_type f)
689 {
690 return *this-=date_time_period(f);
691 }
692
696 date_time operator<<(period::period_type f) const
697 {
698 return *this<<date_time_period(f);
699 }
700
704 date_time operator>>(period::period_type f) const
705 {
706 return *this>>date_time_period(f);
707 }
708
712 date_time const &operator<<=(period::period_type f)
713 {
714 return *this<<=date_time_period(f);
715 }
719 date_time const &operator>>=(period::period_type f)
720 {
721 return *this>>=date_time_period(f);
722 }
723
727 date_time operator+(date_time_period const &v) const;
731 date_time operator-(date_time_period const &v) const;
735 date_time const &operator+=(date_time_period const &v);
739 date_time const &operator-=(date_time_period const &v);
740
744 date_time operator<<(date_time_period const &v) const;
748 date_time operator>>(date_time_period const &v) const ;
752 date_time const &operator<<=(date_time_period const &v);
756 date_time const &operator>>=(date_time_period const &v);
757
761 date_time operator+(date_time_period_set const &v) const;
765 date_time operator-(date_time_period_set const &v) const;
769 date_time const &operator+=(date_time_period_set const &v);
773 date_time const &operator-=(date_time_period_set const &v);
774
778 date_time operator<<(date_time_period_set const &v) const;
782 date_time operator>>(date_time_period_set const &v) const ;
786 date_time const &operator<<=(date_time_period_set const &v);
790 date_time const &operator>>=(date_time_period_set const &v);
791
797 double time() const;
804 void time(double v);
805
809 bool operator==(date_time const &other) const;
813 bool operator!=(date_time const &other) const;
817 bool operator<(date_time const &other) const;
821 bool operator>(date_time const &other) const;
825 bool operator<=(date_time const &other) const;
829 bool operator>=(date_time const &other) const;
830
834 void swap(date_time &other);
835
839 int difference(date_time const &other,period::period_type f) const;
840
844 int minimum(period::period_type f) const;
849 int maximum(period::period_type f) const;
850
854 bool is_in_daylight_saving_time() const;
855
856 private:
857 hold_ptr<abstract_calendar> impl_;
858 };
859
873 template<typename CharType>
874 std::basic_ostream<CharType> &operator<<(std::basic_ostream<CharType> &out,date_time const &t)
875 {
876 double time_point = t.time();
877 uint64_t display_flags = ios_info::get(out).display_flags();
878 if (
879 display_flags == flags::date
880 || display_flags == flags::time
881 || display_flags == flags::datetime
882 || display_flags == flags::strftime
883 )
884 {
885 out << time_point;
886 }
887 else {
888 ios_info::get(out).display_flags(flags::datetime);
889 out << time_point;
890 ios_info::get(out).display_flags(display_flags);
891 }
892 return out;
893 }
894
900 template<typename CharType>
901 std::basic_istream<CharType> &operator>>(std::basic_istream<CharType> &in,date_time &t)
902 {
903 double v;
904 uint64_t display_flags = ios_info::get(in).display_flags();
905 if (
906 display_flags == flags::date
907 || display_flags == flags::time
908 || display_flags == flags::datetime
909 || display_flags == flags::strftime
910 )
911 {
912 in >> v;
913 }
914 else {
915 ios_info::get(in).display_flags(flags::datetime);
916 in >> v;
917 ios_info::get(in).display_flags(display_flags);
918 }
919 if(!in.fail())
920 t.time(v);
921 return in;
922 }
923
932 class date_time_duration {
933 public:
934
939 date_time_duration(date_time const &first,date_time const &second) :
940 s_(first),
941 e_(second)
942 {
943 }
944
948 int get(period::period_type f) const
949 {
950 return start().difference(end(),f);
951 }
952
956 int operator / (period::period_type f) const
957 {
958 return start().difference(end(),f);
959 }
960
964 date_time const &start() const { return s_; }
968 date_time const &end() const { return e_; }
969 private:
970 date_time const &s_;
971 date_time const &e_;
972 };
973
978 inline date_time_duration operator-(date_time const &later,date_time const &earlier)
979 {
980 return date_time_duration(earlier,later);
981 }
982
983
984 namespace period {
988 inline int era(date_time const &dt) { return dt.get(era()); }
992 inline int year(date_time const &dt) { return dt.get(year()); }
996 inline int extended_year(date_time const &dt) { return dt.get(extended_year()); }
1000 inline int month(date_time const &dt) { return dt.get(month()); }
1004 inline int day(date_time const &dt) { return dt.get(day()); }
1008 inline int day_of_year(date_time const &dt) { return dt.get(day_of_year()); }
1017 inline int day_of_week(date_time const &dt) { return dt.get(day_of_week()); }
1022 inline int day_of_week_in_month(date_time const &dt) { return dt.get(day_of_week_in_month()); }
1026 inline int day_of_week_local(date_time const &dt) { return dt.get(day_of_week_local()); }
1030 inline int hour(date_time const &dt) { return dt.get(hour()); }
1034 inline int hour_12(date_time const &dt) { return dt.get(hour_12()); }
1038 inline int am_pm(date_time const &dt) { return dt.get(am_pm()); }
1042 inline int minute(date_time const &dt) { return dt.get(minute()); }
1046 inline int second(date_time const &dt) { return dt.get(second()); }
1050 inline int week_of_year(date_time const &dt) { return dt.get(week_of_year()); }
1054 inline int week_of_month(date_time const &dt) { return dt.get(week_of_month()); }
1058 inline int first_day_of_week(date_time const &dt) { return dt.get(first_day_of_week()); }
1059
1063 inline int era(date_time_duration const &dt) { return dt.get(era()); }
1067 inline int year(date_time_duration const &dt) { return dt.get(year()); }
1071 inline int extended_year(date_time_duration const &dt) { return dt.get(extended_year()); }
1075 inline int month(date_time_duration const &dt) { return dt.get(month()); }
1079 inline int day(date_time_duration const &dt) { return dt.get(day()); }
1083 inline int day_of_year(date_time_duration const &dt) { return dt.get(day_of_year()); }
1087 inline int day_of_week(date_time_duration const &dt) { return dt.get(day_of_week()); }
1091 inline int day_of_week_in_month(date_time_duration const &dt) { return dt.get(day_of_week_in_month()); }
1095 inline int day_of_week_local(date_time_duration const &dt) { return dt.get(day_of_week_local()); }
1099 inline int hour(date_time_duration const &dt) { return dt.get(hour()); }
1103 inline int hour_12(date_time_duration const &dt) { return dt.get(hour_12()); }
1107 inline int am_pm(date_time_duration const &dt) { return dt.get(am_pm()); }
1111 inline int minute(date_time_duration const &dt) { return dt.get(minute()); }
1115 inline int second(date_time_duration const &dt) { return dt.get(second()); }
1119 inline int week_of_year(date_time_duration const &dt) { return dt.get(week_of_year()); }
1123 inline int week_of_month(date_time_duration const &dt) { return dt.get(week_of_month()); }
1127 inline int first_day_of_week(date_time_duration const &dt) { return dt.get(first_day_of_week()); }
1128
1129
1130 }
1131
1133
1134
1135 } // locale
1136 } // boost
1137
1138 #ifdef BOOST_MSVC
1139 #pragma warning(pop)
1140 #endif
1141
1142
1143 #endif
1144
1150 // vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
boost::locale::period::am_pm
period_type am_pm()
Definition: date_time.hpp:133
boost::locale::period::week_of_year
period_type week_of_year()
Definition: date_time.hpp:145
boost::locale::period::minute
period_type minute()
Definition: date_time.hpp:137
boost::locale::period::marks::week_of_month
The week number within current month.
Definition: date_time_facet.hpp:53
boost::locale::date_time_period::type
period::period_type type
The type of period, i.e. era, year, day etc.
Definition: date_time.hpp:58
boost::locale::period::marks::day_of_week_in_month
Definition: date_time_facet.hpp:44
boost::locale::period::extended_year
period_type extended_year()
Definition: date_time.hpp:91
boost::locale::period::saturday
date_time_period saturday()
Definition: date_time.hpp:306
boost::locale::date_time_period_set::date_time_period_set
date_time_period_set()
Definition: date_time.hpp:382
boost::locale::date_time_duration::end
date_time const & end() const
Definition: date_time.hpp:968
boost::locale::date_time_period_set::operator[]
date_time_period const & operator[](size_t n) const
Definition: date_time.hpp:428
boost::locale::period::marks::day_of_week
Definition: date_time_facet.hpp:39
boost::locale::period::marks::year
Year, it is calendar specific, for example 2011 in Gregorian calendar.
Definition: date_time_facet.hpp:34
boost::locale::date_time_period_set
this class that represents a set of periods,
Definition: date_time.hpp:376
boost::locale::period::january
date_time_period january()
Definition: date_time.hpp:233
boost::locale::period::november
date_time_period november()
Definition: date_time.hpp:273
boost::locale::date_time::operator+
date_time operator+(period::period_type f) const
Definition: date_time.hpp:665
boost::locale::date_time_period_set::size
size_t size() const
Definition: date_time.hpp:413
boost::locale::date_time_error::date_time_error
date_time_error(std::string const &e)
Definition: date_time.hpp:44
boost::locale::date_time_duration
This class represents a period: a pair of two date_time objects.
Definition: date_time.hpp:932
boost::locale::date_time::operator>>=
date_time const & operator>>=(period::period_type f)
Definition: date_time.hpp:719
boost::locale::period::march
date_time_period march()
Definition: date_time.hpp:241
boost::locale::period::day_of_week
period_type day_of_week()
Definition: date_time.hpp:112
boost::locale::period::marks::day_of_year
The number of day in year, starting from 1, in Gregorian [1..366].
Definition: date_time_facet.hpp:38
boost::locale::date_time_duration::get
int get(period::period_type f) const
Definition: date_time.hpp:948
boost::locale::period::monday
date_time_period monday()
Definition: date_time.hpp:286
boost::locale::period::february
date_time_period february()
Definition: date_time.hpp:237
boost::locale::period::april
date_time_period april()
Definition: date_time.hpp:245
boost::locale::boundary::operator<
bool operator<(segment< IteratorL > const &l, segment< IteratorR > const &r)
Compare two segments.
Definition: segment.hpp:255
boost::locale::period::first_day_of_week
period_type first_day_of_week()
Definition: date_time.hpp:153
boost::locale::boundary::operator<=
bool operator<=(segment< IteratorL > const &l, segment< IteratorR > const &r)
Compare two segments.
Definition: segment.hpp:261
boost::locale::calendar
this class provides an access to general calendar information.
Definition: date_time.hpp:473
boost::locale::period::august
date_time_period august()
Definition: date_time.hpp:261
boost::locale::period::am
date_time_period am()
Definition: date_time.hpp:310
boost::locale::boundary::operator>=
bool operator>=(segment< IteratorL > const &l, segment< IteratorR > const &r)
Compare two segments.
Definition: segment.hpp:273
boost::locale::period::october
date_time_period october()
Definition: date_time.hpp:269
boost::locale::date_time_period_set::add
void add(date_time_period f)
Definition: date_time.hpp:402
boost::locale::boundary::operator==
bool operator==(BaseIterator const &l, boundary_point< BaseIterator > const &r)
Definition: boundary_point.hpp:142
boost::locale::date_time::operator/
int operator/(period::period_type f) const
Definition: date_time.hpp:657
boost::locale::period::december
date_time_period december()
Definition: date_time.hpp:277
boost::locale::period::era
period_type era()
Definition: date_time.hpp:83
boost::locale::period::hour
period_type hour()
Definition: date_time.hpp:125
boost::locale::hold_ptr
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
boost::locale::ios_info::display_flags
void display_flags(uint64_t flags)
boost::locale::ios_info::get
static ios_info & get(std::ios_base &ios)
boost::locale::date_time::operator-=
date_time const & operator-=(period::period_type f)
Definition: date_time.hpp:688
boost::locale::period::marks::week_of_year
The week number in the year.
Definition: date_time_facet.hpp:52
boost::locale::period::marks::hour
24 clock hour [0..23]
Definition: date_time_facet.hpp:47
boost::locale::period::marks::invalid
Special invalid value, should not be used directly.
Definition: date_time_facet.hpp:32
boost::locale::period::marks::day
The day of month, calendar specific, in Gregorian [1..31].
Definition: date_time_facet.hpp:37
boost::locale::period::day_of_week_local
period_type day_of_week_local()
Definition: date_time.hpp:121
boost::locale::period::marks::minute
minute [0..59]
Definition: date_time_facet.hpp:50
boost::locale::date_time_period::operator+
date_time_period operator+() const
Definition: date_time.hpp:63
boost::locale::period::marks::month
The month of year, calendar specific, in Gregorian [0..11].
Definition: date_time_facet.hpp:36
boost::locale::period::marks::day_of_week_local
Local day of week, for example in France Monday is 1, in US Sunday is 1, [1..7].
Definition: date_time_facet.hpp:46
boost::locale::period::operator-
date_time_period operator-(period::period_type f)
Definition: date_time.hpp:326
boost::locale::period::day_of_week_in_month
period_type day_of_week_in_month()
Definition: date_time.hpp:117
boost::locale::period::operator*
date_time_period operator*(period::period_type f, T v)
Definition: date_time.hpp:335
boost::locale::period::marks::hour_12
12 clock hour [0..11]
Definition: date_time_facet.hpp:48
boost::locale::date_time_period
This class represents a pair of period_type and the integer values that describes its amount...
Definition: date_time.hpp:56
boost::locale::period::pm
date_time_period pm()
Definition: date_time.hpp:314
boost::locale::period::day
period_type day()
Definition: date_time.hpp:99
boost::locale::date_time::get
int get(period::period_type f) const
boost::locale::period::year
period_type year()
Definition: date_time.hpp:87
boost::locale::period::week_of_month
period_type week_of_month()
Definition: date_time.hpp:149
boost::locale::operator-
date_time_period_set operator-(date_time_period_set const &a, date_time_period_set const &b)
Definition: date_time.hpp:457
boost::locale::period::wednesday
date_time_period wednesday()
Definition: date_time.hpp:294
boost::locale::date_time::operator<<=
date_time const & operator<<=(period::period_type f)
Definition: date_time.hpp:712
boost::locale::date_time_error
This error is thrown in case of invalid state that occurred.
Definition: date_time.hpp:39
boost::locale::period::thursday
date_time_period thursday()
Definition: date_time.hpp:298
boost::locale::period::marks::am_pm
am or pm marker [0..1]
Definition: date_time_facet.hpp:49
boost::locale::date_time_period_set::date_time_period_set
date_time_period_set(period::period_type f)
Definition: date_time.hpp:388
boost::locale::date_time_period_set::date_time_period_set
date_time_period_set(date_time_period const &fl)
Definition: date_time.hpp:395
boost::locale::period::sunday
date_time_period sunday()
Definition: date_time.hpp:282
boost::locale::operator<<
std::basic_ostream< CharType > & operator<<(std::basic_ostream< CharType > &out, date_time const &t)
Definition: date_time.hpp:874
boost::locale::period::friday
date_time_period friday()
Definition: date_time.hpp:302
boost::locale::date_time::operator>>
date_time operator>>(period::period_type f) const
Definition: date_time.hpp:704
boost::locale::date_time_duration::operator/
int operator/(period::period_type f) const
Definition: date_time.hpp:956
boost::locale::period::tuesday
date_time_period tuesday()
Definition: date_time.hpp:290
boost::locale::date_time_period::value
int value
Definition: date_time.hpp:59
boost::locale::period::operator+
date_time_period operator+(period::period_type f)
Definition: date_time.hpp:319
boost::locale::date_time_duration::date_time_duration
date_time_duration(date_time const &first, date_time const &second)
Definition: date_time.hpp:939
boost::locale::period::day_of_year
period_type day_of_year()
Definition: date_time.hpp:103
boost::locale::date_time_period::operator-
date_time_period operator-() const
Definition: date_time.hpp:67
boost::locale::period::marks::era
Era i.e. AC, BC in Gregorian and Julian calendar, range [0,1].
Definition: date_time_facet.hpp:33
boost::locale::period::marks::first_day_of_week
First day of week, constant, for example Sunday in US = 1, Monday in France = 2.
Definition: date_time_facet.hpp:54
boost::locale::date_time::time
double time() const
boost::locale::operator+
date_time_period_set operator+(date_time_period_set const &a, date_time_period_set const &b)
Definition: date_time.hpp:446
boost::locale::period::hour_12
period_type hour_12()
Definition: date_time.hpp:129
boost::locale::operator>>
std::basic_istream< CharType > & operator>>(std::basic_istream< CharType > &in, date_time &t)
Definition: date_time.hpp:901
boost::locale::period::marks::extended_year
Extended year for Gregorian/Julian calendars, where 1 BC == 0, 2 BC == -1.
Definition: date_time_facet.hpp:35
boost::locale::period::invalid
period_type invalid()
Definition: date_time.hpp:79
boost::locale::date_time::operator+=
date_time const & operator+=(period::period_type f)
Definition: date_time.hpp:681
boost::locale::period::june
date_time_period june()
Definition: date_time.hpp:253
boost::locale::date_time::operator<<
date_time operator<<(period::period_type f) const
Definition: date_time.hpp:696
boost::locale::period::may
date_time_period may()
Definition: date_time.hpp:249
boost::locale::date_time
this class represents a date time and allows to perform various operation according to the locale set...
Definition: date_time.hpp:590
boost::locale::as::time
std::ios_base & time(std::ios_base &ios)
Definition: formatting.hpp:328
boost::locale::date_time_duration::start
date_time const & start() const
Definition: date_time.hpp:964
boost::locale::date_time::operator-
date_time operator-(period::period_type f) const
Definition: date_time.hpp:673
boost::locale::date_time::difference
int difference(date_time const &other, period::period_type f) const
boost::locale::date_time_period::date_time_period
date_time_period(period::period_type f=period::period_type(), int v=1)
Definition: date_time.hpp:72
boost::locale::boundary::operator>
bool operator>(segment< IteratorL > const &l, segment< IteratorR > const &r)
Compare two segments.
Definition: segment.hpp:267
boost::locale::period::second
period_type second()
Definition: date_time.hpp:141
boost::locale::period::marks::second
second [0..59]
Definition: date_time_facet.hpp:51
boost::locale::period::month
period_type month()
Definition: date_time.hpp:95
boost::locale::period::july
date_time_period july()
Definition: date_time.hpp:257
boost::locale::boundary::operator!=
bool operator!=(BaseIterator const &l, boundary_point< BaseIterator > const &r)
Definition: boundary_point.hpp:150
boost::locale::period::september
date_time_period september()
Definition: date_time.hpp:265
boost::locale::period::period_type
This class holds a type that represents certain period of time like year, hour, second and so on...
Definition: date_time_facet.hpp:70
- © Copyright 2009-2012 Artyom Beilis, Distributed under the Boost Software License, Version 1.0.