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

C++ std::ostream类代码示例

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

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



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

示例1: sintoxml

void sintoxml(std::ostream& s, const char* filename, sinparms& sp)
{
  std::ifstream f(filename);
  if (!f.is_open()) {
    throw std::runtime_error("Unable to open SIN file for XML conversion");
  }

  pugi::xml_document doc;
  pugi::xml_node root = doc.append_child();
  root.set_name("philips");

  std::string line;
  const size_t buffer_size = 4096;
  char buffer[buffer_size];
  while (!f.eof()) {
    f.getline(buffer,buffer_size);
    std::string line(buffer);
    std::stringstream s;
    uint16_t idx1, idx2, idx3;
    char tmp;
    std::string parameter_name;
    std::string parameter_value;
    if (line.find(':') != std::string::npos && isdigit(line[1])) {
	  boost::algorithm::trim_right(line);
	  s << line;
	  s >> idx1; s >> idx2; s >> idx3; s >> tmp;
      s >> parameter_name;
      
      pugi::xml_node parm = root.append_child(parameter_name.c_str());
      pugi::xml_attribute attr_idx1 = parm.append_attribute("idx1");
      attr_idx1.set_value(idx1);
      pugi::xml_attribute attr_idx2 = parm.append_attribute("idx2");
      attr_idx2.set_value(idx2);
      pugi::xml_attribute attr_idx3 = parm.append_attribute("idx3");
      attr_idx3.set_value(idx3);
      s >> tmp;

      bool get_nchan = false;
      float pda[2];
      bool get_pda = false;
      int pda_comp = 0;
      if (parameter_name == "enable_pda") {
	sp.ismira = false;
      } else if (parameter_name == "max_measured_channels") {
	get_nchan = true;
      } else if (parameter_name == "nr_measured_channels") {
	get_nchan = true;
      } else if (parameter_name == "pda_ampl_factors") {
	get_pda = true;
      }
      
      while (!s.eof()) {
	s >> parameter_value;

	if (get_nchan) {
	  sp.nchan = std::atoi(parameter_value.c_str());
	}

	if (get_pda) {
	  pda[pda_comp++] = std::atof(parameter_value.c_str());
      
	  if (pda_comp > 1) {
	    sp.pda_amp_factors.push_back(std::complex<float>(pda[0],pda[1]));
	    pda_comp = 0;
	  }
	}

	pugi::xml_node v = parm.append_child("value");
	v.append_child(pugi::node_pcdata).set_value(parameter_value.c_str());
      }
    }
  }
开发者ID:ismrmrd,项目名称:philips_to_ismrmrd,代码行数:72,代码来源:main.cpp


示例2: exportScore

int CsoundFile::exportScore(std::ostream &stream) const
{
  stream << score << std::endl;
  return stream.good();
}
开发者ID:hlolli,项目名称:csound,代码行数:5,代码来源:CsoundFile.cpp


示例3: format_impl

S32 LLSDXMLFormatter::format_impl(const LLSD& data, std::ostream& ostr, U32 options, U32 level) const
{
	S32 format_count = 1;
	std::string pre;
	std::string post;

	if (options & LLSDFormatter::OPTIONS_PRETTY)
	{
		for (U32 i = 0; i < level; i++)
		{
			pre += "    ";
		}
		post = "\n";
	}

	switch(data.type())
	{
	case LLSD::TypeMap:
		if (0 == data.size())
		{
			ostr << pre << "<map />" << post;
		}
		else
		{
			ostr << pre << "<map>" << post;
			LLSD::map_const_iterator iter = data.beginMap();
			LLSD::map_const_iterator end = data.endMap();
			for (; iter != end; ++iter)
			{
				ostr << pre << "<key>" << escapeString((*iter).first) << "</key>" << post;
				format_count += format_impl((*iter).second, ostr, options, level + 1);
			}
			ostr << pre <<  "</map>" << post;
		}
		break;

	case LLSD::TypeArray:
		if (0 == data.size())
		{
			ostr << pre << "<array />" << post;
		}
		else
		{
			ostr << pre << "<array>" << post;
			LLSD::array_const_iterator iter = data.beginArray();
			LLSD::array_const_iterator end = data.endArray();
			for(; iter != end; ++iter)
			{
				format_count += format_impl(*iter, ostr, options, level + 1);
			}
			ostr << pre << "</array>" << post;
		}
		break;

	case LLSD::TypeUndefined:
		ostr << pre << "<undef />" << post;
		break;

	case LLSD::TypeBoolean:
		ostr << pre << "<boolean>";
		if (mBoolAlpha || (ostr.flags() & std::ios::boolalpha))
		{
			ostr << (data.asBoolean() ? "true" : "false");
		}
		else
		{
			ostr << (data.asBoolean() ? 1 : 0);
		}
		ostr << "</boolean>" << post;
		break;

	case LLSD::TypeInteger:
		ostr << pre << "<integer>" << data.asInteger() << "</integer>" << post;
		break;

	case LLSD::TypeReal:
		ostr << pre << "<real>";
		if (mRealFormat.empty())
		{
			ostr << data.asReal();
		}
		else
		{
			formatReal(data.asReal(), ostr);
		}
		ostr << "</real>" << post;
		break;

	case LLSD::TypeUUID:
		if (data.asUUID().isNull())
		{
			ostr << pre << "<uuid />" << post;
		}
		else
		{
			ostr << pre << "<uuid>" << data.asUUID() << "</uuid>" << post;
		}
		break;

	case LLSD::TypeString:
//.........这里部分代码省略.........
开发者ID:OS-Development,项目名称:VW.Phoenix,代码行数:101,代码来源:llsdserialize_xml.cpp


示例4: saveToStream

void ChunkPillar::saveToStream(std::ostream& pillarData)
{
	// Save the heightmap
	pillarData.write(reinterpret_cast<char*>(heightMap.data()), heightMap.size() * sizeof(heightMap[0]));
}
开发者ID:1am3r,项目名称:cubicplanets,代码行数:5,代码来源:ChunkPillar.cpp


示例5: exportCommand

int CsoundFile::exportCommand(std::ostream &stream) const
{
  stream << command.c_str() << std::endl;
  return stream.good();
}
开发者ID:hlolli,项目名称:csound,代码行数:5,代码来源:CsoundFile.cpp


示例6: save

 void PeSectionHeader::save(std::ostream& os) const {
   os.write(reinterpret_cast<const char*>(&this->st), sizeof(this->st));
 }
开发者ID:Manouchehri,项目名称:Triton,代码行数:3,代码来源:peSectionHeader.cpp


示例7: write_uint16

void write_uint16(std::ostream& s, uint16_t x) {
  uint8_t buf[2];
  buf[0] = x;
  buf[1] = x >> 8;
  s.write(reinterpret_cast<char*>(buf), 2);
}
开发者ID:mbitsnbites,项目名称:libsac,代码行数:6,代码来源:file_io.cpp


示例8: install_separator

 void install_separator(std::ostream& o1, std::ostream& o2)
 {
     static custom_separator csep(o2);
     o1.rdbuf(&csep);
     o1.tie(&o2);
 }
开发者ID:CCJY,项目名称:coliru,代码行数:6,代码来源:main.cpp


示例9:

void VerifSuite_CppPrintfComp_1_t::print ( std::ostream& s ) {
#if __cplusplus >= 201103L
  if (T1.values[0]) dat_prints<104>(s, "display %h %h", T3, T2);
#endif
s.flush();
}
开发者ID:EqualInformation,项目名称:chisel,代码行数:6,代码来源:VerifSuite_CppPrintfComp_1.cpp


示例10: LogError

	void CLogger::LogError( std::ostream const & msg )
	{
		std::stringstream ss;
		ss << msg.rdbuf();
		LogError( ss.str() );
	}
开发者ID:DragonJoker,项目名称:DatabaseConnector,代码行数:6,代码来源:DatabaseLogger.cpp


示例11: write32

void write32(std::ostream &s, uint32 v) {
	uint32 t = swapEndianLong(v);
	s.write((char *)&t, 4);
}
开发者ID:JennaMalkin,项目名称:openc2e,代码行数:4,代码来源:streamutils.cpp


示例12: swrite

void swrite(std::ostream& s, std::string t) {
    int32_t len = (int32_t)t.size();
    swrite(s, len);
    s.write(t.c_str(), len);
    while (len++ % 4) s.put(0);
}
开发者ID:VTREEM,项目名称:IfcOpenShell,代码行数:6,代码来源:IfcGeomServer.cpp


示例13: writeRGBStream

        WriteResult writeRGBStream(const osg::Image& img, std::ostream &fout, const std::string& name) const
        {
            rawImageRec raw;
            raw.imagic = 0732;

            GLenum dataType = img.getDataType();

            raw.type  = dataType == GL_UNSIGNED_BYTE ? 1 :
                dataType == GL_BYTE ? 1 :
                dataType == GL_BITMAP ? 1 :
                dataType == GL_UNSIGNED_SHORT ? 2 :
                dataType == GL_SHORT ? 2 :
                dataType == GL_UNSIGNED_INT ? 4 :
                dataType == GL_INT ? 4 :
                dataType == GL_FLOAT ? 4 :
                dataType == GL_UNSIGNED_BYTE_3_3_2 ? 1 :
                dataType == GL_UNSIGNED_BYTE_2_3_3_REV ? 1 :
                dataType == GL_UNSIGNED_SHORT_5_6_5 ? 2 :
                dataType == GL_UNSIGNED_SHORT_5_6_5_REV ? 2 :
                dataType == GL_UNSIGNED_SHORT_4_4_4_4 ? 2 :
                dataType == GL_UNSIGNED_SHORT_4_4_4_4_REV ? 2 :
                dataType == GL_UNSIGNED_SHORT_5_5_5_1 ? 2 :
                dataType == GL_UNSIGNED_SHORT_1_5_5_5_REV ? 2 :
                dataType == GL_UNSIGNED_INT_8_8_8_8 ? 4 :
                dataType == GL_UNSIGNED_INT_8_8_8_8_REV ? 4 :
                dataType == GL_UNSIGNED_INT_10_10_10_2 ? 4 :
                dataType == GL_UNSIGNED_INT_2_10_10_10_REV ? 4 : 4;

            GLenum pixelFormat = img.getPixelFormat();

            raw.dim    = 3;
            raw.sizeX = img.s();
            raw.sizeY = img.t();
            raw.sizeZ =
                pixelFormat == GL_COLOR_INDEX? 1 :
                pixelFormat == GL_RED? 1 :
                pixelFormat == GL_GREEN? 1 :
                pixelFormat == GL_BLUE? 1 :
                pixelFormat == GL_ALPHA? 1 :
                pixelFormat == GL_RGB? 3 :
                pixelFormat == GL_BGR ? 3 :
                pixelFormat == GL_RGBA? 4 :
                pixelFormat == GL_BGRA? 4 :
                pixelFormat == GL_LUMINANCE? 1 :
                pixelFormat == GL_LUMINANCE_ALPHA ? 2 : 1;
            raw.min = 0;
            raw.max = 0xFF;
            raw.wasteBytes = 0;
            strncpy( raw.name, name.c_str(), 80);
            raw.colorMap = 0;
            raw.bpc = (img.getPixelSizeInBits()/raw.sizeZ)/8;

            int isize = img.getImageSizeInBytes();
            unsigned char *buffer = new unsigned char[isize];
            if(raw.bpc == 1)
            {
                unsigned char *dptr = buffer;
                int i, j;
                for( i = 0; i < raw.sizeZ; ++i )
                {
                    const unsigned char *ptr = img.data();
                    ptr += i;
                    for( j = 0; j < isize/raw.sizeZ; ++j )
                    {
                        *(dptr++) = *ptr;
                        ptr += raw.sizeZ;
                    }
                }
            }
            else
            { // bpc == 2
                unsigned short *dptr = reinterpret_cast<unsigned short*>(buffer);
                int i, j;
                for( i = 0; i < raw.sizeZ; ++i )
                {
                    const unsigned short *ptr = reinterpret_cast<const unsigned short*>(img.data());
                    ptr += i;
                    for( j = 0; j < isize/(raw.sizeZ*2); ++j )
                    {
                        *dptr = *ptr;
                        ConvertShort(dptr++, 1);
                        ptr += raw.sizeZ;
                    }
                }
            }


            if( raw.needsBytesSwapped() )
                raw.swapBytes();

            /*
            swapBytes( raw.imagic );
            swapBytes( raw.type );
            swapBytes( raw.dim );
            swapBytes( raw.sizeX );
            swapBytes( raw.sizeY );
            swapBytes( raw.sizeZ );
            swapBytes( raw.min );
            swapBytes( raw.max );
            swapBytes( raw.colorMap );
//.........这里部分代码省略.........
开发者ID:yueying,项目名称:osg,代码行数:101,代码来源:ReaderWriterRGB.cpp


示例14: serialize

	ErrorStatus serialize(std::ostream &dst) const {
		uint16_t tmp16;

		dst.write(reinterpret_cast<const char *>(&_clientIP),
				  sizeof(_clientIP));
		if (!dst) {
			return E_FSTREAM;
		}
		dst.write(reinterpret_cast<const char *>(&_serverIP),
				  sizeof(_serverIP));
		if (!dst) {
			return E_FSTREAM;
		}
		dst.write(reinterpret_cast<const char *>(&_queryTime),
				  sizeof(_queryTime));
		if (!dst) {
			return E_FSTREAM;
		}
		dst.write(reinterpret_cast<const char *>(&_responseTime),
				  sizeof(_responseTime));
		if (!dst) {
			return E_FSTREAM;
		}
		dst.write(reinterpret_cast<const char *>(&_queryFlags),
				  sizeof(_queryFlags));
		if (!dst) {
			return E_FSTREAM;
		}
		dst.write(reinterpret_cast<const char *>(&_responseFlags),
				  sizeof(_responseFlags));
		if (!dst) {
			return E_FSTREAM;
		}
		dst.put(boost::numeric_cast<uint8_t>(_queryName.length()));
		if (!dst) {
			return E_FSTREAM;
		}
		dst.write(_queryName.data(), _queryName.length());
		if (!dst) {
			return E_FSTREAM;
		}
		dst.write(reinterpret_cast<const char *>(&_queryType),
				  sizeof(_queryType));
		if (!dst) {
			return E_FSTREAM;
		}
		tmp16 = boost::numeric_cast<uint16_t>(_responses.size());
		dst.write(reinterpret_cast<const char *>(&tmp16),
				  sizeof(tmp16));
		if (!dst) {
			return E_FSTREAM;
		}
		for (std::vector<DNSResponse*>::const_iterator it(_responses.begin());
			 it != _responses.end();
			 ++it)
		{
			dst.put(boost::numeric_cast<uint8_t>((*it)->name().length()));
			if (!dst) {
				return E_FSTREAM;
			}
			dst.write((*it)->name().data(), (*it)->name().length());
			if (!dst) {
				return E_FSTREAM;
			}
			tmp16 = (*it)->rawType();
			dst.write(reinterpret_cast<const char *>(&tmp16),
					  sizeof(tmp16));
			if (!dst) {
				return E_FSTREAM;
			}
			tmp16 = boost::numeric_cast<uint16_t>((*it)->resourceData().length());
			dst.write(reinterpret_cast<const char *>(&tmp16), sizeof(tmp16));
			if (!dst) {
				return E_FSTREAM;
			}
			dst.write((*it)->resourceData().data(), (*it)->resourceData().length());
			if (!dst) {
				return E_FSTREAM;
			}
		}

		return E_SUCCESS;
	}
开发者ID:derrick0714,项目名称:infer,代码行数:83,代码来源:DNS.hpp


示例15: finest_level

void
BoxLib::WriteGenericPlotfileHeader (std::ostream &HeaderFile,
                                    int nlevels,
				    const Array<BoxArray> &bArray,
				    const Array<std::string> &varnames,
				    const Array<Geometry> &geom,
				    Real time,
				    const Array<int> &level_steps,
				    const Array<IntVect> &ref_ratio,
				    const std::string &versionName,
				    const std::string &levelPrefix,
				    const std::string &mfPrefix)
{
        BL_PROFILE("WriteGenericPlotfileHeader()");

        BL_ASSERT(nlevels <= bArray.size());
        BL_ASSERT(nlevels <= geom.size());
        BL_ASSERT(nlevels <= ref_ratio.size()+1);
        BL_ASSERT(nlevels <= level_steps.size());

        int finest_level(nlevels - 1);

	HeaderFile.precision(17);

	VisMF::IO_Buffer io_buffer(VisMF::IO_Buffer_Size);
	HeaderFile.rdbuf()->pubsetbuf(io_buffer.dataPtr(), io_buffer.size());

	// ---- this is the generic plot file type name
        HeaderFile << versionName << '\n';

        HeaderFile << varnames.size() << '\n';

        for (int ivar = 0; ivar < varnames.size(); ++ivar) {
	    HeaderFile << varnames[ivar] << "\n";
        }
        HeaderFile << BL_SPACEDIM << '\n';
        HeaderFile << time << '\n';
        HeaderFile << finest_level << '\n';
        for (int i = 0; i < BL_SPACEDIM; ++i) {
            HeaderFile << Geometry::ProbLo(i) << ' ';
	}
        HeaderFile << '\n';
        for (int i = 0; i < BL_SPACEDIM; ++i) {
            HeaderFile << Geometry::ProbHi(i) << ' ';
	}
        HeaderFile << '\n';
        for (int i = 0; i < finest_level; ++i) {
            HeaderFile << ref_ratio[i][0] << ' ';
	}
        HeaderFile << '\n';
	for (int i = 0; i <= finest_level; ++i) {
	    HeaderFile << geom[i].Domain() << ' ';
	}
        HeaderFile << '\n';
        for (int i = 0; i <= finest_level; ++i) {
            HeaderFile << level_steps[i] << ' ';
	}
        HeaderFile << '\n';
        for (int i = 0; i <= finest_level; ++i) {
            for (int k = 0; k < BL_SPACEDIM; ++k) {
                HeaderFile << geom[i].CellSize()[k] << ' ';
	    }
            HeaderFile << '\n';
        }
        HeaderFile << (int) Geometry::Coord() << '\n';
        HeaderFile << "0\n";

	for (int level = 0; level <= finest_level; ++level) {
	    HeaderFile << level << ' ' << bArray[level].size() << ' ' << time << '\n';
	    HeaderFile << level_steps[level] << '\n';
	    
	    for (int i = 0; i < bArray[level].size(); ++i)
	    {
		const Box &b(bArray[level][i]);
		RealBox loc = RealBox(b, geom[level].CellSize(), geom[level].ProbLo());
		for (int n = 0; n < BL_SPACEDIM; ++n) {
		    HeaderFile << loc.lo(n) << ' ' << loc.hi(n) << '\n';
		}
	    }

	    HeaderFile << MultiFabHeaderPath(level, levelPrefix, mfPrefix) << '\n';
	}
}
开发者ID:BoxLib-Codes,项目名称:BoxLib,代码行数:83,代码来源:PlotFileUtil.cpp


示例16: printSummary

/**
 * Print the summary of the move.
 *
 * The summary just contains the current value of the tuning parameter.
 * It is printed to the stream that it passed in.
 *
 * \param[in]     o     The stream to which we print the summary.
 */
void MetropolisHastingsMove::printSummary(std::ostream &o) const
{
    std::streamsize previousPrecision = o.precision();
    std::ios_base::fmtflags previousFlags = o.flags();

    o << std::fixed;
    o << std::setprecision(4);

    // print the name
    const std::string &n = getMoveName();
    size_t spaces = 40 - (n.length() > 40 ? 40 : n.length());
    o << n;
    for (size_t i = 0; i < spaces; ++i)
    {
        o << " ";
    }
    o << " ";

    // print the DagNode name
    const std::string &dn_name = (*nodes.begin())->getName();
    spaces = 20 - (dn_name.length() > 20 ? 20 : dn_name.length());
    o << dn_name;
    for (size_t i = 0; i < spaces; ++i)
    {
        o << " ";
    }
    o << " ";

    // print the weight
    int w_length = 4 - (int)log10(weight);
    for (int i = 0; i < w_length; ++i)
    {
        o << " ";
    }
    o << weight;
    o << " ";

    // print the number of tries
    int t_length = 9 - (int)log10(numTried);
    for (int i = 0; i < t_length; ++i)
    {
        o << " ";
    }
    o << numTried;
    o << " ";

    // print the number of accepted
    int a_length = 9;
    if (numAccepted > 0) a_length -= (int)log10(numAccepted);

    for (int i = 0; i < a_length; ++i)
    {
        o << " ";
    }
    o << numAccepted;
    o << " ";

    // print the acceptance ratio
    double ratio = numAccepted / (double)numTried;
    if (numTried == 0) ratio = 0;
    int r_length = 5;

    for (int i = 0; i < r_length; ++i)
    {
        o << " ";
    }
    o << ratio;
    o << " ";

    proposal->printParameterSummary( o );

    o << std::endl;

    o.setf(previousFlags);
    o.precision(previousPrecision);


}
开发者ID:wrightaprilm,项目名称:revbayes,代码行数:86,代码来源:MetropolisHastingsMove.cpp


示例17: finish

 void finish(std::ostream& out)
 {
     out.flush();
 }
开发者ID:fen,项目名称:specpp,代码行数:4,代码来源:compiler.hpp


示例18: decompressZlib

void decompressZlib(std::istream &is, std::ostream &os)
{
	z_stream z;
	const s32 bufsize = 16384;
	char input_buffer[bufsize];
	char output_buffer[bufsize];
	int status = 0;
	int ret;
	int bytes_read = 0;
	int input_buffer_len = 0;

	z.zalloc = Z_NULL;
	z.zfree = Z_NULL;
	z.opaque = Z_NULL;

	ret = inflateInit(&z);
	if(ret != Z_OK)
		throw SerializationError("dcompressZlib: inflateInit failed");
	
	z.avail_in = 0;
	
	//dstream<<"initial fail="<<is.fail()<<" bad="<<is.bad()<<std::endl;

	for(;;)
	{
		z.next_out = (Bytef*)output_buffer;
		z.avail_out = bufsize;

		if(z.avail_in == 0)
		{
			z.next_in = (Bytef*)input_buffer;
			input_buffer_len = is.readsome(input_buffer, bufsize);
			z.avail_in = input_buffer_len;
			//dstream<<"read fail="<<is.fail()<<" bad="<<is.bad()<<std::endl;
		}
		if(z.avail_in == 0)
		{
			//dstream<<"z.avail_in == 0"<<std::endl;
			break;
		}
			
		//dstream<<"1 z.avail_in="<<z.avail_in<<std::endl;
		status = inflate(&z, Z_NO_FLUSH);
		//dstream<<"2 z.avail_in="<<z.avail_in<<std::endl;
		bytes_read += is.gcount() - z.avail_in;
		//dstream<<"bytes_read="<<bytes_read<<std::endl;

		if(status == Z_NEED_DICT || status == Z_DATA_ERROR
				|| status == Z_MEM_ERROR)
		{
			zerr(status);
			throw SerializationError("decompressZlib: inflate failed");
		}
		int count = bufsize - z.avail_out;
		//dstream<<"count="<<count<<std::endl;
		if(count)
			os.write(output_buffer, count);
		if(status == Z_STREAM_END)
		{
			//dstream<<"Z_STREAM_END"<<std::endl;
			
			//dstream<<"z.avail_in="<<z.avail_in<<std::endl;
			//dstream<<"fail="<<is.fail()<<" bad="<<is.bad()<<std::endl;
			// Unget all the data that inflate didn't take
			for(u32 i=0; i < z.avail_in; i++)
			{
				is.unget();
				if(is.fail() || is.bad())
				{
					dstream<<"unget #"<<i<<" failed"<<std::endl;
					dstream<<"fail="<<is.fail()<<" bad="<<is.bad()<<std::endl;
					throw SerializationError("decompressZlib: unget failed");
				}
			}
			
			break;
		}
	}

	inflateEnd(&z);
}
开发者ID:1CoreyDev1,项目名称:minetest,代码行数:81,代码来源:serialization.cpp


示例19: writeToStream

void Gaussian::writeToStream(std::ostream& o) const{
  o.precision(3);
  o << "{" << "Gaussian:" << " " << "mu = " << mu << " sigma = " << sigma << " " << "}";
}
开发者ID:bfisch02,项目名称:csax_cpp,代码行数:4,代码来源:errormodel.cpp


示例20: is_colorized

 // Say whether a given stream should be colorized or not. It's always
 // true for ATTY streams and may be true for streams marked with
 // colorize flag.
 inline
 bool is_colorized(std::ostream& stream)
 {
     return is_atty(stream) || static_cast<bool>(stream.iword(colorize_index));
 }
开发者ID:ikalnitsky,项目名称:termcolor,代码行数:8,代码来源:termcolor.hpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ std::ostringstream类代码示例发布时间:2022-05-31
下一篇:
C++ std::priority_queue类代码示例发布时间: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