8 #ifndef BOOSTER_LOCALE_DATE_TIME_H_INCLUDED 9 #define BOOSTER_LOCALE_DATE_TIME_H_INCLUDED 11 #include <booster/config.h> 13 # pragma warning(push) 14 # pragma warning(disable : 4275 4251 4231 4660) 17 #include <booster/locale/hold_ptr.h> 18 #include <booster/locale/date_time_facet.h> 19 #include <booster/locale/formatting.h> 20 #include <booster/locale/time_zone.h> 23 #include <booster/backtrace.h> 408 periods_.push_back(f);
423 return 4+periods_.size();
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;
556 bool operator==(
calendar const &other)
const;
560 bool operator!=(
calendar const &other)
const;
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;
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
950 return start().difference(end(),f);
958 return start().difference(end(),f);
996 inline int extended_year(
date_time const &dt) {
return dt.
get(extended_year()); }
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()); }
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()); }
1139 #pragma warning(pop) int operator/(period::period_type f) const
Definition: date_time.h:657
date_time const & start() const
Definition: date_time.h:964
date_time_period november()
Definition: date_time.h:273
this class provides an access to general calendar information.
Definition: date_time.h:473
date_time_period monday()
Definition: date_time.h:286
date_time const & operator+=(period::period_type f)
Definition: date_time.h:681
date_time const & end() const
Definition: date_time.h:968
Same as std::runtime_error but records stack trace.
Definition: backtrace.h:158
std::basic_istream< CharType > & operator>>(std::basic_istream< CharType > &in, date_time &t)
Definition: date_time.h:901
date_time_period sunday()
Definition: date_time.h:282
void add(date_time_period f)
Definition: date_time.h:402
date_time_period tuesday()
Definition: date_time.h:290
date_time_period_set(period::period_type f)
Definition: date_time.h:388
date_time operator-(period::period_type f) const
Definition: date_time.h:673
std::basic_ostream< CharType > & operator<<(std::basic_ostream< CharType > &out, date_time const &t)
Definition: date_time.h:874
date_time_duration(date_time const &first, date_time const &second)
Definition: date_time.h:939
date_time_period saturday()
Definition: date_time.h:306
size_t size() const
Definition: date_time.h:413
date_time_period january()
Definition: date_time.h:233
date_time_period pm()
Definition: date_time.h:314
date_time operator<<(period::period_type f) const
Definition: date_time.h:696
This error is thrown in case of invalid state that occurred.
Definition: date_time.h:39
date_time_period september()
Definition: date_time.h:265
a smart pointer similar to std::auto_ptr but it is non-copyable and the underlying object has the sam...
Definition: hold_ptr.h:18
This class represents a period: a pair of two date_time objects.
Definition: date_time.h:932
date_time_period february()
Definition: date_time.h:237
this class represents a date time and allows to perform various operation according to the locale set...
Definition: date_time.h:590
static ios_info & get(std::ios_base &ios)
date_time_period may()
Definition: date_time.h:249
date_time_period march()
Definition: date_time.h:241
date_time_period august()
Definition: date_time.h:261
date_time_period december()
Definition: date_time.h:277
date_time const & operator>>=(period::period_type f)
Definition: date_time.h:719
date_time operator>>(period::period_type f) const
Definition: date_time.h:704
date_time_period operator*(period::period_type f, T v)
Definition: date_time.h:335
date_time_period wednesday()
Definition: date_time.h:294
date_time_period(period::period_type f=period::period_type(), int v=1)
Definition: date_time.h:72
date_time_error(std::string const &e)
Definition: date_time.h:44
Same as std::out_of_range but records stack trace.
Definition: backtrace.h:238
date_time_period_set operator-(date_time_period_set const &a, date_time_period_set const &b)
Definition: date_time.h:457
date_time_period october()
Definition: date_time.h:269
date_time_period_set(date_time_period const &fl)
Definition: date_time.h:395
This is the main namespace that encloses all localization classes.
Definition: locale_fwd.h:14
date_time operator+(period::period_type f) const
Definition: date_time.h:665
date_time_period am()
Definition: date_time.h:310
date_time const & operator-=(period::period_type f)
Definition: date_time.h:688
date_time_period friday()
Definition: date_time.h:302
This class holds a type that represents certain period of time like year, hour, second and so on...
Definition: date_time_facet.h:70
period::period_type type
The type of period, i.e. era, year, day etc.
Definition: date_time.h:58
date_time_period operator-() const
Definition: date_time.h:67
date_time_period const & operator[](size_t n) const
Definition: date_time.h:428
this class that represents a set of periods,
Definition: date_time.h:376
date_time_period april()
Definition: date_time.h:245
date_time_period thursday()
Definition: date_time.h:298
This class represents a pair of period_type and the integer values that describes its amount...
Definition: date_time.h:56
date_time_period june()
Definition: date_time.h:253
date_time_period july()
Definition: date_time.h:257
date_time_period_set operator+(date_time_period_set const &a, date_time_period_set const &b)
Definition: date_time.h:446
int get(period::period_type f) const
Definition: date_time.h:948
date_time const & operator<<=(period::period_type f)
Definition: date_time.h:712
void display_flags(uint64_t flags)
Booster library namespace. The library that implements Boost Like API in ABI backward compatible way...
Definition: application.h:23
date_time_period_set()
Definition: date_time.h:382
int value
Definition: date_time.h:59
int get(period::period_type f) const
std::ios_base & time(std::ios_base &ios)
Definition: formatting.h:328