Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class template date_generator_parser

boost::date_time::date_generator_parser — Class for date_generator parsing.

Synopsis

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

template<typename date_type, typename charT> 
class date_generator_parser {
public:
  // types
  typedef                 ;      
  typedef          ;  
  typedef                      ;       
  typedef                ; 
  typedef                        ;         
  typedef string_parse_tree<                 ;  
  typedef parse_tree_type::parse_match_result_type  ;    
  typedef  ;  
  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<             ; 
  typedef                                      ;        

  enum phrase_elements { first = =0, second, third, fourth, fifth, last, 
                         before, after, of, number_of_phrase_elements };

  // construct/copy/destruct
  ();
  (, , 
                        , , 
                        , , 
                        , , 
                        );

  // public member functions
   (, , 
                       , , 
                       , , 
                       , , 
                       );
   ();
  template<typename facet_type> 
    partial_date_type 
    (, , 
                          , ) ;
  template<typename facet_type> 
    nth_kday_type 
    (, , , 
                      ) ;
  template<typename facet_type> 
    first_kday_type 
    (, , , 
                        ) ;
  template<typename facet_type> 
    last_kday_type 
    (, , , 
                       ) ;
  template<typename facet_type> 
    kday_before_type 
    (, , 
                         , ) ;
  template<typename facet_type> 
    kday_after_type 
    (, , , 
                        ) ;

  // private member functions
   (, , 
                       ) ;

  // public data members
  static  first_string;
  static  second_string;
  static  third_string;
  static  fourth_string;
  static  fifth_string;
  static  last_string;
  static  before_string;
  static  after_string;
  static  of_string;
};

Description

The elements of a date_generator "phrase" are parsed from the input stream in a particular order. All elements are required and the order in which they appear cannot change, however, the elements themselves can be changed. The default elements and their order are as follows:

  • partial_date => "dd Month"

  • nth_day_of_the_week_in_month => "nth weekday of month"

  • first_day_of_the_week_in_month => "first weekday of month"

  • last_day_of_the_week_in_month => "last weekday of month"

  • first_day_of_the_week_after => "weekday after"

  • first_day_of_the_week_before => "weekday before"

Weekday and Month names and formats are handled via the date_input_facet.

date_generator_parser public construct/copy/destruct

  1. ();
    Creates a date_generator_parser with the default set of "element_strings".
  2. ( first_str, 
                           second_str, 
                           third_str, 
                           fourth_str, 
                           fifth_str, 
                           last_str, 
                           before_str, 
                           after_str, 
                           of_str);
    Creates a date_generator_parser using a user defined set of element strings.

date_generator_parser public member functions

  1.  ( first_str, 
                          second_str, 
                          third_str, 
                          fourth_str, 
                          fifth_str, 
                          last_str, 
                          before_str, 
                          after_str, 
                          of_str);
    Replace strings that determine nth week for generator.
  2.  ( col);
  3. template<typename facet_type> 
      partial_date_type 
      ( sitr,  stream_end, 
                             a_ios,  facet) ;
    returns partial_date parsed from stream
  4. template<typename facet_type> 
      nth_kday_type 
      ( sitr,  stream_end, 
                         a_ios,  facet) ;
    returns nth_kday_of_week parsed from stream
  5. template<typename facet_type> 
      first_kday_type 
      ( sitr,  stream_end, 
                           a_ios,  facet) ;
    returns first_kday_of_week parsed from stream
  6. template<typename facet_type> 
      last_kday_type 
      ( sitr,  stream_end, 
                          a_ios,  facet) ;
    returns last_kday_of_week parsed from stream
  7. template<typename facet_type> 
      kday_before_type 
      ( sitr,  stream_end, 
                            a_ios,  facet) ;
    returns first_kday_of_week parsed from stream
  8. template<typename facet_type> 
      kday_after_type 
      ( sitr,  stream_end, 
                           a_ios,  facet) ;
    returns first_kday_of_week parsed from stream

date_generator_parser private member functions

  1.  ( sitr,  stream_end, 
                          ele) ;
    Extracts phrase element from input. Throws ios_base::failure on error.

PrevUpHomeNext