Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class template date_facet

boost::date_time::date_facet

Synopsis

// In header: <boost/date_time/date_facet.hpp>

template<typename date_type, typename CharT, 
         typename OutItrT> 
class date_facet : public  {
public:
  // types
  typedef                              ;                
  typedef                           ;             
  typedef                                   ;                     
  typedef                                 ;                   
  typedef boost::date_time::period<  ;                  
  typedef                            ;                  
  typedef                                                 ;                    
  typedef boost::date_time::period_formatter<           ;        
  typedef boost::date_time::special_values_formatter<   ;
  typedef             ;        
  typedef date_generator_formatter<          ;      
  typedef partial_date<                             ;            
  typedef nth_kday_of_month<                        ;                
  typedef first_kday_of_month<                      ;              
  typedef last_kday_of_month<                       ;               
  typedef first_kday_after<                         ;              
  typedef first_kday_before<                        ;             

  // construct/copy/destruct
  (:: = );
  (, , 
                      :: = );
  (, 
                      period_formatter_type = period_formatter_type(), 
                      special_values_formatter_type = special_values_formatter_type(), 
                      date_gen_formatter_type = date_gen_formatter_type(), 
                      :: = );

  // public member functions
   () ;
   ();
   ();
   ();
   ();
   ();
   (period_formatter_type);
   (special_values_formatter_type &);
   ();
   ();
   ();
   ();
   (, 
                                = );
   (, , , ) ;
   (, , , ) ;
   (, , , ) ;
   (, , , ) ;
   (, , , ) ;
   (, , , period_type &) ;
   (, , , partial_date_type &) ;
   (, , , nth_kday_type &) ;
   (, , , first_kday_type &) ;
   (, , , last_kday_type &) ;
   (, , , kday_before_type &) ;
   (, , , kday_after_type &) ;

  // protected member functions
   
  (, , , 
                 ) ;
   
  (, , , , ) ;

  // public data members
  static  long_weekday_format;
  static  short_weekday_format;
  static  long_month_format;
  static  short_month_format;
  static  default_period_separator;
  static  standard_format_specifier;
  static  iso_format_specifier;
  static  iso_format_extended_specifier;
  static  default_date_format;
  static  id;
};

Description

Class that provides format based I/O facet for date types.

This class allows the formatting of dates by using format string. Format strings are:

  • A => long_weekday_format - Full name Ex: Tuesday

  • a => short_weekday_format - Three letter abbreviation Ex: Tue

  • B => long_month_format - Full name Ex: October

  • b => short_month_format - Three letter abbreviation Ex: Oct

  • x => standard_format_specifier - defined by the locale

  • Y-b-d => default_date_format - YYYY-Mon-dd

Default month format == b Default weekday format == a

date_facet public construct/copy/destruct

  1. (:: a_ref = );
  2. ( format_str, 
                         short_names, 
                        :: ref_count = );
  3. ( format_str, 
                        period_formatter_type per_formatter = period_formatter_type(), 
                        special_values_formatter_type sv_formatter = special_values_formatter_type(), 
                        date_gen_formatter_type dg_formatter = date_gen_formatter_type(), 
                        :: ref_count = );

date_facet public member functions

  1.  () ;
  2.  ( format_str);
  3.  ();
  4.  ();
  5.  ( format_str);
  6.  ( format_str);
  7.  (period_formatter_type per_formatter);
  8.  (special_values_formatter_type & svf);
  9.  ( short_names);
  10.  ( long_names);
  11.  ( short_names);
  12.  ( long_names);
  13.  ( new_strings, 
                                  beg_pos = );
  14.  ( next,  a_ios,  fill_char, 
                 d) ;
  15.  ( next,  a_ios,  fill_char, 
                 dd) ;
  16.  ( next,  a_ios,  fill_char, 
                 m) ;
  17.  ( next,  a_ios,  fill_char, 
                 day) ;
    puts the day of month
  18.  ( next,  a_ios,  fill_char, 
                 dow) ;
  19.  ( next,  a_ios,  fill_char, 
                period_type & p) ;
  20.  ( next,  a_ios,  fill_char, 
                partial_date_type & pd) ;
  21.  ( next,  a_ios,  fill_char, 
                nth_kday_type & nkd) ;
  22.  ( next,  a_ios,  fill_char, 
                first_kday_type & fkd) ;
  23.  ( next,  a_ios,  fill_char, 
                last_kday_type & lkd) ;
  24.  ( next,  a_ios,  fill_char, 
                kday_before_type & fkb) ;
  25.  ( next,  a_ios,  fill_char, 
                kday_after_type & fka) ;

date_facet protected member functions

  1.  
    ( next, , , 
                    sv) ;
  2.  
    ( next,  a_ios,  fill_char, 
               tm_value,  a_format) ;

PrevUpHomeNext