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

Class template time_input_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 time_input_facet

boost::date_time::time_input_facet — Facet for format-based input.

Synopsis

// In header: <boost/date_time/time_facet.hpp>
template<typename time_type, typename CharT, 
         typename InItrT = std::istreambuf_iterator<CharT, std::char_traits<CharT> > > 
class time_input_facet : public boost::date_time::date_input_facet< time_type::date_type, CharT, InItrT >
{
public:
  // types
  typedef time_type::date_type                                                               date_type;                 
  typedef time_type::time_duration_type                                                      time_duration_type;        
  typedef time_duration_type::fractional_seconds_type                                        fracional_seconds_type;    
  typedef boost::date_time::period< time_type, time_duration_type >                          period_type;               
  typedef boost::date_time::date_input_facet< typename time_type::date_type, CharT, InItrT > base_type;                 
  typedef base_type::duration_type                                                           date_duration_type;        
  typedef base_type::year_type                                                               year_type;                 
  typedef base_type::month_type                                                              month_type;                
  typedef base_type::day_type                                                                day_type;                  
  typedef base_type::string_type                                                             string_type;               
  typedef string_type::const_iterator                                                        const_itr;                 
  typedef base_type::char_type                                                               char_type;                 
  typedef base_type::format_date_parser_type                                                 format_date_parser_type;   
  typedef base_type::period_parser_type                                                      period_parser_type;        
  typedef base_type::special_values_parser_type                                              special_values_parser_type;
  typedef base_type::date_gen_parser_type                                                    date_gen_parser_type;      
  typedef base_type::special_values_parser_type::match_results                               match_results;             
  // construct/copy/destruct
  explicit time_input_facet(const string_type &, ::size_t = 0);
  explicit time_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);
  explicit time_input_facet(::size_t = 0);
  // public member functions
  void time_duration_format(const char_type *const);
  virtual void set_iso_format();
  virtual void set_iso_extended_format();
  InItrT get(InItrT &, InItrT &, std::ios_base &, period_type &) const;
  InItrT get(InItrT &, InItrT &, std::ios_base &, time_duration_type &) const;
  InItrT get(InItrT &, InItrT &, std::ios_base &, time_type &) const;
  InItrT get_local_time(InItrT &, InItrT &, std::ios_base &, time_type &, 
                        string_type &) const;
  // protected member functions
  InItrT get(InItrT &, InItrT &, std::ios_base &, time_type &, string_type &, 
             bool) const;
  template<typename temporal_type> 
    InItrT check_special_value(InItrT &, InItrT &, temporal_type &, 
                               char_type = '\0') const;
  void parse_frac_type(InItrT &, InItrT &, fracional_seconds_type &) const;
  // private member functions
  template<typename int_type> 
    int_type decimal_adjust(int_type, const unsigned short) const;
  // public data members
  static const char_type * fractional_seconds_format;
  static const char_type * fractional_seconds_or_none_format;
  static const char_type * seconds_with_fractional_seconds_format;
  static const char_type * seconds_format;
  static const char_type * standard_format;
  static const char_type * zone_abbrev_format;
  static const char_type * zone_name_format;
  static const char_type * zone_iso_format;
  static const char_type * zone_iso_extended_format;
  static const char_type * duration_seperator;
  static const char_type * iso_time_format_specifier;
  static const char_type * iso_time_format_extended_specifier;
  static const char_type * default_time_input_format;
  static const char_type * default_time_duration_format;
  static std::locale::id id;
};

Description

time_input_facet public construct/copy/destruct

  1. <
    explicittime_input_facet(conststring_type&format,::size_tref_arg=0);
    >Конструктор, который принимает строку формата для ptime.
  2. <
    explicittime_input_facet(conststring_type&format,
                             constformat_date_parser_type&date_parser,
                             constspecial_values_parser_type&sv_parser,
                             constperiod_parser_type&per_parser,
                             constdate_gen_parser_type&date_gen_parser,
                             ::size_tref_arg=0);
    >
  3. <
    explicittime_input_facet(::size_tref_arg=0);
    >устанавливает форматы по умолчанию для ptime, local_date_time и<time_duration>

time_input_facet public member functions

  1. <
    voidtime_duration_format(constchar_type*constformat);
    >Установите формат для<time_duration>.
  2. <
    virtualvoidset_iso_format();
    >
  3. <
    virtualvoidset_iso_extended_format();
    >
  4. <
    InItrTget(InItrT&sitr,InItrT&stream_end,std::ios_base&ios_arg,
              period_type&p)const;
    >
  5. <
    InItrTget(InItrT&sitr,InItrT&stream_end,std::ios_base&ios_arg,
              time_duration_type&td)const;
    >
  6. <
    InItrTget(InItrT&sitr,InItrT&stream_end,std::ios_base&ios_arg,
              time_type&t)const;
    >Парсирует объект времени из входного потока.
  7. <
    InItrTget_local_time(InItrT&sitr,InItrT&stream_end,
                         std::ios_base&ios_arg,time_type&t,
                         string_type&tz_str)const;
    >Ожидает временной зоны во входном потоке.

time_input_facet protected member functions

  1. <
    InItrTget(InItrT&sitr,InItrT&stream_end,std::ios_base&ios_arg,
              time_type&t,string_type&tz_str,booltime_is_local)const;
    >
  2. <
    template<typenametemporal_type>
     InItrTcheck_special_value(InItrT&sitr,InItrT&stream_end,
                                temporal_type&tt,char_typec='\0')const;
    >Функция помощника для проверки специального_значения.

    Первый символ мог быть использован во время первоначальной попытки разбора. Параметр «с» должен быть копией этого символа. Скачать ios_base::failure if parse fails

  3. <
    voidparse_frac_type(InItrT&sitr,InItrT&stream_end,
                        fracional_seconds_type&frac)const;
    >Функция помощника для разбора дробного второго типа из потока.

time_input_facet private member functions

  1. <
    template<typenameint_type>
     int_typedecimal_adjust(int_typeval,constunsignedshortplaces)const;
    >Функция помощника для корректировки следовых нулей при разборе дробных цифр.

PrevUpHomeNext

Статья Class template time_input_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 09:40:46/0.0070359706878662/0