• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ facet_type类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中facet_type的典型用法代码示例。如果您正苦于以下问题:C++ facet_type类的具体用法?C++ facet_type怎么用?C++ facet_type使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了facet_type类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: put_nth_kday

 OutItrT put_nth_kday(OutItrT next, std::ios_base& a_ios,
                      CharT a_fill, const nth_kday_type& nkd,
                      const facet_type& facet) const
 {
   put_string(next, phrase_strings[nkd.nth_week() -1]);
   next = a_fill; //TODO change this ???
   facet.put(next, a_ios, a_fill, nkd.day_of_week());
   next = a_fill; //TODO change this ???
   put_string(next, string_type(of_string));
   next = a_fill; //TODO change this ???
   facet.put(next, a_ios, a_fill, nkd.month());
   return next;
 }
开发者ID:CRF,项目名称:passenger,代码行数:13,代码来源:date_generator_formatter.hpp


示例2: get_nth_kday_type

    nth_kday_type
    get_nth_kday_type(stream_itr_type& sitr,
                      stream_itr_type& stream_end,
                      std::ios_base& a_ios,
                      const facet_type& facet) const
    {
        // skip leading whitespace
        while(std::isspace(*sitr) && sitr != stream_end) {
            ++sitr;
        }

        typename nth_kday_type::week_num wn;
        day_of_week_type wd(0); // no default constructor
        month_type m(1);        // no default constructor

        match_results mr = m_element_strings.match(sitr, stream_end);
        switch(mr.current_match) {
        case first  : {
            wn = nth_kday_type::first;
            break;
        }
        case second : {
            wn = nth_kday_type::second;
            break;
        }
        case third  : {
            wn = nth_kday_type::third;
            break;
        }
        case fourth : {
            wn = nth_kday_type::fourth;
            break;
        }
        case fifth  : {
            wn = nth_kday_type::fifth;
            break;
        }
        default:
        {
            boost::throw_exception(std::ios_base::failure("Parse failed. No match found for '" + mr.cache + "'"));
            BOOST_DATE_TIME_UNREACHABLE_EXPRESSION(wn = nth_kday_type::first);
        }
        }                                         // week num
        facet.get(sitr, stream_end, a_ios, wd);   // day_of_week
        extract_element(sitr, stream_end, of);    // "of" element
        facet.get(sitr, stream_end, a_ios, m);    // month

        return nth_kday_type(wn, wd, m);
    }
开发者ID:SokolovaCo,项目名称:Alfa-stock,代码行数:49,代码来源:date_generator_parser.hpp


示例3: format_weekday

    //! Formats a month as as string into an output iterator
    static void format_weekday(const weekday_type& wd,
                               ostream_type& os,
                               const facet_type& f,
                               bool  as_long_string)
    {

      std::ostreambuf_iterator<charT> oitr(os);
      if (as_long_string) {
        f.put_weekday_long(oitr, wd.as_enum());
      }
      else {
        f.put_weekday_short(oitr, wd.as_enum());
      }

    } // format_weekday
开发者ID:BalticPinguin,项目名称:libmesh,代码行数:16,代码来源:date_formatting_locales.hpp


示例4: put_period

 OutItrT put_period(OutItrT next,
                    std::ios_base& a_ios,
                    char_type a_fill,
                    const period_type& p,
                    const facet_type& facet) const {
     put_period_start_delimeter(next);
     next = facet.put(next, a_ios, a_fill, p.begin());
     put_period_separator(next);
     if (m_range_option == AS_CLOSED_RANGE) {
         facet.put(next, a_ios, a_fill, p.last());
     }
     else {
         facet.put(next, a_ios, a_fill, p.end());
     }
     put_period_end_delimeter(next);
     return next;
 }
开发者ID:ChineseDr,项目名称:mongo,代码行数:17,代码来源:period_formatter.hpp


示例5: put_kday_after

 OutItrT put_kday_after(OutItrT next, std::ios_base& a_ios,
                        CharT a_fill, const kday_after_type& fka,
                        const facet_type& facet) const
 {
   facet.put(next, a_ios, a_fill, fka.day_of_week());
   next = a_fill; //TODO change this ???
   put_string(next, phrase_strings[after]);
   return next;
 }
开发者ID:GDXN,项目名称:fitsliberator,代码行数:9,代码来源:date_generator_formatter.hpp


示例6: get_last_kday_type

    last_kday_type
    get_last_kday_type(stream_itr_type& sitr,
                       stream_itr_type& stream_end,
                       std::ios_base& a_ios,
                       const facet_type& facet) const
    {
      // skip leading whitespace
      while(std::isspace(*sitr) && sitr != stream_end) { ++sitr; }

      day_of_week_type wd(0); // no default constructor
      month_type m(1);        // no default constructor
 
      extract_element(sitr, stream_end, last); // "last" element
      facet.get(sitr, stream_end, a_ios, wd);  // day_of_week
      extract_element(sitr, stream_end, of);   // "of" element
      facet.get(sitr, stream_end, a_ios, m);   // month


      return last_kday_type(wd, m);
    }
开发者ID:00liujj,项目名称:dealii,代码行数:20,代码来源:date_generator_parser.hpp


示例7: date_put

 //! Put date into an ostream
 static void date_put(const date_type& d,
                      ostream_type& os,
                      const facet_type& f)
 {
   special_values sv = d.as_special();
   if (sv == not_special) {
     ymd_type ymd = d.year_month_day();
     ostream_ymd_formatter<ymd_type, facet_type, charT>::ymd_put(ymd, os, f);
   }
   else { // output a special value
     std::ostreambuf_iterator<charT> coi(os);
     f.put_special_value(coi, sv);
   }
 }
开发者ID:BalticPinguin,项目名称:libmesh,代码行数:15,代码来源:date_formatting_locales.hpp


示例8: get_kday_after_type

    kday_after_type
    get_kday_after_type(stream_itr_type& sitr,
                        stream_itr_type& stream_end,
                        std::ios_base& a_ios,
                        const facet_type& facet) const
    {
      // skip leading whitespace
      while(std::isspace(*sitr) && sitr != stream_end) { ++sitr; }

      day_of_week_type wd(0); // no default constructor

      facet.get(sitr, stream_end, a_ios, wd);   // day_of_week
      extract_element(sitr, stream_end, after); // "after" element

      return kday_after_type(wd);
    }
开发者ID:00liujj,项目名称:dealii,代码行数:16,代码来源:date_generator_parser.hpp


示例9: get_partial_date_type

    partial_date_type
    get_partial_date_type(stream_itr_type& sitr,
                          stream_itr_type& stream_end,
                          std::ios_base& a_ios,
                          const facet_type& facet) const
    {
      // skip leading whitespace
      while(std::isspace(*sitr) && sitr != stream_end) { ++sitr; }

      day_type d(1);
      month_type m(1);
      facet.get(sitr, stream_end, a_ios, d);
      facet.get(sitr, stream_end, a_ios, m);

      return partial_date_type(d,m);
    }
开发者ID:00liujj,项目名称:dealii,代码行数:16,代码来源:date_generator_parser.hpp


示例10: ymd_put

 // Put ymd to ostream -- part of ostream refactor
 static void ymd_put(ymd_type ymd,
                     ostream_type& os,
                     const facet_type& f)
 {
   std::ostreambuf_iterator<charT> oitr(os);
   charT fill_char = '0';
   switch (f.date_order()) {
     case ymd_order_iso: {
       os << ymd.year;
       if (f.has_date_sep_chars()) {
         f.month_sep_char(oitr);
       }
       month_formatter_type::format_month(ymd.month, os, f);
       if (f.has_date_sep_chars()) {
         f.day_sep_char(oitr);
       }
       os  << std::setw(2) << std::setfill(fill_char)
           << ymd.day;
       break;
     }
     case ymd_order_us: {
       month_formatter_type::format_month(ymd.month, os, f);
       if (f.has_date_sep_chars()) {
       f.day_sep_char(oitr);
       }
       os  << std::setw(2) << std::setfill(fill_char)
         << ymd.day;
       if (f.has_date_sep_chars()) {
         f.month_sep_char(oitr);
       }
       os << ymd.year;
       break;
     }
     case ymd_order_dmy: {
       os  << std::setw(2) << std::setfill(fill_char)
           << ymd.day;
       if (f.has_date_sep_chars()) {
         f.day_sep_char(oitr);
       }
       month_formatter_type::format_month(ymd.month, os, f);
       if (f.has_date_sep_chars()) {
         f.month_sep_char(oitr);
       }
       os << ymd.year;
       break;
     }
   }
 }
开发者ID:BalticPinguin,项目名称:libmesh,代码行数:49,代码来源:date_formatting_locales.hpp



注:本文中的facet_type类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ fbstring类代码示例发布时间:2022-05-31
下一篇:
C++ face类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap