Карта сайта Kansoftware
НОВОСТИУСЛУГИРЕШЕНИЯКОНТАКТЫ
Разработка программного обеспечения

Class template date_generator_parser

Boost , The Boost C++ Libraries BoostBook Documentation Subset , Library Reference

Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

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 std::basic_string< charT >                string_type;      
  typedef std::istreambuf_iterator< charT >         stream_itr_type;  
  typedef date_type::month_type                     month_type;       
  typedef date_type::day_of_week_type               day_of_week_type; 
  typedef date_type::day_type                       day_type;         
  typedef string_parse_tree< charT >                parse_tree_type;  
  typedef parse_tree_type::parse_match_result_type  match_results;    
  typedef std::vector< std::basic_string< charT > > collection_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; 
  typedef charT                                     char_type;        
  enum phrase_elements { first = =0, second, third, fourth, fifth, last, 
                         before, after, of, number_of_phrase_elements };
  // construct/copy/destruct
  date_generator_parser();
  date_generator_parser(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 &);
  // public member functions
  void 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 element_strings(const collection_type &);
  template<typename facet_type> 
    partial_date_type 
    get_partial_date_type(stream_itr_type &, stream_itr_type &, 
                          std::ios_base &, const facet_type &) const;
  template<typename facet_type> 
    nth_kday_type 
    get_nth_kday_type(stream_itr_type &, stream_itr_type &, std::ios_base &, 
                      const facet_type &) const;
  template<typename facet_type> 
    first_kday_type 
    get_first_kday_type(stream_itr_type &, stream_itr_type &, std::ios_base &, 
                        const facet_type &) const;
  template<typename facet_type> 
    last_kday_type 
    get_last_kday_type(stream_itr_type &, stream_itr_type &, std::ios_base &, 
                       const facet_type &) const;
  template<typename facet_type> 
    kday_before_type 
    get_kday_before_type(stream_itr_type &, stream_itr_type &, 
                         std::ios_base &, const facet_type &) const;
  template<typename facet_type> 
    kday_after_type 
    get_kday_after_type(stream_itr_type &, stream_itr_type &, std::ios_base &, 
                        const facet_type &) const;
  // private member functions
  void extract_element(stream_itr_type &, stream_itr_type &, 
                       typename date_generator_parser::phrase_elements) const;
  // public data members
  static const char_type first_string;
  static const char_type second_string;
  static const char_type third_string;
  static const char_type fourth_string;
  static const char_type fifth_string;
  static const char_type last_string;
  static const char_type before_string;
  static const char_type after_string;
  static const char_type of_string;
};

Description

Элементы «фразы» генератора дат анализируются из входного потока в определенном порядке. Все элементы необходимы, и порядок, в котором они появляются, не может измениться, однако сами элементы могут быть изменены. Элементы по умолчанию и их порядок следующие:

  • Partial_date=>«dd Месяц»

  • nth_day_of_the_week_in_month =>"день недели месяца"

  • first_day_of_the_week_in_month =>"первый будний день месяца"

  • Last_day_of_the_week_in_month =>"Последний будний день месяца"

  • first_day_of_the_week_after =>"weekday after"

  • first_day_of_the_week_before =>«за день до»

Имена и форматы дней недели и месяца обрабатываются с помощьюdate_input_facet.

date_generator_parser public construct/copy/destruct

  1. date_generator_parser();
    Создаетdate_generator_parserс набором по умолчанию «элемент_струн».
  2. <
    date_generator_parser(conststring_type&first_str,
                         conststring_type&second_str,
                         conststring_type&third_str,
                         conststring_type&fourth_str,
                         conststring_type&fifth_str,
                         conststring_type&last_str,
                         conststring_type&before_str,
                         conststring_type&after_str,
                         conststring_type&of_str);
    >Создает<date_generator_parser>, используя определенный пользователем набор строк элементов.

date_generator_parser public member functions

  1. voidelement_strings(conststring_type&first_str,
                        conststring_type&second_str,
                        conststring_type&third_str,
                        conststring_type&fourth_str,
                        conststring_type&fifth_str,
                        conststring_type&last_str,
                        conststring_type&before_str,
                        conststring_type&after_str,
                        conststring_type&of_str);
    Заменить строки, определяющие n-ю неделю для генератора.
  2. <
    voidelement_strings(constcollection_type&col);
    >
  3. <
    template<typenamefacet_type>
     partial_date_type
     get_partial_date_type(stream_itr_type&sitr,stream_itr_type&stream_end,
                           std::ios_base&a_ios,constfacet_type&facet)const;
    >Возвращается<partial_date>парсированный из потока
  4. template<typenamefacet_type>
     nth_kday_type
     get_nth_kday_type(stream_itr_type&sitr,stream_itr_type&stream_end,
                       std::ios_base&a_ios,constfacet_type&facet)const;
    возвращает nth_kday_of_week, парсированный из потока
  5. <
    template<typenamefacet_type>
     first_kday_type
     get_first_kday_type(stream_itr_type&sitr,stream_itr_type&stream_end,
                         std::ios_base&a_ios,constfacet_type&facet)const;
    >возвращает первый_kday_of_week с парсингом из потока
  6. template<typenamefacet_type>
     last_kday_type
     get_last_kday_type(stream_itr_type&sitr,stream_itr_type&stream_end,
                        std::ios_base&a_ios,constfacet_type&facet)const;
    Возвращает Last_kday_of_week из потока
  7. <
    template<typenamefacet_type>
     kday_before_type
     get_kday_before_type(stream_itr_type&sitr,stream_itr_type&stream_end,
                          std::ios_base&a_ios,constfacet_type&facet)const;
    >возвращает первый_kday_of_week с парсингом из потока
  8. template<typenamefacet_type>
     kday_after_type
     get_kday_after_type(stream_itr_type&sitr,stream_itr_type&stream_end,
                         std::ios_base&a_ios,constfacet_type&facet)const;
    возвращает первый_kday_of_week с парсингом из потока

date_generator_parser private member functions

  1. <
    voidextract_element(stream_itr_type&sitr,stream_itr_type&stream_end,
                        typenamedate_generator_parser::phrase_elementsele)const;
    >Извлекает элемент фразы из ввода. Скачать ios_base::failure on error

PrevUpHomeNext

Статья Class template date_generator_parser раздела The Boost C++ Libraries BoostBook Documentation Subset Library Reference может быть полезна для разработчиков на c++ и boost.




Материалы статей собраны из открытых источников, владелец сайта не претендует на авторство. Там где авторство установить не удалось, материал подаётся без имени автора. В случае если Вы считаете, что Ваши права нарушены, пожалуйста, свяжитесь с владельцем сайта.



:: Главная :: Library Reference ::


реклама


©KANSoftWare (разработка программного обеспечения, создание программ, создание интерактивных сайтов), 2007
Top.Mail.Ru

Время компиляции файла: 2024-08-30 11:47:00
2025-05-20 00:51:59/0.0045180320739746/0