当前位置: 首页>>代码示例>>C++>>正文


C++ basic_ostream::good方法代码示例

本文整理汇总了C++中std::basic_ostream::good方法的典型用法代码示例。如果您正苦于以下问题:C++ basic_ostream::good方法的具体用法?C++ basic_ostream::good怎么用?C++ basic_ostream::good使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在std::basic_ostream的用法示例。


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

示例1: insert_fill_chars

 inline void insert_fill_chars(std::basic_ostream<charT, traits>& os, std::size_t n) {
     enum { chunk_size = 8 };
     charT fill_chars[chunk_size];
     std::fill_n(fill_chars, static_cast< std::size_t >(chunk_size), os.fill());
     for (; n >= chunk_size && os.good(); n -= chunk_size)
         os.write(fill_chars, static_cast< std::size_t >(chunk_size));
     if (n > 0 && os.good())
         os.write(fill_chars, n);
     }
开发者ID:imos,项目名称:icfpc2015,代码行数:9,代码来源:string_ref.hpp

示例2: insert_aligned

 void insert_aligned(std::basic_ostream<charT, traits>& os, const basic_string_ref<charT,traits>& str) {
     const std::size_t size = str.size();
     const std::size_t alignment_size = static_cast< std::size_t >(os.width()) - size;
     const bool align_left = (os.flags() & std::basic_ostream<charT, traits>::adjustfield) == std::basic_ostream<charT, traits>::left;
     if (!align_left) {
         detail::insert_fill_chars(os, alignment_size);
         if (os.good())
             os.write(str.data(), size);
         }
     else {
         os.write(str.data(), size);
         if (os.good())
             detail::insert_fill_chars(os, alignment_size);
         }
     }
开发者ID:imos,项目名称:icfpc2015,代码行数:15,代码来源:string_ref.hpp

示例3: write_info_internal

 void write_info_internal(std::basic_ostream<typename Ptree::char_type> &stream, 
                          const Ptree &pt,
                          const std::string &filename)
 {
     write_info_helper(stream, pt, -1);
     if (!stream.good())
         throw info_parser_error("write error", filename, 0);
 }
开发者ID:craton-,项目名称:php_mapnik,代码行数:8,代码来源:info_parser_write.hpp

示例4: write_info_internal

 void write_info_internal(std::basic_ostream<typename Ptree::key_type::value_type> &stream, 
                          const Ptree &pt,
                          const std::string &filename,
                          const info_writer_settings<typename Ptree::key_type::value_type> &settings)
 {
     write_info_helper(stream, pt, -1, settings);
     if (!stream.good())
         BOOST_PROPERTY_TREE_THROW(info_parser_error("write error", filename, 0));
 }
开发者ID:ALuehmann,项目名称:labstreaminglayer,代码行数:9,代码来源:info_parser_write.hpp

示例5: write_json_internal

 void write_json_internal(std::basic_ostream<typename Ptree::char_type> &stream, 
                          const Ptree &pt,
                          const std::string &filename)
 {
     if (!verify_json(pt, 0))
         throw json_parser_error("ptree contains data that cannot be represented in JSON format", filename, 0);
     write_json_helper(stream, pt, 0);
     stream << std::endl;
     if (!stream.good())
         throw json_parser_error("write error", filename, 0);
 }
开发者ID:craton-,项目名称:php_mapnik,代码行数:11,代码来源:json_parser_write.hpp

示例6: write_json_internal

 void write_json_internal(std::basic_ostream<typename Ptree::key_type::value_type> &stream, 
                          const Ptree &pt,
                          const std::string &filename,
                          bool pretty)
 {
     if (!verify_json(pt, 0))
         BOOST_PROPERTY_TREE_THROW(json_parser_error("ptree contains data that cannot be represented in JSON format", filename, 0));
     write_json_helper(stream, pt, 0, pretty);
     stream << std::endl;
     if (!stream.good())
         BOOST_PROPERTY_TREE_THROW(json_parser_error("write error", filename, 0));
 }
开发者ID:Chang-Liu-0520,项目名称:dealii,代码行数:12,代码来源:json_parser_write.hpp


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