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 charT >                ;      
  typedef charT >         ;  
  typedef                      ;       
  typedef                ; 
  typedef                        ;         
  typedef string_parse_tree< charT >                ;  
  typedef   ;    
  typedef charT > > ;  
  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 charT                                     ;        

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

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

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

  // private member functions
  void (, , 
                       typename ) ;

  // public data members
  static const  first_string;
  static const  second_string;
  static const  third_string;
  static const  fourth_string;
  static const  fifth_string;
  static const  last_string;
  static const  before_string;
  static const  after_string;
  static const  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. (const  first_str, 
                          const  second_str, 
                          const  third_str, 
                          const  fourth_str, 
                          const  fifth_str, 
                          const  last_str, 
                          const  before_str, 
                          const  after_str, 
                          const  of_str);
    Creates a date_generator_parser using a user defined set of element strings.

date_generator_parser public member functions

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

date_generator_parser private member functions

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

PrevUpHomeNext