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

C++ outstream函数代码示例

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

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



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

示例1: Step3_Convert

void Step3_Convert(const TString filename)
{
    TFile* file = new TFile(filename, "READ");

    std::vector<TString> hists;
    // No bracket enclosed initializer list in root 5
    hists.push_back("NeulandDigiMon/hDepth");
    hists.push_back("NeulandDigiMon/hForemostEnergy");
    hists.push_back("NeulandDigiMon/hEtot");

    //for (const TString& hist : hists)
    for(Int_t i = 0; i < hists.size(); i++)
    {
        const TString hist = hists.at(i);
        std::cout << hist << std::endl;
        TH1D* h = (TH1D*)file->GetObjectChecked(hist, "TH1D");

        const TString outfile = (TString(filename).ReplaceAll("digi.root", TString(hist).ReplaceAll("NeulandDigiMon/", "") + ".dat"));
        ofstream outstream(outfile);

        SingleExportAscii(h, outstream);

        outstream.close();
    }
}
开发者ID:jose-luis-rs,项目名称:R3BRoot,代码行数:25,代码来源:Step3_Convert.C


示例2: FreeImage_SetOutputMessage

    //---------------------------------------------------------------------
    DataStreamPtr FreeImageCodec::code(MemoryDataStreamPtr& input, Codec::CodecDataPtr& pData) const
    {        
		// Set error handler
		FreeImage_SetOutputMessage(FreeImageSaveErrorHandler);

		FIBITMAP* fiBitmap = encode(input, pData);

		// open memory chunk allocated by FreeImage
		FIMEMORY* mem = FreeImage_OpenMemory();
		// write data into memory
		FreeImage_SaveToMemory((FREE_IMAGE_FORMAT)mFreeImageType, fiBitmap, mem);
		// Grab data information
		BYTE* data;
		DWORD size;
		FreeImage_AcquireMemory(mem, &data, &size);
		// Copy data into our own buffer
		// Because we're asking MemoryDataStream to free this, must create in a compatible way
		BYTE* ourData = OGRE_ALLOC_T(BYTE, size, MEMCATEGORY_GENERAL);
		memcpy(ourData, data, size);
		// Wrap data in stream, tell it to free on close 
		DataStreamPtr outstream(OGRE_NEW MemoryDataStream(ourData, size, true));
		// Now free FreeImage memory buffers
		FreeImage_CloseMemory(mem);
		// Unload bitmap
		FreeImage_Unload(fiBitmap);

		return outstream;


    }
开发者ID:akadjoker,项目名称:gmogre3d,代码行数:31,代码来源:OgreFreeImageCodec.cpp


示例3: outstream

void JRoomModelClientRoomProcessor::requestRoomList()
{
    QByteArray outdata;
    QDataStream outstream(&outdata,QIODevice::WriteOnly);
    outstream<<(JID)ERP_RoomList;
    sendData(JRoomModelClientSocket::instance(),outdata);
}
开发者ID:lexdene,项目名称:roommodel,代码行数:7,代码来源:jroommodelclientroomprocessor.cpp


示例4: run_sapi_textless_lipsync

/**
@brief This function demonstrates how to perform "Textless Lipsync"

Given an audio file, this method will use SAPI to guess at words
and word timings and phoneme timings in the specified audio file. 
The results are printed to std::out.

This is the best code to look at first

@param strAudioFile - [in] audio file
**/
void
run_sapi_textless_lipsync(std::wstring& strAudioFile, std::wstring outFile)
{
	// 1. [optional] declare the SAPI 5.1 estimator. 
	// NOTE: for different phoneme sets: create a new estimator
	phoneme_estimator sapi51Estimator;

	// 2. declare the sapi lipsync object and call the lipsync method to
	// start the lipsync process
	sapi_textless_lipsync lsp(&sapi51Estimator);
	if (lsp.lipsync(strAudioFile))
    {
		// 3. Run the message loop and wait till the lipsync is finished
        run_lipsync_message_loop(lsp);
		
		// 4. finalize the lipsync results for printing
		// this call will estimate phoneme timings 
		lsp.finalize_phoneme_alignment();

		// 5. print the results to the output stream
		//lsp.print_results(std::cout);
		
		// 5'. print results in a file
		std::wstring strOutFile = outFile + L".phonemes.xml";
		std::ofstream outstream(strOutFile.c_str());
		outstream << "<PhonemeTimings audiofile=\"" << wstring_2_string(strAudioFile) << "\" >" << std::endl;
		lsp.print_results(outstream);
		outstream << "</PhonemeTimings>" << std::endl;
		outstream.close();            
	}
	else
	{
		std::wcerr << lsp.getErrorString() << std::endl;
	}
}
开发者ID:xianyinchen,项目名称:Horde3DGameEngine,代码行数:46,代码来源:sapi_lipsync_main.cpp


示例5: encode

    //---------------------------------------------------------------------
    DataStreamPtr FreeImageCodec::code(MemoryDataStreamPtr& input, Codec::CodecDataPtr& pData) const
    {        
		FIBITMAP* fiBitmap = encode(input, pData);

		// open memory chunk allocated by FreeImage
		FIMEMORY* mem = FreeImage_OpenMemory();
		// write data into memory
		FreeImage_SaveToMemory((FREE_IMAGE_FORMAT)mFreeImageType, fiBitmap, mem);
		// Grab data information
		BYTE* data;
		DWORD size;
		FreeImage_AcquireMemory(mem, &data, &size);
		// Copy data into our own buffer
		BYTE* ourData = new BYTE[size];
		memcpy(ourData, data, size);
		// Wrap data in stream, tell it to free on close 
		DataStreamPtr outstream(new MemoryDataStream(ourData, size, true));
		// Now free FreeImage memory buffers
		FreeImage_CloseMemory(mem);
		// Unload bitmap
		FreeImage_Unload(fiBitmap);

		return outstream;


    }
开发者ID:andyhebear,项目名称:likeleon,代码行数:27,代码来源:OgreFreeImageCodec.cpp


示例6: outstream

void JRequestGameInfoSocket::rqsGameList()
{
    QByteArray outdata;
    QDataStream outstream(&outdata,QIODevice::WriteOnly);
	outstream<<(JID)SubServer::EGP_GameList;
    sendData(outdata);
}
开发者ID:stareven,项目名称:Dlut-Game-Platform,代码行数:7,代码来源:jrequestgameinfosocket.cpp


示例7: outstream

bool WebGame::Utility::writeToFile(const Utility::StringGroupType& infos,
    const std::string& file_name,
    const std::string&
#ifdef WIN32

     locinfo
#endif
     ) {
#ifdef WIN32
  std::locale loc = std::locale::global(std::locale(locinfo.c_str())) ;
#endif
  std::ofstream outstream(file_name.c_str(), std::ios_base::out |
      std::ios_base::trunc) ;
  if(!outstream.is_open()) {
#ifdef WIN32
    std::locale::global(loc) ;
#endif
    return false ;
  }
  bool ok = writeToFile(infos, outstream) ;
#ifdef WIN32
  std::locale::global(loc) ;
#endif
  return ok ;
}
开发者ID:fndisme,项目名称:wb,代码行数:25,代码来源:WriteToFile.cpp


示例8: outstream

/*!
	\brief 发送游戏信息
	
	\a gi 表示游戏信息。
	
	\sa SubServer::SGameInfo2
*/
void JSendGsInfoSocket::sendGameInfo(const SubServer::SGameInfo2& gi)
{
	QByteArray outdata;
	QDataStream outstream(&outdata,QIODevice::WriteOnly);
	outstream<<(JID)SubServer::ESP_GameInfo;
	outstream<<gi;
	sendData(outdata);
}
开发者ID:stareven,项目名称:Dlut-Game-Platform,代码行数:15,代码来源:jsendgsinfosocket.cpp


示例9: outstream

void JMainServerCommandProcessor::replyCommandResult(JID type,JCode result)
{
	QByteArray outdata;
	QDataStream outstream(&outdata,QIODevice::WriteOnly);
	outstream<<type;
	outstream<<result;
	sendData(outdata);
}
开发者ID:kubuntu,项目名称:Dlut-Game-Platform,代码行数:8,代码来源:jmainservercommandprocessor.cpp


示例10: outstream

void JDownloadGameFileSocket::rqsGameFile(const QString& gamename,const JVersion& version,const QString& path)
{
	m_path=path;
	QByteArray outdata;
	QDataStream outstream(&outdata,QIODevice::WriteOnly);
	outstream<<gamename<<version;
	sendData(outdata);
}
开发者ID:stareven,项目名称:Dlut-Game-Platform,代码行数:8,代码来源:jdownloadgamefilesocket.cpp


示例11: storeRegionInfo

    void storeRegionInfo(const QVector<ExonData>& exons)
    {
		QSharedPointer<QFile> out = Helper::openFileForWriting("regions.tsv");
        QTextStream outstream(out.data());
        outstream << "#region\tsize\tmedian_ncov\tmad_ncov\tcv_ncov\tcnvs" << endl;
        foreach(const ExonData& exon, exons)
        {
            outstream << exon.name << "\t" << (exon.end-exon.start) << "\t" << exon.median << "\t" << exon.mad  << "\t" << (exon.mad/exon.median) << "\t" << exon.cnvs << endl;
        }
    }
开发者ID:mdozmorov,项目名称:ngs-bits,代码行数:10,代码来源:main.cpp


示例12: storeSampleCorrel

    void storeSampleCorrel(const QVector<SampleData>& data)
    {
		QSharedPointer<QFile> out = Helper::openFileForWriting("samples_correl_all.tsv");
        QTextStream outstream(out.data());
        outstream << "#sample\tdoc_mean\tref_correl\tqc" << endl;
        foreach(const SampleData& sample, data)
        {
            outstream << sample.name << "\t" << sample.doc_mean << "\t" << sample.ref_correl << "\t" << sample.qc << endl;
        }
    }
开发者ID:mdozmorov,项目名称:ngs-bits,代码行数:10,代码来源:main.cpp


示例13: outstream

/// \brief Writes the network to file.
/// \param filename A string
/// If filename is nonempty, output is written to the file named filename.
/// If filename is empty, output is written to stdout.
/// The processes are not written to file, only the filenames of the original processes.
void network::save(const std::string& filename) const
{
  std::ofstream outstream(filename.c_str(), std::ofstream::out);
  if (!outstream)
  {
    throw mcrl2::runtime_error("cannot open output file: " + filename);
  }
  write(outstream);
  outstream.close();
}
开发者ID:gijskant,项目名称:mcrl2-pmc,代码行数:15,代码来源:network.cpp


示例14: storeSampleInfo

    void storeSampleInfo(const QVector<SampleData>& data)
    {
		QSharedPointer<QFile> out = Helper::openFileForWriting("samples.tsv");
        QTextStream outstream(out.data());
        outstream << "#sample\tdoc_mean\tref_correl\tcnvs\tcnvs_merged" << endl;
        foreach(const SampleData& sample, data)
        {
            if (sample.qc!="") continue;
            outstream << sample.name << "\t" << sample.doc_mean << "\t" << sample.ref_correl << "\t" << sample.cnvs << "\t" << sample.cnvs_merged << endl;
        }
    }
开发者ID:mdozmorov,项目名称:ngs-bits,代码行数:11,代码来源:main.cpp


示例15: file

QString dataController::addSection(QString sectionInfo) {
    QFile file("../ServerSide/Data/Sections.txt");
    if(!file.open(QIODevice::Append))
    {
        qDebug() << "error opening the Section data" << endl;
    }

    QTextStream outstream(&file);
    outstream<<sectionInfo;

    file.close();
    return("yay");
}
开发者ID:frankgu,项目名称:CText,代码行数:13,代码来源:datacontroller.cpp


示例16: translate

/* pipe an address through a command to translate it */
extern dest *
translate(dest *dp)
{
	process *pp;
	String *line;
	dest *rv;
	char *cp;
	int n;

	pp = proc_start(s_to_c(dp->repl1), (stream *)0, outstream(), outstream(), 1, 0);
	if (pp == 0) {
		dp->status = d_resource;
		return 0;
	}
	line = s_new();
	for(;;) {
		cp = Brdline(pp->std[1]->fp, '\n');
		if(cp == 0)
			break;
		if(strncmp(cp, "_nosummary_", 11) == 0){
			nosummary = 1;
			continue;
		}
		n = Blinelen(pp->std[1]->fp);
		cp[n-1] = ' ';
		s_nappend(line, cp, n);
	}
	rv = s_to_dest(s_restart(line), dp);
	s_restart(line);
	while(s_read_line(pp->std[2]->fp, line))
		;
	if ((dp->pstat = proc_wait(pp)) != 0) {
		dp->repl2 = line;
		rv = 0;
	} else
		s_free(line);
	proc_free(pp);
	return rv;
}
开发者ID:npe9,项目名称:harvey,代码行数:40,代码来源:translate.c


示例17: outstream

bool wxXmlSerializer::SerializeToXml(const wxString& file, bool withroot)
{
	wxFileOutputStream outstream(file);

	if(outstream.IsOk())
	{
		return this->SerializeToXml(outstream, withroot);
	}
	else
		m_sErr = wxT("Unable to initialize output file stream.");

	return false;
}
开发者ID:05storm26,项目名称:codelite,代码行数:13,代码来源:XmlSerializer.cpp


示例18: files

void HistoryDialog::on_savePushButton_clicked()
{
    QString filename = QFileDialog::getSaveFileName(this, "Save macro",
                                                    workspace_->directory(),
                                                    "Text files (*.txt)");
    if (filename.isEmpty()) return;
    QFile outfile(filename);
    outfile.open(QFile::WriteOnly);
    QTextStream outstream(&outfile);
    for (int i = 0; i < ui->actionsListWidget->count(); ++i)
        outstream << ui->actionsListWidget->item(i)->text() << "\n";
    outfile.close();
}
开发者ID:VespucciProject,项目名称:Vespucci,代码行数:13,代码来源:historydialog.cpp


示例19: outstream

void FBX::Node::Dump(
    std::shared_ptr<Assimp::IOStream> outfile,
    bool binary, int indent
) {
    if (binary) {
        Assimp::StreamWriterLE outstream(outfile);
        DumpBinary(outstream);
    } else {
        std::ostringstream ss;
        DumpAscii(ss, indent);
        std::string s = ss.str();
        outfile->Write(s.c_str(), s.size(), 1);
    }
}
开发者ID:BeamNG,项目名称:assimp,代码行数:14,代码来源:FBXExportNode.cpp


示例20: run_sapi_textbased_lipsync

/**
@brief This function demonstrates how to perform "Text Based Lipsync"

Given an audio file and a text file, this method will generate word timings and
phoneme timings of the text file to the audio file using sapi_lipsync and
helpers.

This is the best code to look at first.

The results are printed to std::out
@param strAudioFile - [in] audio file
@param strTextFile - [in] text file
**/
void
run_sapi_textbased_lipsync(std::wstring& strAudioFile, TCHAR *strTextFile, std::wstring outFile)
{
	// 1. [optional] declare the SAPI 5.1 estimator. 
	// NOTE: for different phoneme sets, create a new estimator
	phoneme_estimator sapi51Estimator;

	// 2. Load the text file into memory
	WCHAR * pwszCoMem = 0;
	ULONG cch = 0;
    HRESULT hr = GetTextFile(strTextFile, &pwszCoMem, &cch);
	if (hr == S_OK)
    {
		std::wstring strText(pwszCoMem, cch);

		// 3. declare the sapi lipsync object and call the lipsync method 
		// to start the lipsync process
        sapi_textbased_lipsync lsp(&sapi51Estimator);
		if (lsp.lipsync(strAudioFile, strText))
		{

			// 4. Run the message loop and wait till the lipsync is 
			// finished
			run_lipsync_message_loop(lsp);
              
			// 5. finalize the lipsync results for printing
			// this call will estimate phoneme timings 
			lsp.finalize_phoneme_alignment();
			
			// 6. print the results to the output stream
			//lsp.print_results(std::cout);
			
			// 6'. print results in a file
			std::wstring strOutFile = outFile + L".phonemes.xml";
			std::ofstream outstream(strOutFile.c_str());
			outstream << "<PhonemeTimings audiofile=\"" << wstring_2_string(strAudioFile) << "\" >" << std::endl;
			lsp.print_results(outstream);
			outstream << "</PhonemeTimings>" << std::endl;
			outstream.close();             
		}
		else
		{
			std::wcerr << lsp.getErrorString() << std::endl;			
		}
	}
	else
	{
		std::wcerr << L"Can't open text transcript file" << std::endl;
	}
}
开发者ID:xianyinchen,项目名称:Horde3DGameEngine,代码行数:63,代码来源:sapi_lipsync_main.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ outtextxy函数代码示例发布时间:2022-05-30
下一篇:
C++ outstr函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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