| Home | Libraries | People | FAQ | More

## Class template date_input_facet

boost::date_time::date_input_facet — Input facet.

## Synopsis

    template<typename date_type, typename CharT,
             typename InItrT = std::istreambuf_iterator<CharT, std::char_traits<CharT> > >
    class date_input_facet {
    public:
      // types
      typedef date_type::duration_type                             duration_type;
      typedef date_type::day_of_week_type                          day_of_week_type;
      typedef date_type::day_type                                  day_type;
      typedef date_type::month_type                                month_type;
      typedef date_type::year_type                                 year_type;
      typedef boost::date_time::period< date_type, duration_type > period_type;
      typedef std::basic_string< CharT >                           string_type;
      typedef CharT                                                char_type;
      typedef boost::date_time::period_parser< date_type, CharT >  period_parser_type;
      typedef special_values_parser< date_type, CharT >            special_values_parser_type;
      typedef std::vector< std::basic_string< CharT > >            input_collection_type;
      typedef format_date_parser< date_type, CharT >               format_date_parser_type;
      typedef date_generator_parser< date_type, CharT >            date_gen_parser_type;
      typedef partial_date< date_type >                            partial_date_type;
      typedef nth_kday_of_month< date_type >                       nth_kday_type;
      typedef first_kday_of_month< date_type >                     first_kday_type;
      typedef last_kday_of_month< date_type >                      last_kday_type;
      typedef first_kday_after< date_type >                        kday_after_type;
      typedef first_kday_before< date_type >                       kday_before_type;

      // construct/copy/destruct
      date_input_facet(::size_t = 0);
      date_input_facet(const string_type &, ::size_t = 0);
      date_input_facet(const string_type &, const format_date_parser_type &,
                       const special_values_parser_type &,
                       const period_parser_type &, const date_gen_parser_type &,
                       ::size_t = 0);

      // public member functions
      void format(const char_type *const) ;
      virtual void set_iso_format() ;
      virtual void set_iso_extended_format() ;
      void month_format(const char_type *const) ;
      void weekday_format(const char_type *const) ;
      void year_format(const char_type *const) ;
      void period_parser(period_parser_type) ;
      void short_weekday_names(const input_collection_type &) ;
      void long_weekday_names(const input_collection_type &) ;
      void short_month_names(const input_collection_type &) ;
      void long_month_names(const input_collection_type &) ;
      void date_gen_element_strings(const input_collection_type &) ;
      void date_gen_element_strings(const string_type &, const string_type &,
                                    const string_type &, const string_type &,
                                    const string_type &, const string_type &,
                                    const string_type &, const string_type &,
                                    const string_type &) ;
      void special_values_parser(special_values_parser_type) ;
      InItrT get(InItrT &, InItrT &, std::ios_base &, date_type &) const;
      InItrT get(InItrT &, InItrT &, std::ios_base &, month_type &) const;
      InItrT get(InItrT &, InItrT &, std::ios_base &, day_of_week_type &) const;
      InItrT get(InItrT &, InItrT &, std::ios_base &, day_type &) const;
      InItrT get(InItrT &, InItrT &, std::ios_base &, year_type &) const;
      InItrT get(InItrT &, InItrT &, std::ios_base &, duration_type &) const;
      InItrT get(InItrT &, InItrT &, std::ios_base &, period_type &) const;
      InItrT get(InItrT &, InItrT &, std::ios_base &, nth_kday_type &) const;
      InItrT get(InItrT &, InItrT &, std::ios_base &, partial_date_type &) const;
      InItrT get(InItrT &, InItrT &, std::ios_base &, first_kday_type &) const;
      InItrT get(InItrT &, InItrT &, std::ios_base &, last_kday_type &) const;
      InItrT get(InItrT &, InItrT &, std::ios_base &, kday_before_type &) const;
      InItrT get(InItrT &, InItrT &, std::ios_base &, kday_after_type &) const;

      static const char_type long_weekday_format;
      static const char_type short_weekday_format;
      static const char_type long_month_format;
      static const char_type short_month_format;
      static const char_type four_digit_year_format;
      static const char_type two_digit_year_format;
      static const char_type default_period_separator;
      static const char_type standard_format_specifier;
      static const char_type iso_format_specifier;
      static const char_type iso_format_extended_specifier;
      static const char_type default_date_format;
      static std::locale::id id;
    };

## Description

### `date_input_facet` construct/copy/destruct

1.     date_input_facet(::size_t a_ref = 0);

2.     date_input_facet(const string_type & format, ::size_t a_ref = 0);

3.     date_input_facet(const string_type & format,
                        const format_date_parser_type & date_parser,
                        const special_values_parser_type & sv_parser,
                        const period_parser_type & per_parser,
                        const date_gen_parser_type & date_gen_parser,
                        ::size_t ref_count = 0);

### `date_input_facet` public member functions

1.     void format(const char_type *const format) ;

2.     virtual void set_iso_format() ;

3.     virtual void set_iso_extended_format() ;

4.     void month_format(const char_type *const format) ;

5.     void weekday_format(const char_type *const format) ;

6.     void year_format(const char_type *const format) ;

7.     void period_parser(period_parser_type period_parser) ;

8.     void short_weekday_names(const input_collection_type & weekday_names) ;

9.     void long_weekday_names(const input_collection_type & weekday_names) ;

10.     void short_month_names(const input_collection_type & month_names) ;

11.     void long_month_names(const input_collection_type & month_names) ;

12.     void date_gen_element_strings(const input_collection_type & col) ;

13.     void date_gen_element_strings(const string_type & first,
                                      const string_type & second,
                                      const string_type & third,
                                      const string_type & fourth,
                                      const string_type & fifth,
                                      const string_type & last,
                                      const string_type & before,
                                      const string_type & after,
                                      const string_type & of) ;

14.     void special_values_parser(special_values_parser_type sv_parser) ;

15.     InItrT get(InItrT & from, InItrT & to, std::ios_base & , date_type & d) const;

16.     InItrT get(InItrT & from, InItrT & to, std::ios_base & , month_type & m) const;

17.     InItrT get(InItrT & from, InItrT & to, std::ios_base & ,
                   day_of_week_type & wd) const;

18.     InItrT get(InItrT & from, InItrT & to, std::ios_base & , day_type & d) const;

19.     InItrT get(InItrT & from, InItrT & to, std::ios_base & , year_type & y) const;

20.     InItrT get(InItrT & from, InItrT & to, std::ios_base & a_ios,
                   duration_type & dd) const;

21.     InItrT get(InItrT & from, InItrT & to, std::ios_base & a_ios, period_type & p) const;

22.     InItrT get(InItrT & from, InItrT & to, std::ios_base & a_ios,
                   nth_kday_type & nkd) const;

23.     InItrT get(InItrT & from, InItrT & to, std::ios_base & a_ios,
                   partial_date_type & pd) const;

24.     InItrT get(InItrT & from, InItrT & to, std::ios_base & a_ios,
                   first_kday_type & fkd) const;

25.     InItrT get(InItrT & from, InItrT & to, std::ios_base & a_ios,
                   last_kday_type & lkd) const;

26.     InItrT get(InItrT & from, InItrT & to, std::ios_base & a_ios,
                   kday_before_type & fkb) const;

27.     InItrT get(InItrT & from, InItrT & to, std::ios_base & a_ios,
                   kday_after_type & fka) const;

| Copyright © 2001-2005 CrystalClear Software, Inc