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

Class template date_facet

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_facet

boost::date_time::date_facet

Synopsis

// In header: <boost/date_time/date_facet.hpp>
template<typename date_type, typename CharT, 
         typename OutItrT = std::ostreambuf_iterator<CharT, std::char_traits<CharT> > > 
class date_facet : public 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 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_formatter< CharT >          period_formatter_type;        
  typedef boost::date_time::special_values_formatter< CharT >  special_values_formatter_type;
  typedef std::vector< std::basic_string< CharT > >            input_collection_type;        
  typedef date_generator_formatter< date_type, CharT >         date_gen_formatter_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
  explicit date_facet(::size_t = 0);
  explicit date_facet(const char_type *, const input_collection_type &, 
                      ::size_t = 0);
  explicit date_facet(const char_type *, 
                      period_formatter_type = period_formatter_type(), 
                      special_values_formatter_type = special_values_formatter_type(), 
                      date_gen_formatter_type = date_gen_formatter_type(), 
                      ::size_t = 0);
  // public member functions
  std::locale::id & __get_id(void) const;
  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 period_formatter(period_formatter_type);
  void special_values_formatter(const special_values_formatter_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_phrase_strings(const input_collection_type &, 
                               typename date_gen_formatter_type::phrase_elements = date_gen_formatter_type::first);
  OutItrT put(OutItrT, std::ios_base &, char_type, const date_type &) const;
  OutItrT put(OutItrT, std::ios_base &, char_type, const duration_type &) const;
  OutItrT put(OutItrT, std::ios_base &, char_type, const month_type &) const;
  OutItrT put(OutItrT, std::ios_base &, char_type, const day_type &) const;
  OutItrT put(OutItrT, std::ios_base &, char_type, const day_of_week_type &) const;
  OutItrT put(OutItrT, std::ios_base &, char_type, const period_type &) const;
  OutItrT put(OutItrT, std::ios_base &, char_type, const partial_date_type &) const;
  OutItrT put(OutItrT, std::ios_base &, char_type, const nth_kday_type &) const;
  OutItrT put(OutItrT, std::ios_base &, char_type, const first_kday_type &) const;
  OutItrT put(OutItrT, std::ios_base &, char_type, const last_kday_type &) const;
  OutItrT put(OutItrT, std::ios_base &, char_type, const kday_before_type &) const;
  OutItrT put(OutItrT, std::ios_base &, char_type, const kday_after_type &) const;
  // protected member functions
  virtual OutItrT 
  do_put_special(OutItrT, std::ios_base &, char_type, 
                 const boost::date_time::special_values) const;
  virtual OutItrT 
  do_put_tm(OutItrT, std::ios_base &, char_type, const tm &, string_type) const;
  // public data members
  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 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

Класс, который предоставляет формат на основе I/O для типов дат.

Этот класс позволяет форматировать даты с помощью строки формата. Форматными строками являются:

  • A =>long_weekday_format - Полное имя Ex: Tuesday

  • a =>short_weekday_format — аббревиатура из трех букв Ex: Tue

  • B =>long_month_format - Полное имя Ex: October

  • b =>short_month_format — аббревиатура из трех букв Ex: Oct

  • x =>standard_format_specifier — определяется локально

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

Формат месяца по умолчанию == b Формат дня недели по умолчанию ==

date_facet public construct/copy/destruct

  1. эксплицитноdate_facet::size_ta_ref=0;
  2. эксплицитноdate_facetconstchar_type*format_str,constinput_collection_type&short_names,::size_tref_count=0;
  3. эксплицитноconst*период_форматтер_тип=период_форматтер_типспециальные_значения_форматтер_типспециальные_значения_форматтер_типдата_ген_форматтер_типдата_ген_форматтер_типразмер_tref_count

    .

date_facet public member functions

  1. std::locale::id&__get_idvoidconst;
  2. voidformatconstchar_type*constformat_str;
  3. виртуальныйпустотаset_iso_format;
  4. виртуальныйпустотаset_iso_extended_format;
  5. voidmonth_formatconstchar_type*constformat_str;
  6. voidweekday_formatconstchar_type*constformat_str;
  7. voidperiod_formatterperiod_formatter_typeper_formatter];
  8. voidspecial_values_formatterconstspecial_values_formatter_type&svf;
  9. voidshort_weekday_namesconstinput_collection_type&short_names;
  10. voidlong_weekday_namesconstinput_collection_type&long_names;
  11. voidshort_month_namesconstinput_collection_type&short_names;
  12. voidlong_month_namesconstinput_collection_type&long_names;
  13. voiddate_gen_phrase_stringsconstinput_collection_type&new_strings,typenamedate_gen_formatter_type::phrase_elementsbeg_pos=date_gen_formatter_typefirst;
  14. OutItrTпоставитьOutItrTследующим,std::ios_base&a_ios,char_typefill_char,const&dconst
  15. OutItrTположитьOutItrTследующая,std::ios_base&a_ios,char_typefill_char,const&ddconst
  16. OutItrTположитьOutItrTstd::ios_base&aios&aios,char_typefill_char,constmonth_type&m]const;
  17. OutItrTположитьOutItrTследующим,std::ios_base&aios&a_ios,char_typefill_char,const&const;
    ставит день месяца
  18. OutItrTположитьOutItrTследующая,stdios_base&aios&a_ios,char_typefill_char,constday_of_week_type&dowconst;
  19. OutItrTпоставитьOutItrTследующим,std::ios_base&a_ios,char_typefill_char,const&const
    .
  20. OutItrTположитьOutItrTследующим,std::ios_base&aios,char_typefill_char,constpart_date_type&pdconst
  21. OutItrTположитьOutItrTstd::ios_base&a_ios,char_typefill_char,constnth_kday_type&nkd]const;
  22. OutItrTположитьOutItrTследующим,std::ios_base&a_ios,char_typefill_char,constfirst_kday_type&fkdconst
  23. OutItrTположитьOutItrTstd::ios_base&a_ios,char_typefill_char,constlast_kday_type&lkdconst;
  24. OutItrTположитьOutItrTstdios_base&a_ios,char_typefill_char,constkday_before_type&fkbconst
  25. OutItrTположитьOutItrTследующая,std::ios_base&a_ios,char_typefill_char,constkday_after_type&fkaconst;

date_facet protected member functions

  1. виртуальныйOutItrTdo_put_specialOutItrTследующий,std::ios_base&,char_type,constboost::date_time::special_valuesspecial_values[999] const;
  2. виртуальныйOutItrTdo_put_tmOutItrTследующий,std::ios_base&aios&a_ios,a_ioschar_typefill_char,const

PrevUpHomeNext

Статья Class template date_facet раздела 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 04:39:05/0.0077240467071533/1